Welcome to PlagueFest.com! Log in or Sign up to interact with the Plague Fest community.
  1. Welcome Guest! to interact with the community and gain access to all the site's features.

Need help with advanced parenting...

Discussion in Mapping Discussion started by Dapk1nmasta, Mar 5, 2012

  1. Jan 27, 2012
    The current object I'm working on is a vehicle but I want to parent the driver to the vehicle when they press the start button, then unparent OnOut. I've tried with a trigger in the spot where the driver stands but I can't seem to get the configuration right.

    Sent from my Samsung Infuse using Tapatalk.
  2. Feb 24, 2011
    There is some slight solutions to this, altough it could be risky. As seen in mg_crazykart the players gets parented to the karts and it moves along pretty fluently.
    This is done with "setparentattachment" which only a few models have specified. This method will attach the player to a certain point of a model and really keep him there at all times. But in your case this would not work anyways, because once "setparentattachment'ed" you cant get un-parented again, so you cant step in/out of the vehicle again. (Please contact me ASAP if anyone finds a solution to this, because this would help me alot aswell!)

    So this is what you pretty much need to do, but don't expect the best results:

    * You need to add an entity called "player_speedmod". however i'm pretty sure it doesn't exist in the original .fgd file. So here's a custom one which includes it (you can delete it right after you've added it / made all settings and such) : http://www.gamebanana.com/css/tools/1966

    * add a trigger_multiple at your vehicles driver position. If you aren't able to walk right into the driver position, add a trigger_teleport near the driver entrance and a info_teleport_destination both parented to the vehicle. And the other way around, make sure to enable/disable the triggers depending on if you want to get in/out.

    * On the trigger_multiple you want these outputs:

    - onstarttouch --> !self --> disable
    - onstarttouch --> teleporter_IN --> disable
    - onstarttouch --> player_speedmod --> modifyspeed --> 0.0
    - onstarttouch --> !activator --> setparent --> vehicle entity name
    - onstarttouch --> game_ui --> activate (assuming you have a game_ui for the vehicle)

    do this for the game_ui

    - playeroff --> teleporter_OUT --> enable
    - playeroff --> player_speedmod --> modifyspeed --> 1.0
    - playeroff --> disable ALL the triggers
    - playeroff --> enable the trigger_multiple and teleporter_IN (after about 2-3 seconds to avoid getting stuck)

    Take in mind that normal "setparent'ing" on player might be kinda buggy, the player could slide away and get stuck outside the world if unlucky. but the player_speedmod should prevent it most of the time. 8or if you park the vehicle near a wall and step outside as an example.

    I hope this should help you to the most of it, altough i have a slight feeling i missed something.
    Good luck with fixing it! :wink:

    *the first time i saw the title of this thread i thought it was about parenting as for children* :razz:
    • Mapping King Mapping King x 3
    • Like Like x 1
    • Winner Winner x 1
    • Useful Useful x 1
    • Jan 27, 2012
      Thanks Luffaren. I'm working on getting these outputs set and will edit my post with further information. One thing, though. Couldn't I just use the start_engine button to enable/disable the trigger and unparent/clear the parent? For example: http://grab.by/celi It seems like it would work to me.
    • Jul 19, 2011
      When I read the title I clicked on the post, I thought you were have child problems. I was so excited to see what type of child you have produced, but to my dismay it was just a mapping term.
      • Funny Funny x 1