Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

[SOLVED] Triggering the activation of a SpawnWeaponArea

Share questions and tutorials related to the map editor. Share you maps in the Superfighters Deluxe Custom Maps section.
Forum rules
By using the forum you agree to the following rules.
Post Reply
User avatar
KliPeH
Moderator
Moderator
Posts: 914
Joined: Sat Mar 19, 2016 3:03 pm
Title: [happy moth noises]
SFD Account: KliPeH
Started SFD: Pre-Alpha 1.4.2
Gender:
Contact:

[SOLVED] Triggering the activation of a SpawnWeaponArea

Post by KliPeH » Mon Apr 18, 2016 4:17 pm

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?
0 x
 
Image

User avatar
TheOriginalCj
Moderator
Moderator
Posts: 177
Joined: Tue Mar 15, 2016 10:28 pm
Title: Lifetime Sentence to SF Wiki
SFD Alias: RedneckJed
Started SFD: PreAlpha 1.1.0
Location: USA
Gender:
Contact:

Post by TheOriginalCj » Mon Apr 18, 2016 4:26 pm

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.
0 x
Superfighters Wiki Founder
The Superfighters Wiki
Join the Wiki!
Danger Ross wrote: What are you doing here wiki-slave?! GET BACK TO WORK!

User avatar
KliPeH
Moderator
Moderator
Posts: 914
Joined: Sat Mar 19, 2016 3:03 pm
Title: [happy moth noises]
SFD Account: KliPeH
Started SFD: Pre-Alpha 1.4.2
Gender:
Contact:

Post by KliPeH » Mon Apr 18, 2016 4:39 pm

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?
0 x
 
Image

User avatar
TheOriginalCj
Moderator
Moderator
Posts: 177
Joined: Tue Mar 15, 2016 10:28 pm
Title: Lifetime Sentence to SF Wiki
SFD Alias: RedneckJed
Started SFD: PreAlpha 1.1.0
Location: USA
Gender:
Contact:

Post by TheOriginalCj » Mon Apr 18, 2016 4:54 pm

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.
0 x
Superfighters Wiki Founder
The Superfighters Wiki
Join the Wiki!
Danger Ross wrote: What are you doing here wiki-slave?! GET BACK TO WORK!

User avatar
KliPeH
Moderator
Moderator
Posts: 914
Joined: Sat Mar 19, 2016 3:03 pm
Title: [happy moth noises]
SFD Account: KliPeH
Started SFD: Pre-Alpha 1.4.2
Gender:
Contact:

Post by KliPeH » Thu Apr 21, 2016 1:48 pm

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.
Last edited by KliPeH on Thu Apr 21, 2016 1:58 pm, edited 1 time in total.
Reason: Tweaked settings
0 x
 
Image

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1884
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 34

Post by Gurt » Thu Apr 21, 2016 8:01 pm

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.
0 x
Gurt

Post Reply