+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Portal 2 suction tube [help]

  1. #1
    Wire Sofaking postman's Avatar
    Join Date
    Mar 2010
    Location
    oregon
    Posts
    578

    Default Portal 2 suction tube [help]

    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)

  2. #2
    aka Colonel Never Online Colonel Thirty Two's Avatar
    Join Date
    Oct 2009
    Posts
    2,683
    Blog Entries
    5

    Default Re: Portal 2 suction tube [help]

    Sigh, find functions every tick is not allowed...
    Code:
    if(findCanQuery())
    {
        findIncludePlayerProps(owner())
        findByClass("prop_ragdoll")
    }
    Needs FAQ

  3. #3
    Wire Sofaking ShadowBrain's Avatar
    Join Date
    Oct 2008
    Location
    Where you live.
    Posts
    910

    Default Re: Portal 2 suction tube [help]

    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
    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))
    fix'd
    I maek 3D mdoels adn paly veido gaems!

  4. #4
    Wire Amateur Caples's Avatar
    Join Date
    Nov 2009
    Location
    Walnut Creek, CA
    Posts
    76

    Default Re: Portal 2 suction tube [help]

    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|

  5. #5
    aka Colonel Never Online Colonel Thirty Two's Avatar
    Join Date
    Oct 2009
    Posts
    2,683
    Blog Entries
    5

    Default Re: Portal 2 suction tube [help]

    Quote Originally Posted by Caples View Post
    No pickie no clickie.
    This is a help thread, not a contraption thread.

  6. #6
    Wire Sofaking postman's Avatar
    Join Date
    Mar 2010
    Location
    oregon
    Posts
    578

    Default Re: Portal 2 suction tube [help]

    Quote Originally Posted by Caples View Post
    No pickie no clickie.
    Derp.
    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)

  7. #7
    Wire Sofaking postman's Avatar
    Join Date
    Mar 2010
    Location
    oregon
    Posts
    578

    Default Re: Portal 2 suction tube [help]

    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)

  8. #8
    Wire Sofaking postman's Avatar
    Join Date
    Mar 2010
    Location
    oregon
    Posts
    578

    Default Re: Portal 2 suction tube [help]

    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)

  9. #9
    Wire Sofaking ShadowBrain's Avatar
    Join Date
    Oct 2008
    Location
    Where you live.
    Posts
    910

    Default Re: Portal 2 suction tube [help]

    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.
    That should work.
    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.
    I maek 3D mdoels adn paly veido gaems!

  10. #10
    Wire Sofaking postman's Avatar
    Join Date
    Mar 2010
    Location
    oregon
    Posts
    578

    Default Re: Portal 2 suction tube [help]

    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)

+ Reply to Thread
Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots