Weaponry & Defense expressions
Caduceus teleportation protocol Mk-I
Effect: Whenever an RPG round is within 75 units (Determined every half second), the expression feeds a random location between 150 and 200 units from the attached object to the hoverdrive and launches it, effectively ensuring that the RPG round will miss.
Application: Place the expression on a prop, wire the hoverdrive SetJumpTarget and Jump to the Jump output and the vector input to the Vector output, and attach a toggle button (On = 1) to the Defend input. Ensure that the hoverdrive is connected to the overall contraption or it will simply randomly teleport whenever an RPG comes near the hoverdrive, without actually moving the contraption.E2 Code:
@name Caduceus teleportation defense @inputs Defend @outputs Vector:vector Jump Dist Clk @persist Base:entity Clock RPG:entity Loc:vector if(first()){ Base = entity():isWeldedTo() Clock = findUpdateRate() + 100 Loc = Base:pos() Vector = Base:pos()} #Activation & RPG search if(Defend){ timer("sear_clk",Clock) if(clk("sear_clk") & !Clk){ findByClass("rpg_missile") RPG = findClosest(Base:pos())}} #Checking the distance to nearest RPG if(RPG & !Clk){ timer("rpg_check",10) Dist = Loc:distance(RPG:pos()) if(Dist < 400 & clk("rpg_check")){ Loc = Base:pos() Rand1 = random(-1,1) Rand2 = random(-1,1) Rand3 = random(-1,1) X = random(150,200) Y = random(150,200) Z = random(150,200) if(Rand1 < 0){X = X * -1} if(Rand2 < 0){Y = Y * -1} if(Rand3 < 0){Z = Z * -1} Vector = vec(X,Y,Z) + Loc Jump = !Jump Clk = 1}} #Ensure the hoverdrive has rematerialised before rechecking if(Clk){ timer("tele",100) if(clk("tele")){Clk = 0}}
------------------------------------
Cycnus dumb missile Mk-I
Effect: Need a quick missile? Plant a Cycnus dumb missile chip wherever you like and tell it to fire. If it hits anything, keeps going for 5 seconds, or you send the signal to detonate anyways, it explodes out into a 200 unit radius dealing moderate damage.
Application: Place the launch chip and attach buttons or numpad inputs to both inputs, they don't need to be toggled but the On values must be positive. Then, place the missile chip(s) anywhere you want, with the chip decal facing in the direction you want the missile to fire. Do NOT weld them to anything. The inputs should be self-explanatory as to what they do.Notes: This is my very first attempt at using applyForce(), so if anything goes wrong it's either that or the lack of the detonate(N,N,N,N) function in your copy of Wiremod.Code:E2 Code:
@name Cycnus dumb missile @inputs @outputs @persist Fire Premat Push:vector Me:entity Clock if(first()){ Push = -entity():up()*10 Me = entity() signalSetGroup("Cycnus launch",0)} runOnSignal("Launch",0) runOnSignal("Detonate",0) if(signalClk("Launch")){Fire = 1} if(signalClk("Detonate")){Premat = 1} if(Fire){ interval(10) applyForce(Push) Clock +=1 if(Clock = 500|$Me:vel() < 0){Premat = 1}} if(Premat){selfDestruct()}E2 Code:
@name Cycnus remote @inputs Launch Detonate @outputs if(first()){signalSetGroup("Cycnus launch")} if(Launch){signalSend("Launch")} if(Detonate){signalSend("Detonate")}
------------------------------------
Lethe stealth protocol Mk-I
Effect: Turns an entire contraption completely 100% transparent and back again, preserving initial transparencies, at the push of a button.
Application: Place the first expression chip onto your contraption and the second anywhere else (Do NOT put it on the contraption, or you'll have a hard time finding it). Wire the Active input of the second chip to a toggled button (On = 1, Off = 0 for the button).Notes: This basically remotely sets the contraption with the first expression chip to have Alpha 0 on all of it's components, so you could still walk into it, shoot it, etc. you just won't be able to see a single part of it.Code:E2 Code:
@name Lethe stealth cloak @inputs @outputs @persist Base:array Body:array Entry if(first()){signalSetGroup("Lethe")} runOnSignal("Engage",0) runOnSignal("Disable",0) if(signalClk("Lethe","Engage",0)){Cloak = 1} if(signalClk("Lethe","Disable",0)){Decloak = 1} if(Cloak == 1){ Body = entity():getConstraints() timer("working...",10) Base:setNumber(Entry, Body:entity(Entry):getAlpha()) Body:entity(Entry):setAlpha(0) if(Entry == Body:count()){ stoptimer("working...") Entry = 0 Cloak = 0} else{Entry += 1}} if(Decloak == 1){ timer("decloak",10) Body:entity(Entry):setAlpha(Base:number(Entry)) if(Entry == Body:count()){ Entry = 0 stoptimer("decloak") Decloak = 0} else{Entry += 1}}E2 Code:
@name Lethe cloak activator @inputs Active @outputs if(first()){signalSetGroup("Lethe")} if(Active){signalSend("Engage",0)} else{signalSend("Disable",0)}
Because it's signal based, you can even put it on a bunch of different contraptions and operate the whole cloaking system with the one button. Invisible contraption army?
This adaptation is also my first attempt at using the Signal functions, so if it doesn't work that's probably why.
------------------------------------
Lethe stealth grenade
Effect: Throwing down this expression grenade will cause all of your items (props, contraptions, and even NPCs) within 400 units to gradually disappear from view into invisibility. Activating the signal with the second expression will reverse the process and destroy all of your Lethe grenades.
Application: Place the first expression wherever you want, and place the second expression anywhere and wire a button (toggle or otherwise, on = 1) to the Deactivate input. You do not need to have the second expression spawned to use the first, only to deactivate it.Notes:You can change the 1s in the signal settings to 0s to prevent others from reverting your grenades, but it's largely there for admin purposes at the moment.Code:E2 Code:
@name Lethe stealth grenade @inputs @outputs @persist Base:array if(first()|dupe()){ signalSetGroup("Lethe") findInSphere(entity():pos(),400) findSortByDistance(entity():pos()) Qty = findInSphere(entity():pos(),400) Base = array() if(Entry != Qty){ interval(10) if(findResult(Entry):owner() != entity():owner()){Entry += 1} else{ Base:setNumber(Entry,findResult(Entry):getAlpha()) findResult(Entry):setAlpha(0) Entry += 1}} else{Entry = 0} runOnSignal("Grenades off",1)} if(signalClk("Lethe","Grenades off",1){ if(Entry != Qty){ interval(10) if(findResult(Entry):owner() != entity():owner()){Entry += 1} else{ findResult(Entry):setAlpha(Base:number(Entry)) Entry += 1}} else{selfDestruct()}E2 Code:
@name Lethe grenade deactivator @inputs Deactivate @outputs if(first()){signalSetGroup("Lethe")} if(Active & ~Active){ signalSend("Grenades off",1) selfDestruct()}
The cloaking field does not affect any objects or NPCs that move into the area during or after activation, but it will revert them on cue even if they have moved out of the region afterwards. In theory if you stand close enough you can turn yourself invisible.


LinkBack URL
About LinkBacks






Reply With Quote






Bookmarks