Page 1 of 1

[SOLVED] Triggering the activation of a SpawnWeaponArea

Posted: Mon Apr 18, 2016 4:17 pm
by KliPeH
I'd like to activate a few preset SpawnWeaponAreas (supply crate spawns) when the players enter a specified area. The problem is, SpawnWeaponArea isn't a trigger, nor is the SpawnTarget marker. That means I can't use any of the useful triggers to activate them. I do have a couple of options, but don't want to use any of them.

One option is to replace SpawnWeaponArea with SpawnItem, but that doesn't spawn the supply crates I need. Another is to use the SpawnObject trigger, and reference the SuplyCrate00 item; problem with that is it spawns only one crate, has to be done manually for each spawner, and is generally less dynamic than what a generic spawn area would normally be.

What could I do to achieve the wanted effect (constant supply crate spawn after a new area is entered, without them spawning there prior to that) without scripting?

Re: Triggering the activation of a SpawnWeaponArea

Posted: Mon Apr 18, 2016 4:26 pm
by TheOriginalCj
Another possibility is to just create a SpawnWeaponArea with a really high Spawn chance index, but the SCI (Spawn Chance Index) isn't always going to guarantee a spawn in this area in particular.

If you want a more dynamic version of SpawnObject, what you can do is have multiple SpawnObject triggers in areas that make it appear to be random (so having around 4-6 in different places might be hard to predict). Then instead of having the AreaTrigger trigger the SpawnObjectTrigger. You have the Area Trigger activate a RandomTrigger which will trigger one of the multiple SpawnObject triggers you've just created.

No scripting nessecary for that last option, however for the first one I'm gonna need some time if you want me to do it that way.

Re: Triggering the activation of a SpawnWeaponArea

Posted: Mon Apr 18, 2016 4:39 pm
by KliPeH
TheOriginalCj wrote:Another possibility is to just create a SpawnWeaponArea with a really high Spawn chance index, but the SCI (Spawn Chance Index) isn't always going to guarantee a spawn in this area in particular.
But the SpawnWeaponArea does exist/is active even before the specified area is accessed if you do it that way. That means even if the chances of something spawning there are very low, something WILL spawn every now and then, and I want to avoid absolutely ALL spawns before the area is accessed by a player.
TheOriginalCj wrote: If you want a more dynamic version of SpawnObject, what you can do is have multiple SpawnObject triggers in areas that make it appear to be random (so having around 4-6 in different places might be hard to predict). Then instead of having the AreaTrigger trigger the SpawnObjectTrigger. You have the Area Trigger activate a RandomTrigger which will trigger one of the multiple SpawnObject triggers you've just created.
Yep, just like what I suggested then. Even if the spawner choice is random, I still do have to create each and every one manually and make lots of them to have them seem like their spawning position is truly random every single time. With SpawnWeaponArea, you know a crate will spawn "somewhere on that platform over there", but with the SpawnObject trigger this position can easily be predicted after a few games, a thing I would like to avoid if possible.

Is there no way to activate/enable/spawn a preset SpawnWeaponArea dynamically?

Re: Triggering the activation of a SpawnWeaponArea

Posted: Mon Apr 18, 2016 4:54 pm
by TheOriginalCj
KliPeH wrote: But the SpawnWeaponArea does exist/is active even before the specified area is accessed if you do it that way. That means even if the chances of something spawning there are very low, something WILL spawn every now and then, and I want to avoid absolutely ALL spawns before the area is accessed by a player.

Yep, just like what I suggested then. Even if the spawner choice is random, I still do have to create each and every one manually and make lots of them to have them seem like their spawning position is truly random every single time. With SpawnWeaponArea, you know a crate will spawn "somewhere on that platform over there", but with the SpawnObject trigger this position can easily be predicted after a few games, a thing I would like to avoid if possible.

Is there no way to activate/enable/spawn a preset SpawnWeaponArea dynamically?
I understand that your map probably already has SpawnWeaponAreas in it, which is why I'm trying to deter you from using this option, because even with setting a really high spawn index, the game won't ONLY spawn crates at that area. Not only that crates won't spawn immediately. Since there aren't any options to enable/disable a SpawnWeaponArea (you can create a spawn weapon area, but I'm not proficient enough to execute it properly) Option 2 is really the better way to approach this.

However, I was just thinking another method would be to create a SpawnObject with API so that a random number will change the position of the trigger once every 1/4 of a second, thus being truly random and unpredictable. This will still take some muddling around in the API for me to execute. I'll provide anything nessecary for you to do when I get around to it.

Re: Triggering the activation of a SpawnWeaponArea

Posted: Thu Apr 21, 2016 1:48 pm
by KliPeH
The script Cj sent me gave me an idea for a solution, using the SpawnObject method but a little differently.
I didn't think about it at first, and assumed I'll have to spawn supply crates from each spawner only once. But Cj reminded me that TimerTriggers existed! So I created a TimerTrigger that would be activated once a player entered the specified area (AreaTrigger/OnDestroyedTrigger). It would trigger a RandomTrigger which would choose from a selection of 7 8 different SpawnObject spawners every 13 11 seconds, giving the supply crate spawning a feeling of a natural, otherwise regular SpawnWeaponArea vibe.

Put into a flow chart it would look something like this:

AreaTrigger (players only) / OnDestroyedObject (door/hatch/wall)
v
TimeTrigger (11s, repeats infinitely)
v
RandomTrigger (chooses between 8 preset SpawnObject spawners)
v
SpawnObject (set to spawn SupplyCrate00)

The problem with that is sometimes the RandomTrigger chooses the same spawner twice in a row, causing the crates to overlap eachother. It's minor, but still a bit irritating.

Re: Triggering the activation of a SpawnWeaponArea

Posted: Thu Apr 21, 2016 8:01 pm
by Gurt
You could make a suggestion that SpawnWeaponArea should act like triggers. Triggering it once would force one crate to be spawned somewhere along that area. But it looks like you found a workaround.