• Divran's E2 Thread
    971 replies, posted
  • Avatar of Bellmanator
  • [QUOTE=whosdr;24665799]Nick, you forgot to persist Speed. You can also use += and -=.. Pos += Holo:forward()*Speed. [code] @name Holo @inputs Vehicle:wirelink #Wire this to the adv. pod controller your using. @persist Pos:vector [Holo E]:entity if(first()){ E = entity() Pos = E:pos() Holo = holoCreate(1) Speed=10 #Sorta obvious runOnTick(1) } holoPos(1,Pos) #Tells this thing where to be holoAng(1,O:eyeAngles()) #Follow the players aim <- Not AimPos(), EyeAngles(). #Forward if(Vehicle["W",number]){Pos=Pos + Holo:forward()*Speed} #Backward if(Vehicle["S",number]){Pos=Pos - Holo:forward()*Speed} #Left (If I'm mistaken and left() is suppose to be right(), please forgive me.) if(Vehicle["A",number]){Pos=Pos + Holo:left()*Speed} #Right if(Vehicle{"D",number]){Pos=Pos - Holo:left()*Speed} [/code][/QUOTE] I'm gonna guess those are mostly suggestions for optimization? The whole Pos=Pos + thing was just habit but as for making the speed variable a persist and only setting the values inside the first() function is just optional.
  • Avatar of snowboardmoose
  • How about a chip that will play a sound at random times, but is simple enough to have more sounds written in.
  • Avatar of FlameCow
  • Anyone know how to make a hologram reset it's position if you leave a specific vehicle?
  • Avatar of Bellmanator
  • [QUOTE=FlameCow;24680865]Anyone know how to make a hologram reset it's position if you leave a specific vehicle?[/QUOTE] [code]@name HReset @inputs Vehicle:wirelink @persist Act HPos:vector if(first()){ runOnTick(1) Act=0 } if(Vehicle["Active",number]){Act=1} if(!Vehicle["Active",number]){Act=0} if(Act=0){HPos=vec()} [/code]
  • Avatar of Decoy Ocelot
  • [QUOTE=nick10510;24681037][code]@name HReset @inputs Vehicle:wirelink @persist Act HPos:vector if(first()){ runOnTick(1) Act=0 } if(Vehicle["Active",number]){Act=1} if(!Vehicle["Active",number]){Act=0} if(Act=0){HPos=vec()} [/code][/QUOTE] could, I belive, be optimized to: [code] @inputs Vehicle:wirelink @persist HPos:vector if(!Vehicle["Active",normal]) { holoPos(Index,Hpos) } [/code]
  • Avatar of ABS
  • Simple lockable door. [CODE]@name Door @inputs B1 B2 BL #B1 - Inside button, B2 - Outside ~, BL - Lock door @outputs H C=47 #Hydraulic length when closed T=3 #How many seconds should it be open for T=T*1000 #Converting seconds to milliseconds if (B1==1) { H=0 timer("yeah", T) } if (B2==1) { if (BL==0) { H=0 timer("yeah", T) } } if (clk("yeah")) {H=C}[/CODE] Also an indicator for lock button.
  • Avatar of Dark207
  • Can you make an E2 connect to an NPC and make it your pet, but have a leveling system and upgrades, things like that.
  • Avatar of ryan1271
  • [media]http://www.youtube.com/watch?v=GpamGKxfSKg[/media] Could someone make this? You can simplify it if you want.
  • Avatar of mariosuchy
  • I'm talking about something like this ( [url]http://en.wikipedia.org/wiki/File:Torque_animation.gif[/url] ) with an unit of N ( [url]http://en.wikipedia.org/wiki/Newton_(unit[/url]) )
  • I'm trying to make a rollermine e2. A holo rollermine on the players feet, moves when you move (in the direcction you move), Makes noise when it moves, maybe make it able to attack enemies (not much damage like 20)? Also have commands to make different noises like alert and yes and such. I have the basic part done already, but I can't get the idle noise quieter, the SoundVolume function doesn't work for me. Much appreciated @name RollerMine Player @inputs @outputs @persist @trigger if (first()) {entity():owner():soundPlay(0,0,"npc/roller/mine/rmine_reprogram.wav") entity():owner():setColor(0,0,0,0) entity():owner():setMaterial("Models/effects/vol_light001") holoCreate(1) holoModel(1,("sphere")) holoMaterial(1,("models/shiny/shinywhite")) holoScale(1,vec(1,1,1)) holoColor(1,vec(0,0,255)) holoAng(1,ang(0,0,0)) #idle noise entity():owner():soundPlay(1,0,"npc/roller/mine/rmine_seek_loop2.wav") } holoPos(1,owner():shootPos()-vec(0,0,50)) holoParent(1,owner()) #Didn't finish this, For moving normally then the fast sound for sprinting. if(owner():vel():length()){entity():owner():soundPlay(2,0,"npc/roller/mine/rmine_moveslow_loop1.wav")}
  • Avatar of lostone1993
  • could someone make me an e2 for a computer terminal ie i type in commands i can link the commands to other function so i need a screen a keyboard attached and for it when i prees enter it seaches for the command and if possible make it labeled so i know where to insert commands and maybe a flashing cursor thanks
  • Avatar of revdirty
  • I would like to have a e2 chip to replace the advanaced gyropod. the ADV gyropod is buggy and crashes my server.. am looking to e2 code to replace basic gyropod fuctions like movment (forward, back, left, right, mouse aim, up, down , level and freeze.) and maybe and avtivate command. needs to also beable to adjust speed of movement to accomdate diffrent ship sizes and weights.
  • Avatar of 40KEndgame
  • I need three relatively complex E2s. This may be a lot of work. 1. An E2 chip that replaces the Advanced Pod Controler and adds Joystick controls for a Logitec Attack 3 Joystick. (I've been needing this for a while, so if nothing else, at least make this one) 2. An E2 that can work together with a hoverdrive/Spacebuild warp drive, a gfx screen, and a wired keyboard to create a free-range hyperdrive. (I could probably get something working with just wire, but it won't be very user friendly, so I need an E2) 3. An E2 chip that can be used to turn a ragdoll into an NPC (mainly a ragdoll from the Pokemon prop packs).
  • Avatar of whosdr
  • I wouldn't even know where to begin with 1. No doubt you'd need a binary module to link, unless you were to bind the joystick to keys. As for 2, no idea what you mean. And you'd need prop core on the server. 3. Impossible.
  • Avatar of 40KEndgame
  • With #s 1 and 2, I'm wanting to build some of the most advanced ships ever seen for spacebuild, capable of aerobatics crazier than what a 30 size nitro RC helicopter can do, and with a "hyperdrive" that isn't restricted to previously saved locations or locater beacons. I need controls that can keep up with the ship's maneuverability, and a user friendly interface for the Hoverdrive/Warp Drive. On #3, I'll try requesting it again next year. There could be enough developments by then to make it possible. I would attempt to write all these myself, since I have a ton of experience with C++ and the programming theory that comes with it, but I don't know E2 and all the guides I've seen were written in a way that seems rushed (I expected the equivalent of a textbook and got a single page on every single one, and the Youtube tutorials were impossible to follow).
  • Avatar of whosdr
  • #3 would be have too much 'mingeability', so I doubt it'd ever be possible.
  • Avatar of 40KEndgame
  • [QUOTE=whosdr;25361640]#3 would be have too much 'mingeability', so I doubt it'd ever be possible.[/QUOTE] Mingeability? If you mean that along the lines of what happened with the drunken combine, then I understand. If you can rig something up, could you PM me instead of posting it here so that it doesn't go public, and maybe add dupe protection? I only intend for it to be usable by myself, due to the fact that it would likely be laggy in quantity (imagine the lag that so many "lifelike" Eevees, Flareons, Vaporeons, Jolteons, Espeons, Umbreons, Glaceons, and Leafeons would cause, not to mention how easy it would be for them to get underfoot). As for the binary module for the joystick, I could probably write that in C++. Would it be a DLL or an executable binary, and what would I need to know beforehand so that I don't just tie in a bunch of text?
  • Avatar of ContiX
  • I've seen chips that turn ragdolls into NPCs...sort of. I found one a while back that turns them into "zombies", with their hands in front of them and they float around via applyforce. They follow their owner and will attack until you're dead, even if you're in space (since I play Spacebuild often.) More chips spawned on the same ragdoll make it move faster (more force, I guess.) This works pretty well on virtually any ragdoll, although the hands-in-front-of-self doesn't quite work on things that don't have hands, like mattresses or Striders. It even works on ragdolled players, too. Quite silly, really. Let me see if I can find the code... EDIT: Here. I'm not sure where I got it, though. [code] @name Ragdolls to Zombies @persist Base:vector Delay interval(10) E = entity():isWeldedTo() OPos = owner():shootPos() E:setMass(100) #Sets up parts we're gonna use RH = E:bone(7) #Right hand LH = E:bone(5) #Left hand Head = E:bone(10) LF = E:bone(13) #Left foot RF = E:bone(14) #Right Foot if ((E:pos():distance(OPos) < 100) & !Delay) { soundPurge() timer("delay",750) Force = 10^9 soundPlay(0,100,"npc/zombie/zo_attack2.wav") E:applyForce(Force * (OPos - E:pos())) Delay = 1 } else { Force = 3 E:applyForce(E:vel() * -7) } if (clk("delay")) {Delay = 0} #Extends teh arms RH:applyForce(Force*(OPos - RH:pos())) LH:applyForce(Force*(OPos - LH:pos())) #To make it stand up, I pushed the feet down and the head up. Base = vec(0,0,150) LF:applyForce(-Base) RF:applyForce(-Base) Head:applyForce(Base*10) [/code]
  • Avatar of ContiX
  • I had ten of 'em following me, with little to no lag. Perhaps a more advanced one is possible with little affect on performance?
  • Avatar of revdirty
  • I want basically a e2 chip to do what the advance gyro pod does but be more stable . the advance gyro pod has a high tendency to crash the server. even better would be a e2 chip that does all or at least most of the functionality of the advanced gyropod and a parenter (or perm ploy weld, not sure which is better). Basically after said e2 chip is laid down , you would wired up the controls for flight, however u'd like, the e2 chip would parent, measure and adjust weight accordingly. Playing on space build servers loses its fun when everytime I build a ship and go to get flight done with gyropod. server crashes/ in terms of gyro pod functions. I&#8217;d like a toggle able mouse aim for pitch and yaw. auto lever and a freeze command to lock ship in place. I have scoured ever gmod resource I could find to find something to replace the gyro pod but nothing come close to what I need. , the auto parent portion is just a nice bonus to the code , because I think most people would do that sorta thing to a ship anyway.
  • Avatar of ContiX
  • I've never had it crash a server before. It's also being reworked, by the way.
  • Avatar of Toyokunari
  • Please can have a E2 chip that controls the speed of a prop wheel, I want it so when I press a button it goes to 38 kmph then when I press again the wheel allow to go to speed 60 and when I press 3rd time speed allow to go anywhere :) please can I also have a 2nd E2 chip for another thing, I want it so the E2 chip makes the prop attach to the ground or push to the ground please ! thankyou thankyou. (basically RPM limiter)