Thread: TA's JetPack - Tutorial (bsp + Map)

Results 1 to 6 of 6
  1. #1
    Still learning wolf-3d's Avatar  
    Tester
    Join Date
    Jan 2011
    Location
    Somewhere Warm.
    Posts
    1,474

    TA's JetPack - Tutorial (bsp + Map)

    Control Use of JetPack:
    =================

    1) Pickup the JetPack (model: item_longjump)
    2) Move/Run in any direction then release "Run Key" and press and "Hold Jump Key"
    this will cause player to fly.(With minor forward thrust.)
    3) To descenf/fall release Jump Key OR Combo Press any other "bound Key" such as "Shoot Key".
    4) To cushion fall or "reduce impact damage" release all keys then press "Jump Key Briefly".

    KNOW ISSUES: Player's feet get stuck.
    NB: If player's "Feet stick in Ground", Press and release "Duck/Crouch" button briefly or a couple of times
    to free player.


    HOW do I use the JetPack in my Map ?
    ===========================

    Open file "ta_jetpack_tut1.map", locate the "item_longjump",
    directly above find two groups of entities. (9 ents)
    Mark them (use: Hold down "Ctrl Key" + Mouse Click)
    then copy and paste to your own map.

    Done / That’s it.


    Nerdy Technical Stuff & SC engine explanation.
    ----------------------------------------------------------
    Model: item_longjump is tracked interally by the SC engine. When a player
    pickups up the "LongJump module" the engine adds it "as a weapon" to an internal
    "bitmap List" of weapons.

    Item_Longjump target(s) "tc_but_chk" (trigger_condition check button)
    - There are Two entities named "tc_but_chk"

    common to Both entities:
    Both with Spawnflags "start off", "keep activator"
    Both with monitor.entity "!activator"
    Both with monitor.key "button"

    entity: 1st "tc_but_chk"
    ----------------------------
    static compare value "2" (2 = IN_JUMP = Jump-button pressed.)
    - If IN_JUMP is TRUE then targets entity called
    "tcv_play_fly_on" (trigger_changevalue player to flying)
    else
    "tcv_play_fly_off" (trigger_changevalue player to NOT flying)
    - Constant mode trigger behavior "Always fire for both"
    - Non-Cyclical Check Interval(sec) "0.3" (Helps introduce a Delay, so JetPack
    does not become a RocketPack. Larger values slow down JetPack Ascent/Speed of climb.)

    Entity: "tcv_play_fly_on"
    ------------------------------
    Destination.entity "!activator"
    Destination.key "flags" (NOT spawnflags but "PEV flags")
    Static_source_value "1" ( 1 = FL_FLY = Entity can fly.)
    Operation "Replace (= source)"
    ...
    ...
    Trigger after Operation "tr_pause" (Trigger_relay Pause)


    Entity: tr_pause
    --------------------
    Important, the reason for this entity is not immediately clear/apparant.
    This trigger_relay adjusts the delay for the previous entity: "tcv_play_fly_on"
    but not in respect of Player "Ascent Rate" but rather the number of "server frames" BEFORE fly
    is "killed/switched off". (Note delay -> 0.5 means Keep previous entity active for 5 server frames)
    Larger delays = "More fly time", setting delay to zero/"0" or removing this entity will cause
    fly to be "ON then OFF" immediately. (Player never get off the ground.)

    (NB: In this tutorial "Player Descent" is controlled by the SC engine or IF Necessary can be modified by
    changing the global gravity setting found in Map_Name.cfg or a combination of entities targeting a specific
    player's "gravity".)


    tcv_play_fly_off
    --------------------
    Destination.entity "!activator"
    Destination.key "flags" (Again NOT spawnflags but PEV "flags")
    Static_source_value "~1" (Bitwise 1 / switch OFF "1")
    Operation "Replace (= source)"
    ..
    ..
    Trigger after Operation "tcv_player_reset" (Trigger_changevalue Player Reset)

    tcv_player_reset
    ---------------------
    WHY ? in Entity.tcv_play_fly_on we changed the "Class Status" of "Player" to Monster of
    type "Entity can fly". (Causing changes to Classification, Hull Size, Collision Boxes, Gravity etc.)
    Remove this Entity and Monsters will not attack player because Player is a "Monster".
    Setting !activator (Player) back to "8" (PEV "flags" 8 = FL_CLIENT = Entity is a client/player.)
    fixes some of these problems.


    2nd "tc_but_chk" entity:
    ----------------------------
    Has static compare value "4" (4 = IN_DUCK = Duck-button pressed.)
    (Checking whether Player is "crouching" due to problem with "feet into ground".)

    These three entities check and fix the situation where a Player gets stuck by
    changing "player origin" upwards "66 units". (Players have a hull size of 32x 32y 72z,
    but unlike with monsters, their origin is at the center of the model.)


    (NOTE: If your map requires players to crouch/crawl/duck for Vents, pipes, Boxes etc.
    You can fix this lack of current "crawl ability" by adding a New Trigger_pause to the end of this column of entities.
    (HINT: Allow "Duck Key" to register with SC engine for "0.x" number of server frames/see 1st "tc_but_chk" above.)


    What about Jet Smoke and Sound ?
    ------------------------------------------
    Want them ? just Add them to end of 1st "tc_but_chk" entity chain/list.
    NOTE: Tuesday's Avenger has already posted an excelent tutorial on Mobile Turrets,
    which demonstrates the Use of "trigger_setorigin".
    HINT: Setorigin [with offset] a Smoke.spr to player with spawnflag "constant" (NB: May cause lagg)
    for sound could use ambient_generic with spawnflag "play everywhere" or "large radius".
    Else use "env_render" and give players with a jetpack a different colour etc.

    Credits
    ---------
    Tuesday's Avenger thought of this JetPack concept, He also did a Proof of Concept and demonstrated it
    was possible via a video. This is only one method, example or way of replicating the entity setup. TA's method
    is slightly different and has different issues. Most importantly though is I would never have bothered to try
    it myself without TA's demonstration. (TA will hopefully get around to posting his method at some point.)
    If you find an improved way or entity setup, please think about sharing with the community.

    BSP and example.map in 7z attachment.
    Attached Files Attached Files
    Last edited by wolf-3d; 07-07-2012 at 03:09 PM.
    Regards
    Wolf-3D

  2. #2
    Still learning wolf-3d's Avatar  
    Tester
    Join Date
    Jan 2011
    Location
    Somewhere Warm.
    Posts
    1,474

    Re: TA's JetPack - Tutorial (bsp + Map)

    A question for developers :
    when I first constructed the two ents
    tcv_play_fly_off & tcv_play_fly_on
    I used "OR (= old | source)" "1" and "OR (= old | source)" "~1"
    thinking it would get around the "Feet ground/collision hull" problem, it does not seem to make a difference and I was wondering if anyone knows why or what I was doing wrong.

    EDIT: Think realised why, "1" plus any "valid engine flag" normally "bitwise sums" to a "non-recognised" engine flag ?.
    Last edited by wolf-3d; 07-07-2012 at 07:59 PM.
    Regards
    Wolf-3D

  3. #3
    The scripter and fixer,quad rulez Maiten's Avatar
    Join Date
    Sep 2011
    Location
    North Zone Of Buenos Aires,Argentina
    Posts
    136

    Re: TA's JetPack - Tutorial (bsp + Map)

    Very detailed and explained tutorial ,thanks for sharing your knowledge

    i have found something but it can be called like a "feature" if you die and respawn you still have the jetpack,its permanent on the player layout,so if you pickup again the jetpack it dont work and you have to suicide and pickup again to get it working
    Epic Server

  4. #4
    more wpoly = more fun Tuesday's Avenger's Avatar  
    Contributor
    Join Date
    Mar 2004
    Location
    United States
    Posts
    1,459

    Re: TA's JetPack - Tutorial (bsp + Map)

    Just for clarity's sake here - wolf was inspired to take this up because of my jetpack post, but the method he uses is quite different from mine, and he developed it himself. I appreciate the nod, but all credit goes to him for this setup.

  5. #5
    Still learning wolf-3d's Avatar  
    Tester
    Join Date
    Jan 2011
    Location
    Somewhere Warm.
    Posts
    1,474

    Re: TA's JetPack - Tutorial (bsp + Map)

    Quote Originally Posted by Tuesday's Avenger View Post
    Just for clarity's sake here - wolf was inspired to take this up because of my jetpack post, but the method he uses is quite different from mine, and he developed it himself. I appreciate the nod, but all credit goes to him for this setup.
    'tis just an appreciate Nod back to you Sir, It was/is a great idea/concept and I am sure someone is going to build a very popular map based around a JetPack as the central theme.
    So just making sure mappers know where idea came from and don't accidentally idolise me or something
    Regards
    Wolf-3D

  6. #6
    Still learning wolf-3d's Avatar  
    Tester
    Join Date
    Jan 2011
    Location
    Somewhere Warm.
    Posts
    1,474

    Re: TA's JetPack - Tutorial (bsp + Map)

    Quote Originally Posted by Maiten View Post
    Very detailed and explained tutorial ,thanks for sharing your knowledge

    i have found something but it can be called like a "feature" if you die and respawn you still have the jetpack,its permanent on the player layout,so if you pickup again the jetpack it dont work and you have to suicide and pickup again to get it working
    Thanks, I had forgot that was a original issue/potential problem.

    I am guessing it is related to the "Weapons Bitmask" and how it internally functions within the engine core with "Monsters of different types". (I guess ATM flying monsters with weapons is not a Fully supported SC feature and it is having some problems with the classification changes when they kick in.)

    Will try and think of a "work around" as they always exist, it is just a question of how many entities it will take and if doing so causes more harm/confusion than good.
    Regards
    Wolf-3D

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •