Thread: Game Crashing With Adv Class Trigger_Relay and Trigger_Changevalue

Results 1 to 17 of 17
  1. #1
    Registered User Chaos_Wake's Avatar
    Join Date
    Nov 2014
    Posts
    18

    Game Crashing With Adv Class Trigger_Relay and Trigger_Changevalue

    Hey,

    I started making an alpha build of a map just yesterday but ran into a game crashing issue involving the combination of trigger_multiple, trigger_relay, and trigger_changevalue.

    The map gameplay is largely based around the advanced class system described by NIH, so this issue is something I want to get resolved though I personally don't know for sure whats going wrong.

    What essentially happens is when I string together trigger_multiple, trigger_relay, and trigger_changevalue in the domino kind of way NIH described the game just crashes once trigger_multiple is reached. I fooled around a bit and it seems like it crashes when multiple trigger_changevalue entities have the same name. I'm really confused by this as this is what NIH described to do. It also crashes without an error message, just straight to the desktop.

    I attempted also once I realized that to change trigger_changevalue(rifleman) to trigger the next trigger_changevalue(now named rifleman2) in a chain but that simply just did nothing.

    Here's a link to essentially everything that comprises the map including the wads for it. This is a build of it after I attempted to end the crashing. Now the rifleman class system simply does not work .https://www.dropbox.com/s/aktn3w46pv...build.zip?dl=0

    Here are images of what specifically I'm talking about, this first one being the simple teleport hole I made for the "rifleman" class. https://www.dropbox.com/s/mgtuq1p4sk...Error.png?dl=0

    This second image is of what I changed the second trigger_changevalue to in case that gives you an idea of what might be wrong. https://www.dropbox.com/s/j5clpv43j9...rror2.png?dl=0

    Thank you
    Last edited by Chaos_Wake; 25-11-2014 at 04:23 PM.

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

    Re: Game Crashing With Adv Class Trigger_Relay and Trigger_Changevalue

    Quote Originally Posted by Chaos_Wake View Post
    This second image is of what I changed the second trigger_changevalue to in case that gives you an idea of what might be wrong. https://www.dropbox.com/s/j5clpv43j9...rror2.png?dl=0

    Thank you
    Not looked at the source/rmf but the above image shows that trigger_changevalue is referencing itself. (i.e. target and targetname are the same.)
    targetname should be the name of the trigger_changevalue that is called from the multi_manager (e.g. tcv_rifelman) and "target" the name of the entity you want to change (e.g. rifleman1)
    Regards
    Wolf-3D

  3. #3
    Nothing to see here. BackAssward's Avatar
    Join Date
    Aug 2006
    Posts
    388

    Re: Game Crashing With Adv Class Trigger_Relay and Trigger_Changevalue

    I didn't want to post before someone more knowledgeable on map making did... but my initial thought was that you had a loop. An entity targeting itself, or a loop of entities targeting each-other... looping.

  4. #4
    QPU-aligned Silencer's Avatar  
    Contributor
    Join Date
    May 2006
    Posts
    6,078

    Re: Game Crashing With Adv Class Trigger_Relay and Trigger_Changevalue

    Infinite loops are aborted automatically by the engine after some hundred steps iirc. You should still check that though.

  5. #5
    Banned Solokiller's Avatar
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    3,314

    Re: Game Crashing With Adv Class Trigger_Relay and Trigger_Changevalue

    When i run your map i get this in the console:
    Warning: trigger_relay "rifleman" triggered itself over 128 times.
    You're triggering the trigger_relay itself with its target, using another name should fix it.
    I'm guessing it crashes for you because your system's stack size is too low to handle this many recursive calls. (i'm on a 64 bit W8.1 system, which has been known to behave differently than others)

    P.S.: you're missing a wad called jp_dev_plus. I'm guessing you took jp_dev.wad and added some textures?

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

    Re: Game Crashing With Adv Class Trigger_Relay and Trigger_Changevalue

    Hi Chaos! Taking a look at this. Will edit when I've got some feedback.

    EDIT: Just going to make a new post. See below.
    Last edited by Tuesday's Avenger; 26-11-2014 at 03:43 PM.

  7. #7
    QPU-aligned Silencer's Avatar  
    Contributor
    Join Date
    May 2006
    Posts
    6,078

    Re: Game Crashing With Adv Class Trigger_Relay and Trigger_Changevalue

    Are you even running the latest Sven Co-op version? A stack size that small sounds unlikely to me, and it should be dictated by the compiler anyway. Think about what would happen to any depth-first search algorithm if the stack could only hold hundreds of jumps.

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

    Re: Game Crashing With Adv Class Trigger_Relay and Trigger_Changevalue

    Okay then. So what you're trying to do here is change some values for a given player who chooses a "rifleman" class, right?

    Right now, your problems are thus:

    Player drops down, on the way to grabbing some gear, he hits a trigger_multiple that targets a trigger_changevalue called "rifleman" - so far, so good.

    However, "rifleman" doesn't change the values of that player; instead, it changes the "armortype" (the maximum armor value for a player) of itself, a trigger_changevalue; this doesn't mean anything to that entity, and will have either no effect or possibly confuse the engine. Should it successfully execute, it then sets off "rifleman2", another trigger_changevalue, to change the maxspeed value of that same original trigger_changevalue, rather than the player as you probably intended. (Also, FYI - a maxspeed of 75 is going to be really, really slow. The Tank class on Warforts moves at about 200)

    I can see you have a trigger_renameplayer in there as well - very much the right idea - but you've left the New Player Targetname field blank. This might also cause major problems, and also doesn't help you find the player you're looking for. The name of the entity and the name it gives the specified player need to be two separate things so they can be referred to independently.

    I have no idea what the trigger_relay named "rifleman" is doing, but targeting itself and 2 other entities with an OFF state probably isn't helping either.

    I'm attaching a basic entity setup map that should do what I think you're aiming for more successfully. Let me know if it helps.



    ALSO: You can change a player's maxspeed value to anything below the default, but as soon as that player respawns or switches weapons, it's going to be reset. There is a reason the Tank class I use only has one gun; both for gameplay reasons but also to sidestep this issue. That's just a quirk we have to live with for the time being.
    Attached Files Attached Files

  9. #9
    Registered User Chaos_Wake's Avatar
    Join Date
    Nov 2014
    Posts
    18

    Re: Game Crashing With Adv Class Trigger_Relay and Trigger_Changevalue

    Thank you all for the responses.

    I guess I should have listened to the doubt I had about my interpretation of NIH's instructions. I'm certain I misunderstood them now.

    I've been able to fix the crashing but even following Tuesday's advice and his example I haven't been able to get the class system to work.

    I even attempted to completely copy the example but it still looks like nothing's happening. I guess nothing is better than crashing but yeah hahaha.

    I have no idea by the way why my stack size would only take 128 but maybe its because I'm on Windows 7. I am actually using Sven Coop 4.8 also.

    As far as the speed changing bug, I guess I'll have to work around that with my "Medic" class having a normal speed compared to the others. I just had the thought though, might it be possible that equipping the m16 as the player falls is resetting the speed value for the "Rifleman"? I have no idea why the armortype doesnt work but that might explain something.

    EDIT: I just tested that possibility and it looks like its probably irrelevant. I made the m16 grabbable before hitting the trigger_multiple and nothing changed.
    Last edited by Chaos_Wake; 26-11-2014 at 07:58 PM.

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

    Re: Game Crashing With Adv Class Trigger_Relay and Trigger_Changevalue

    1. You won't notice a change in armortype unless you pick up a battery in game or also change the "armorvalue" keyvalue - "armortype" just changes the max cap.

    2. How familiar are you with the multimanager entity? Did you actually copy the one I made, or did you remake the setup yourself? To make a multimanager work, you need to turn off "Smart Edit" in the editor and manually add keyvalues. See here for a better explanation: http://twhl.info/tutorial.php?id=37

  11. #11
    Registered User Chaos_Wake's Avatar
    Join Date
    Nov 2014
    Posts
    18

    Re: Game Crashing With Adv Class Trigger_Relay and Trigger_Changevalue

    The Class System now works, thank god.

    Thank you all for your help. Now I can finally test gameplay.

    EDIT: Now that this issue is resolved I'm going to post an additional question I asked on a different site so as to not clutter the board with another thread.

    Thank you guys a lot, I've been able to resolve that issue with no problems so far.

    I actually have a completely separate question now if anyone is willing to answer.

    Is it theoretically possible to make a Sven map end if all the players have died?

    For example if I made respawning impossible and made revive only possible through a medkit would I be able to successfully trigger game_end by some means?

    I know something like that is a core element of Counter Strike's round switching but I don't know how I would incorporate that into Sven.
    Last edited by Chaos_Wake; 27-11-2014 at 01:00 AM.

  12. #12
    Banned Solokiller's Avatar
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    3,314

    Re: Game Crashing With Adv Class Trigger_Relay and Trigger_Changevalue

    You can use a game_zone_player to count the number of players:
    http://zyl.pestermom.com/external/en...ne_player.html
    Check the "ignore dead players" flag, and put the entity somewhere where players can't be inside it. Also make it small enough that no noclipping players could enter it.
    Then set "counter for OUT players" keyvalue to a game_counter, and set up the game_counter to trigger on 0 count.

    If this doesn't work, make players respawn in a separate room, cover this room with a game_zone_player, and make it set its IN counter instead.
    Then use a trigger_changevalue to set the number of players counted using game_player_counter: http://zyl.pestermom.com/external/en...r_counter.html
    If the number of players in the zone is equal to the amount on the server, all players are dead.
    This method is used in sc_robination.

  13. #13
    Registered User Chaos_Wake's Avatar
    Join Date
    Nov 2014
    Posts
    18

    Re: Game Crashing With Adv Class Trigger_Relay and Trigger_Changevalue

    Incredible, that's even better then getting the advanced class system to finally work. I had a bit of doubt over whether or not such a thing was possible.

    I'm very optimistic about my project now, I'll post again if I have difficulty implementing either of those methods.

    Thank you all again.
    Last edited by Chaos_Wake; 27-11-2014 at 03:40 AM.

  14. #14
    Mapper Nih's Avatar  
    Manager
    Join Date
    Dec 2002
    Location
    Denmark
    Posts
    5,473

    Re: Game Crashing With Adv Class Trigger_Relay and Trigger_Changevalue

    In Toadsnatch I give "dead" players a specific targetname, and use a trigger_entity_iterator to make all players with a different targetname trigger a game_counter. If the counter is 0 afterwards, all players are considered to be dead.

  15. #15
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    Location
    U.S. West
    Posts
    1,590

    Re: Game Crashing With Adv Class Trigger_Relay and Trigger_Changevalue

    Last I remember, game_zone_player doesn't work because it counts players that leave the server. I also have yet to play toadsnatch past the first 5 mins or so because it bugs out and says all players have died in the middle of a fight. (I might be wrong and this stuff was fixed in 4.8)

    The best luck I've had counting live players is to use "trigger after respawn" on player spawns and the special targetname 'game_playerdie' with some logic entities.
    Love,
    w00tguy

  16. #16
    Banned Solokiller's Avatar
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    3,314

    Re: Game Crashing With Adv Class Trigger_Relay and Trigger_Changevalue

    That bug was fixed in 4.8.

  17. #17
    Mapper Nih's Avatar  
    Manager
    Join Date
    Dec 2002
    Location
    Denmark
    Posts
    5,473

    Re: Game Crashing With Adv Class Trigger_Relay and Trigger_Changevalue

    Quote Originally Posted by w00tguy123 View Post
    Last I remember, game_zone_player doesn't work because it counts players that leave the server. I also have yet to play toadsnatch past the first 5 mins or so because it bugs out and says all players have died in the middle of a fight. (I might be wrong and this stuff was fixed in 4.8)

    The best luck I've had counting live players is to use "trigger after respawn" on player spawns and the special targetname 'game_playerdie' with some logic entities.
    Toadsnatch uses the trigger_entity_iterator system mentioned above, as well as a game_zone_player system to count if any players are outside of the spawn zone, as a backup. If players who left the server are counted, it would not be able to cause the map to be lost, since they would be counted either as ghosts (which they should), or counted as alive (which would cause the map to keep going).

Posting Permissions

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