Nebtown Wiki
Advertisement

Expression 2 is the second rendition of Expression. It uses different syntax than expression 1, but runs much faster and has many additional functions. Instructions can be found here:

http://wiki.garrysmod.com/wiki/?title=Wire_Expression2


To use these expressions: Make a folder in garrysmod/data named Expression2.

Create a .txt file, and copy-paste the expression into it, save.

Go to the E2 Stool ingame, and hit Update at the bottom of the list of files.

Click the expression in the list to load it, then fire it where you want.

You can update expressions simply by loading the new one, and shooting the old one. *unless the names of the inputs/outputs have changed*, all wiring will remain.




The Nolphin, or Nebcorp automatic self-righting hovering gyrations and maneuverabilities calculation chip, Version Four.

Nolphin V4


Other Thruster Based chips:

Recieves a target XYZ, outputs instructions for a Vector Thruster to take you there.

@name Vectorizer @inputs X Y Z Off @outputs VThruster:vector @persist

  1. Inputs XYZ are your target location.
  2. The Vector output should be wired to a Vector Thruster (set to World XYZ) and will push towards the location.
  3. Possible sources of XYZ: Beacon sensor tracking a player, Laser Pointer Reciever, GPS

AddThisMuchExtraHeight = 0 VThruster = vec(entity():pos():x() - X, entity():pos():y() - Y, entity():pos():z() - Z + AddThisMuchExtraHeight) if(Off) {VThruster = vec(0,0,0) interval(20)




Spacebuild Products: A deluxe fuel gauge (shows percents) for Spacebuild 2.

Also can be used to regulate generators (turns off Air generators when theres plenty of air) and then intellegently keeps them off until you need the resource again, or to control your Life support (turns off space shield if theres no coolant, turns off AC if low power to preserve the space shield, etc)



@name Nebcorp Fuel Gauge Deluxe 2 @inputs Air MaxAir Coolant MaxCoolant Energy MaxEnergy EverythingOff ACOff ShieldsOff @outputs EPercent AirPercent CoolantPercent EnergyPercent Fuel FuelLowAlarm AC SpaceShield CoolantCompressor OxyGenerator EnergyGenerator @persist interval(500) APercent = round((Air / MaxAir * 100), 1) CPercent = round((Coolant / MaxCoolant * 100), 1) EPercent = round((Energy / MaxEnergy * 100), 1) if(APercent < 0.75 | CPercent < 1 | EPercent < 1.5) {FuelLowAlarm = 1} else{FuelLowAlarm = 0} if(APercent < CPercent) {Fuel = APercent} else{Fuel = CPercent} if(Fuel > EPercent) {Fuel = EPercent} if(APercent < 30 & EPercent > 3) {OxyGenerator = 1} if(APercent > 98 | EPercent < 1) {OxyGenerator = 0} if(CPercent < 30 & EPercent > 3) {CoolantCompressor = 1} if(CPercent > 98 | EPercent < 1) {CoolantCompressor = 0} if(EPercent < 30) {EnergyGenerator = 1} if(EPercent > 98) {EnergyGenerator = 0} if(CPercent < 0.3 | EnergyPercent < 0.2) {SpaceShield = 0} else{SpaceShield = 1} if(APercent < 0.5 | CPercent < 0.8 | EPercent < 1) {AC = 0} if(APercent > 1 | CPercent < 1.2 | EPercent < 1.5) {AC = 1} if(EverythingOff) {OxyGenerator = 0, CoolantCompressor = 0, SpaceShield = 0, AC = 0} if(ACOff) {AC = 0} if(ShieldsOff) {SpaceShield = 0} if(APercent > 99.8) {AirPercent = 100} else{AirPercent = APercent} if(EPercent > 99.8) {EnergyPercent = 100} else{EnergyPercent = EPercent} if(CPercent > 99.8) {CoolantPercent = 100} else{CoolantPercent = CPercent}



The above fuel gauge, for Spacebuild 3

@name Nebcorp Fuel Gauge Deluxe 3 @inputs Energy MaxEnergy Oxygen MaxOxygen Water MaxWater Nitrogen MaxNitrogen Hydrogen MaxHydrogen CarbonDioxide MaxCarbonDioxide EverythingOff ACOff @outputs FuelPercent FuelLowAlarm GlobalOn EnergyGenerator OxygenGenerator WaterGenerator NitrogenGenerator HydrogenGenerator CarbonDioxideGenerator @persist interval(500) OPercent = round((Oxygen / MaxOxygen * 100), 1) WPercent = round((Water / MaxWater * 100), 1) NPercent = round((Nitrogen / MaxNitrogen * 100), 1) HPercent = round((Hydrogen / MaxHydrogen * 100), 1) CDPercent = round((CarbonDioxide / MaxCarbonDioxide * 100), 1) EPercent = round((Energy / MaxEnergy * 100), 1) GlobalOn = !EverythingOff if(OPercent < 0.75 | WPercent < 1 | EPercent < 1.5) {FuelLowAlarm = 1} else{FuelLowAlarm = 0} if(OPercent < WPercent) {FuelPercent = OPercent} else{FuelPercent = WPercent} if(FuelPercent > EPercent) {FuelPercent = EPercent} if(OPercent < 30 & EPercent > 3) {OxygenGenerator = 1} if(OPercent > 98 | EPercent < 1) {OxygenGenerator = 0} if(NPercent < 30 & EPercent > 3) {NitrogenGenerator = 1} if(NPercent > 98 | EPercent < 1) {NitrogenGenerator = 0} if(HPercent < 30 & EPercent > 3) {HydrogenGenerator = 1} if(HPercent > 98 | EPercent < 1) {HydrogenGenerator = 0} if(CDPercent < 30 & EPercent > 3) {CarbonDioxideGenerator = 1} if(CDPercent > 98 | EPercent < 1) {CarbonDioxideGenerator = 0} if(WPercent < 30 & EPercent > 3) {WaterGenerator = 1} if(WPercent > 98 | EPercent < 1) {WaterGenerator = 0} if(EPercent < 30) {EnergyGenerator = 1} if(EPercent > 98) {EnergyGenerator = 0} if(OPercent < 0.5 | WPercent < 0.8 | EPercent < 1) {AC = 0} if(OPercent > 1 | WPercent < 1.2 | EPercent < 1.5) {AC = 1} if(EverythingOff) {OxygenGenerator = 0, WaterGenerator = 0, HydrogenGenerator = 0, NitrogenGenerator = 0, CarbonDioxideGenerator = 0, AC = 0} if(ACOff) {AC = 0}



Miscellaneous This is a video game Expression I made for use in the lounge of the behemoth. Instructions: To hook this up, you need a screen consisting of fifteen pixels. Three across, five down. From left to right, then top to buttom, they are to be wired to AA, AB, AC, BA, etc all the way to EA, EB, and EC. Wire "Score" and "Lives to a wire screen that can be viewed by the player. For Inputs, wire the Randomizer to a round gate, then wire the round gate to a random value between 0 and 3. Then wire the B1, B2, and B3 to whatever control configuration you plan to use. I personally used an advanced pod controller. Wire reset can also be set to whatever you wish, though I personally wired it to a not gate, then the not gate to the "Active" output of the pod controller. The goal of the game is to move the bottum pixel to catch the ones coming from the top. You have three lives to get as high a score as you can. @name Ball_Cather_Game @inputs Randomizer B1 B2 B3 Reset @outputs AA AB AC BA BB BC CA CB CC DA DB DC Score Lives @persist A B C D interval(1000) if(Reset){Score=0, Lives=3, A=0, B=0, C=0, D=0, AA=0, AB=0, AC=0, BA=0, BB=0, BC=0, CA=0, CB=0, CC=0, DA=0, DB=0, DC=0} else{if(Lives>0&(!~Randomizer&!~B1&!~B2&!~B3)) { if(B1+B2+B3>1){Score-=2} if((DA&B1)|(DB&B2)|(DC&B3)){Score++} else{if(D!=0){Lives--}} D=C C=B B=A A=Randomizer AA=(A==1), AB=(A==2), AC=(A==3) BA=(B==1), BB=(B==2), BC=(B==3) CA=(C==1), CB=(C==2), CC=(C==3) DA=(D==1), DB=(D==2), DC=(D==3) }}



Nebcorp Jukebox v3.1, February 9th

Plays through a list of 43 songs, automatically playing the next when the previous completes. Anything may be used as a speaker, just wire something showing your target's EntID (ranger) or Entity:entity data (target finder). (Or whatever its attached to, aka default).

New: Now semi-server based. If more than one jukebox exist, they will all play the same song.

New: Semi-server actually works, now defaults to attached prop if no inputs given.



@name Nebcorp Jukebox @inputs On Next EntID EntityIn:entity @outputs Current Timer Duration Role:string S:entity @persist OldTime Current Duration Current2 Current3 Current4 PropB:entity

  1. IMPORTANT:

NumberOfSongs = 43 interval(20) if(EntID) {Entity = entity(EntID)} elseif(EntityIn) {Entity = EntityIn} else{R = ranger(-25):entity(), if(R != entity() & R) {PropB = R}, Entity = PropB}

  1. SERVER ASPECTS

gSetGroup("Muzak")

  1. Checks to see if theres already a server, if not sets self as server

if(gGetNum("Server") == 0 | entity(gGetNum("Server")):type() != "gmod_wire_expression2") {gSetNum("Server", entity():id())}

  1. Actually processes what songs should be played

if(gGetNum("Server") == entity():id()) { Timer = curtime() - OldTime if(Duration + 1.5 < Timer) {Ended = 1} if(Ended | (~Next & Next)) {Current3 = ceil(random(0.01, NumberOfSongs)), OldTime = curtime(), Ended = 0} gSetNum("Current3", Current3) Role = "Servering" }

  1. END SERVER ASPECTS
  2. CLIENT ASPECTS

else{Current3 = gGetNum("Current3"), Role = "Clienting", E = entity(gGetNum("Server"))} if(On) {Current = Current3} else{Current = 0, Current2 = 0}

  1. End Client
  2. BEGIN ACTUAL SONG LISTING

if((Current != Current2) & Current == 1) { Duration = 71 Entity:soundPlay("Song1", Duration, "ui/gamestartup1.mp3")} elseif(Current != 1) {soundStop("Song1"), 1}

if((Current != Current2) & Current == 2) { Duration = 241 Entity:soundPlay("Song2", Duration, "ui/gamestartup2.mp3")} elseif(Current != 2) {soundStop("Song2"), 1}

if((Current != Current2) & Current == 3) { Duration = 139 Entity:soundPlay("Song3", Duration, "music/HL2_song20_submix4.mp3")} elseif(Current != 3) {soundStop("Song3"), 1}

if((Current != Current2) & Current == 4) { Duration = 73 Entity:soundPlay("Song4", Duration, "music/HL2_song12_long.mp3")} elseif(Current != 4) {soundStop("Song4"), 1}

if((Current != Current2) & Current == 5) { Duration = 170 Entity:soundPlay("Song5", Duration, "music/HL2_song16.mp3")} elseif(Current != 5) {soundStop("Song5"), 1}

if((Current != Current2) & Current == 6) { Duration = 99 Entity:soundPlay("Song6", Duration, "music/VLVX_song04.mp3")} #Ep1 elseif(Current != 6) {soundStop("Song6"), 1}

if((Current != Current2) & Current == 7) { Duration = 114 Entity:soundPlay("Song7", Duration, "music/HL2_song29.mp3")} elseif(Current != 7) {soundStop("Song7"), 1}

if((Current != Current2) & Current == 8) { Duration = 81 Entity:soundPlay("Song8", Duration, "music/HL2_song1.mp3")} elseif(Current != 8) {soundStop("Song8"), 1}

if((Current != Current2) & Current == 9) { Duration = 124 Entity:soundPlay("Song9", Duration, "music/VLVX_song20.mp3")} elseif(Current != 9) {soundStop("Song9"), 1}

if((Current != Current2) & Current == 10) { Duration = 62 Entity:soundPlay("Song10", Duration, "music/VLVX_song0.mp3")} elseif(Current != 10) {soundStop("Song10"), 1}

if((Current != Current2) & Current == 11) { Duration = 107 Entity:soundPlay("Song11", Duration, "music/VLVX_song15.mp3")} elseif(Current != 11) {soundStop("Song11"), 1}

if((Current != Current2) & Current == 12) { Duration = 194 Entity:soundPlay("Song12", Duration, "music/VLVX_song22.mp3")} elseif(Current != 12) {soundStop("Song12"), 1}

if((Current != Current2) & Current == 13) { Duration = 166 Entity:soundPlay("Song13", Duration, "music/VLVX_song23.mp3")} elseif(Current != 13) {soundStop("Song13"), 1}

if((Current != Current2) & Current == 14) { Duration = 127 Entity:soundPlay("Song14", Duration, "music/VLVX_song24.mp3")} elseif(Current != 14) {soundStop("Song14"), 1}

if((Current != Current2) & Current == 15) { Duration = 167 Entity:soundPlay("Song15", Duration, "music/VLVX_song25.mp3")} elseif(Current != 15) {soundStop("Song15"), 1}

if((Current != Current2) & Current == 16) { Duration = 110 Entity:soundPlay("Song16", Duration, "music/VLVX_song26.mp3")} elseif(Current != 16) {soundStop("Song16"), 1}

if((Current != Current2) & Current == 17) { Duration = 209 Entity:soundPlay("Song17", Duration, "music/VLVX_song27.mp3")} elseif(Current != 17) {soundStop("Song17"), 1}

if((Current != Current2) & Current == 18) { Duration = 194 Entity:soundPlay("Song18", Duration, "music/VLVX_song28.mp3")} elseif(Current != 18) {soundStop("Song18"), 1}

if((Current != Current2) & Current == 19) { Duration = 74 Entity:soundPlay("Song19", Duration, "music/VLVX_song9.mp3")} elseif(Current != 19) {soundStop("Song19"), 1}

if((Current != Current2) & Current == 20) { Duration = 95 Entity:soundPlay("Song20", Duration, "music/VLVX_song3.mp3")} elseif(Current != 20) {soundStop("Song20"), 1}

if((Current != Current2) & Current == 21) { Duration = 58 Entity:soundPlay("Song21", Duration, "music/portal_4000_degrees_kelvin.mp3")} elseif(Current != 21) {soundStop("Song21"), 1}

if((Current != Current2) & Current == 22) { Duration = 226 Entity:soundPlay("Song22", Duration, "music/portal_android_hell.mp3")} elseif(Current != 22) {soundStop("Song22"), 1}

if((Current != Current2) & Current == 23) { Duration = 245 Entity:soundPlay("Song23", Duration, "music/portal_no_cake_for_you.mp3")} elseif(Current != 23) {soundStop("Song23"), 1}

if((Current != Current2) & Current == 24) { Duration = 261 Entity:soundPlay("Song24", Duration, "music/portal_party_escort.mp3")} elseif(Current != 24) {soundStop("Song24"), 1}

if((Current != Current2) & Current == 25) { Duration = 72 Entity:soundPlay("Song25", Duration, "ambient/guit1.wav")} # From CSS elseif(Current != 25) {soundStop("Song25"), 1}

if((Current != Current2) & Current == 26) { Duration = 211 Entity:soundPlay("Song26", Duration, "music/portal_self_esteem_fund.mp3")} elseif(Current != 26) {soundStop("Song26"), 1}

if((Current != Current2) & Current == 27) { Duration = 240 Entity:soundPlay("Song27", Duration, "music/portal_stop_what_you_are_doing.mp3")} elseif(Current != 27) {soundStop("Song27"), 1}

if((Current != Current2) & Current == 28) { Duration = 186 Entity:soundPlay("Song28", Duration, "music/portal_taste_of_blood.mp3")} elseif(Current != 28) {soundStop("Song28"), 1}

if((Current != Current2) & Current == 29) { Duration = 104 Entity:soundPlay("Song29", Duration, "music/portal_subject_name_here.mp3")} elseif(Current != 29) {soundStop("Song29"), 1}

if((Current != Current2) & Current == 30) { Duration = 384 Entity:soundPlay("Song30", Duration, "music/portal_you_cant_escape_you_know.mp3")} elseif(Current != 30) {soundStop("Song30"), 1}

if((Current != Current2) & Current == 31) { Duration = 84 Entity:soundPlay("Song31", Duration, "music/portal_youre_not_a_good_person.mp3")} elseif(Current != 31) {soundStop("Song31"), 1}

if((Current != Current2) & Current == 32) { Duration = 40 Entity:soundPlay("Song32", Duration, "ambient/office/OfficeNews.wav")} # From CSS elseif(Current != 32) {soundStop("Song32"), 1}

if((Current != Current2) & Current == 33) { Duration = 80 Entity:soundPlay("Song33", Duration, "ambient/music/country_rock_am_radio_loop.wav")} # From CSS elseif(Current != 33) {soundStop("Song33"), 1}

if((Current != Current2) & Current == 34) { Duration = 50 Entity:soundPlay("Song34", Duration, "ambient/music/cubanmusic1.wav")} # From CSS elseif(Current != 34) {soundStop("Song34"), 1}

if((Current != Current2) & Current == 35) { Duration = 80 Entity:soundPlay("Song35", Duration, "ambient/music/flamenco.wav")} # From CSS elseif(Current != 35) {soundStop("Song35"), 1}

if((Current != Current2) & Current == 36) { Duration = 70 Entity:soundPlay("Song36", Duration, "ambient/music/latin.wav")} # From CSS elseif(Current != 36) {soundStop("Song36"), 1}

if((Current != Current2) & Current == 37) { Duration = 73 Entity:soundPlay("Song37", Duration, "ambient/music/mirame_radio_thru_wall.wav")} # From CSS elseif(Current != 37) {soundStop("Song37"), 1}

if((Current != Current2) & Current == 38) { Duration = 15 Entity:soundPlay("Song38", Duration, "ambient/intro/Explosion02.wav")} #From Ep1 elseif(Current != 38) {soundStop("Song38"), 1}

if((Current != Current2) & Current == 39) { Duration = 78 Entity:soundPlay("Song39", Duration, "music/VLVX_song11.mp3")} #From Ep1 elseif(Current != 39) {soundStop("Song39"), 1}

if((Current != Current2) & Current == 39) { Duration = 78 Entity:soundPlay("Song39", Duration, "music/VLVX_song11.mp3")} #From Ep1 elseif(Current != 39) {soundStop("Song39"), 1}

if((Current != Current2) & Current == 40) { Duration = 120 Entity:soundPlay("Song40", Duration, "music/VLVX_song12.mp3")} #From Ep1 elseif(Current != 40) {soundStop("Song40"), 1}

if((Current != Current2) & Current == 41) { Duration = 152 Entity:soundPlay("Song41", Duration, "music/VLVX_song18.mp3")} #From Ep1 elseif(Current != 41) {soundStop("Song41"), 1}

if((Current != Current2) & Current == 42) { Duration = 169 Entity:soundPlay("Song42", Duration, "music/VLVX_song21.mp3")} #From Ep1 elseif(Current != 42) {soundStop("Song42"), 1}

if((Current != Current2) & Current == 43) { Duration = 4 Entity:soundPlay("Song43", Duration, "weapons/explode1.wav")} #From Ep1 elseif(Current != 43) {soundStop("Song43"), 1}


Current2 = Current



Advertisement