Thread: dynamic changelevel

Results 1 to 11 of 11
  1. #1
    Linux development & test edman747's Avatar  
    Programmer
    Join Date
    Jul 2006
    Location
    Deception Pass
    Posts
    1,337

    dynamic changelevel

    hello all,
    would like to modify an existing map to make a changelevel that starts off. kinda like the info_player_deathmatch spawnflags.

    it would be controlled by other events, when all objectives are complete then the changelevel can be triggered.

    here is what I've got so far:
    add a count to each monster. monster dies the counter increments.
    insert these two lines. for any monsters I want to count.
    "TriggerTarget" "MonsterCounter"
    "TriggerCondition" "4"

    add a trigger counter entity.
    {
    "targetname" "MonsterCounter"
    "classname" "trigger_counter"
    "count" "3"
    "target" "alldead_cl"
    }

    add a targetname and spawnflags to the existing changelevel.
    {
    "model" "*4"
    "classname" "trigger_changelevel"
    "landmark" "c1a1"
    "map" "c1a1a"
    "targetname" "alldead_cl"
    "spawnflags" "3"
    }

    This is well and good. but the change happens as soon as the count is reached.
    would like to enable the changelevel then require a player to activate it. Or be in the change zone as defined by the info_landmark.

    am not sure what entities can be used to do this.
    maybe, something that can keep track of multiple events. like when the count is reached then the changelevel can be triggered by a player.
    thought I had seen something similar in another map. where player has to push a button that triggers the changelevel. but the player has to do something else before he can push the button. any ideas?
    Thanks,
    . What are you looking at?

  2. #2
    Registered User CrouchSoft's Avatar
    Join Date
    May 2004
    Location
    Australia
    Posts
    197

    Thumbs up Re: dynamic changelevel

    Sounds like you need a multisource.

    http://collective.valve-erc.com/inde...nt=multisource

  3. #3
    Donated 15NS$ for Sven's Holiday at the Bahamas Puchi's Avatar  
    Artist
    Join Date
    Nov 2002
    Location
    Akihabara, Bochum or Sailune
    Posts
    5,617

    Re: dynamic changelevel

    i've done that, posting when i'm back from work (in case i dont forget it or someone else posted before )
    Do it with passion, or not at all.
    Do not say everything you know. Know everything you say.
    [ MarySP ][ nacl-h2o ][ The next SC Version ♥♥♥♥ing pwns! ][Puchis Maps ]

  4. #4
    Linux development & test edman747's Avatar  
    Programmer
    Join Date
    Jul 2006
    Location
    Deception Pass
    Posts
    1,337

    Re: dynamic changelevel

    multisource sounds like a great idea.
    setup monster_counter to target the multisource

    trigger_changelevel does not have a property for master not sure what to do with it.
    . What are you looking at?

  5. #5
    Donated 15NS$ for Sven's Holiday at the Bahamas Puchi's Avatar  
    Artist
    Join Date
    Nov 2002
    Location
    Akihabara, Bochum or Sailune
    Posts
    5,617

    Re: dynamic changelevel

    i tell tomorrow in case i dont forget again...


    wait, i do it now because i WILL forget it tomorrow...:
    i used:
    • 1x trigger_once
    • 1x trigger_relay
    • 1x multisource
    • 1x trigger_changelevel

    The trigger_once triggers the changelevel. it has the multisource as its master (Targets the changelevel). the multisource is toggled with the trigger_relay (trigger state toggle).
    now that i think of it its most likely not usable because you cannot add brushbased entities...
    Do it with passion, or not at all.
    Do not say everything you know. Know everything you say.
    [ MarySP ][ nacl-h2o ][ The next SC Version ♥♥♥♥ing pwns! ][Puchis Maps ]

  6. #6
    Linux development & test edman747's Avatar  
    Programmer
    Join Date
    Jul 2006
    Location
    Deception Pass
    Posts
    1,337

    Re: dynamic changelevel

    thinking this would be really easy to do if trigger_changelevel had a "master" property. wonder how hard that would be to add...

    with fear and trepidation I might request this be added at some future date. unless some other solution presents.
    . What are you looking at?

  7. #7
    Nutcracker A1win's Avatar  
    Contributor
    Join Date
    Dec 2003
    Location
    Finland
    Posts
    2,246

    Re: dynamic changelevel

    If there already is a trigger_changelevel, you can turn it into a triggger_once using ripent. Just change its classname and other keyvalues (except the model key, it tells you which brush entity model it's using). You can also copy the entity by simply giving it the same model key value and changing its origin. It might be a bit difficult to do without actually seeing it, though, so you might want to turn it into a func_wall first to see where it is etc.

  8. #8
    Banned sixcentgeorge's Avatar
    Join Date
    Apr 2006
    Posts
    351

    Re: dynamic changelevel

    info_landmark does nothing in map change , it marks an "origin" between maps , it should be usefull for spmods because engine keeps monters when levels change . so all positions are based from it .

  9. #9
    Donated 15NS$ for Sven's Holiday at the Bahamas Puchi's Avatar  
    Artist
    Join Date
    Nov 2002
    Location
    Akihabara, Bochum or Sailune
    Posts
    5,617

    Re: dynamic changelevel

    Quote Originally Posted by A1win
    You can also copy the entity by simply giving it the same model key value and changing its origin. It might be a bit difficult to do without actually seeing it, though, so you might want to turn it into a func_wall first to see where it is etc.
    if that works he can use what i wrote easily (even though i used a 16³ trigger_changelevel brush instead of a whole wall, but that doesnt matter)
    Do it with passion, or not at all.
    Do not say everything you know. Know everything you say.
    [ MarySP ][ nacl-h2o ][ The next SC Version ♥♥♥♥ing pwns! ][Puchis Maps ]

  10. #10
    Nutcracker A1win's Avatar  
    Contributor
    Join Date
    Dec 2003
    Location
    Finland
    Posts
    2,246

    Re: dynamic changelevel

    Just note that brush entities normally have their origin at "0 0 0" (even when they are missing the origin key), so when you change the origin, you are practically changing its off-set from the center of the map. So if you change origin to "16 0 0" from "0 0 0", it just moves the brush 16 units on the x-axis.

  11. #11
    Linux development & test edman747's Avatar  
    Programmer
    Join Date
    Jul 2006
    Location
    Deception Pass
    Posts
    1,337

    Re: dynamic changelevel

    thanks everybody.
    here is what I've got now.

    overzealous player runs to the changelevel... nothing happens. His teamates kill all the monsters. Again no change. Then a player walks into the area where the original half-life changelevel was and the map changes.
    Code:
    add two lines to every monster I want to count:
    
    "TriggerTarget" "monstercounter"
    "TriggerCondition" "4"
    
    append these lines to the end of the ent file.
    copy the trigger_changelevel. make the copy into a trigger_once.
    
    {
    "targetname" "monstercounter"
    "target" "alldead_tr"
    "count" "3"
    "classname" "trigger_counter"
    }{
    "targetname" "alldead_tr"
    "target" "alldead_ms"
    "triggerstate" "2"
    "classname" "trigger_relay"
    }{
    "targetname" "alldead_ms"
    "classname" "multisource"
    }{
    "model" "*4"
    "classname" "trigger_once"
    "target" "alldead_cl"
    "master" "alldead_ms"
    }{
    "model" "*4"
    "landmark" "c1a1"
    "map" "c1a1a"
    "targetname" "alldead_cl"
    "spawnflags" "3"
    "classname" "trigger_changelevel"
    }
    It works. not sure I can explain why. but then again don't understand the trigger_changelevel property, "changetarget" what does this do? how is it used?
    . What are you looking at?

Posting Permissions

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