Sigh, find functions every tick is not allowed...
Needs FAQCode:if(findCanQuery()) { findIncludePlayerProps(owner()) findByClass("prop_ragdoll") }
i saw the portal 2 E3 gameplay trailer, i love the suction vent that sucks up turrets. so i wanted to make a simple thing to do that.
im no good with loops and i dont really understand how a for loop works, that is why its only working with the last prop spawned.
Code:@name suction vent @inputs @outputs @persist Props:array V:vector Prop:entity T @model models/props_bts/clear_tube_straight.mdl runOnTick(1) T = T + 1*25 V = (entity():pos() - Prop:pos())*500 findIncludePlayerProps(owner()) findByClass("prop_ragdoll") Props=findToArray() for (I = 0, Props:count()) { Prop=Props[I,entity] Prop:applyForce(V + $V*2) } Prop:setColor(255,0,0) Prop:applyAngForce(ang(0,T,0))
the applyAngForce is just for an effect, right now it finds ragdolls, i can change it to props but i cant do both.
thanks for the help, postman.
My stuff:
AI E2's:
Bugz|Tribbles|Wonderball|AI release thread
Other:
Hoverboard|E2 release thread
Holo Stargate|Holo Dashboard|Poltergeist
(tell me if any of the links dont work via PM please)
Sigh, find functions every tick is not allowed...
Needs FAQCode:if(findCanQuery()) { findIncludePlayerProps(owner()) findByClass("prop_ragdoll") }
fix'dCode:@name suction vent @inputs @outputs @persist Props:array V:vector Prop:entity T @model models/props_bts/clear_tube_straight.mdl runOnTick(1) T = T + 1*25 V = (entity():pos() - Prop:pos())*500 if(findCanQuery()){ findIncludePlayerProps(owner()) findByClass("prop_*") Props=findToArray() } for (I = 0, Props:count()) { Prop=Props[I,entity] Prop:applyForce(V + $V*2) } Prop:setColor(255,0,0) Prop:applyAngForce(ang(0,T,0))
No pickie no clickie.
Check out NG's newest way to give props on the internet! NG Forum post | MBTM Website
|Movement of Freedom|Freedom of Movement|SFParkour.com|
My stuff:
AI E2's:
Bugz|Tribbles|Wonderball|AI release thread
Other:
Hoverboard|E2 release thread
Holo Stargate|Holo Dashboard|Poltergeist
(tell me if any of the links dont work via PM please)
Ah, that makes sense, i dont know all my functions so i dont know what "findCanQuery()" does. ill look that up on the e2 wiki, thanks![]()
My stuff:
AI E2's:
Bugz|Tribbles|Wonderball|AI release thread
Other:
Hoverboard|E2 release thread
Holo Stargate|Holo Dashboard|Poltergeist
(tell me if any of the links dont work via PM please)
sorry to say, this doesnt work. It throws all props but the first one away from the entity
My stuff:
AI E2's:
Bugz|Tribbles|Wonderball|AI release thread
Other:
Hoverboard|E2 release thread
Holo Stargate|Holo Dashboard|Poltergeist
(tell me if any of the links dont work via PM please)
That should work.Code:@name suction vent @persist Props:array V:vector Prop:entity T @model models/props_bts/clear_tube_straight.mdl if(first()){ runOnTick(1) #You only need to set this once. } T = T + 1*25 if(findCanQuery()){ findIncludePlayerProps(owner()) findByClass("prop_*") Props=findToArray() } for (I = 1, Props:count()){ Prop=Props[I,entity] if(Prop:pos():distance(entity():pos())<100){ #You might need to change the 100 to something more, this statement makes sure it only sucks up props that are close enough. V = (entity():pos() - Prop:pos()) Force=$V*20+V*4 Prop:applyForce(Force*Prop:mass()) Prop:setColor(255,0,0) Prop:applyAngForce(ang(0,T,0)) } } #Code is not tested and may show strange behaviour.
If not, then it probably makes the prop stay within the tube and I'm not gonna fix that, simply because I have other things to do.
10 months later, ive beaten portal 2, best game ever made, wonderful.
No pneumatic diversity vents ( this thread ) in the game that i can tell. (besides the pipes and the elevator.)
My stuff:
AI E2's:
Bugz|Tribbles|Wonderball|AI release thread
Other:
Hoverboard|E2 release thread
Holo Stargate|Holo Dashboard|Poltergeist
(tell me if any of the links dont work via PM please)
Bookmarks