Jump to content

Spawning enemy's on random positions problem


donavlad

Recommended Posts

Hello people,

I have another question. I searched the forum allready and I can't seem to find what I'm looking for.

I want to randomly spawn enemy's in a zone, BUT away from the player so they dont see him spawn.

This is what I have so far but the stopif and continue if and redirectif arent working according to the proximity....

Group: <Default>

Comment:

Setup

Trigger Event:

The simulation is starting.

Responses:

Set Platoon - Player to (The player-controlled platoon).

Set Timer - reinforce attackers to expire in 30 second(s).

Group: <Default>

Comment:

reinforce attackers; timer

Trigger Event:

Timer - reinforce attackers has expired.

Responses:

Set Flag - reinforce attackers to true.

Display "reinforce attack - timer" to all players.

Prevent this block from being reactivated.

Group: <Default>

Comment:

TEST Check Location random spawn attacker reinforcement

Trigger Event:

10 second(s) elapsed.

Responses:

Allow this block to be reactivated.

Continue executing responses if (The state of Flag - reinforce attackers).

Display "DEBUG REDIRECTING" to all players.

Set counter - reinforce attackers location to (A random integer between 1 and 2).

If ((The value of counter - reinforce attackers location) is equal to 1), stop and queue a call to Group Spawn 1.

If ((The value of counter - reinforce attackers location) is equal to 2), stop and queue a call to Group spawn 2.

Group: Group Spawn 1

Comment:

TEST Spawn 1 availability

Trigger Event:

This block has been called directly from the script.

Responses:

Display "DEBUG Spawn 1" to all players.

If ((The number of members of Platoon - Player within 100000 meter(s) of Zone - reinforce attackers 1) is greater than or equal to 1), stop and queue a call to Group spawn 2.

Display "DEBUG Spawn 1 player gone" to all players.

Teleport AA1 to Zone - reinforce attackers 1.

Teleport AA2 to Zone - reinforce attackers 1.

Teleport AA3 to Zone - reinforce attackers 1.

Teleport AA4 to Zone - reinforce attackers 1.

Make Reinforcement - attacker visible to the game world.

Set Flag - reinforce attackers to false.

Group: Group spawn 2

Comment:

TEST Spawn 2 availability

Trigger Event:

This block has been called directly from the script.

Responses:

Display "DEBUG Spawn 2" to all players.

If ((The number of members of Platoon - Player within 100000 meter(s) of Zone - reinforce attackers 1) is greater than or equal to 1), stop and queue a call to Group spawn 2.

Display "DEBUG Spawn 2 player gone" to all players.

Teleport AA1 to Zone - reinforce attackers 2.

Teleport AA2 to Zone - reinforce attackers 2.

Teleport AA3 to Zone - reinforce attackers 2.

Teleport AA4 to Zone - reinforce attackers 2.

Make Reinforcement - attacker visible to the game world.

Set Flag - reinforce attackers to false.

This is just a random test for the spawns, and it is very rough...

But the random spawns are working great, only it isnt reading the proximity to the player... So the appear in front of me sometimes.......

Anyone has a solution?

Link to comment
Share on other sites

Group Spawn 1 and 2 both look to see if the players are within 100,000 M of the zones, which they must be, 100,000 M map would not work in most games, never mind GR, so they keep bouncing back to each other. Reduce the 100, 000 M to maybe 10M. Or suitable distance.

Link to comment
Share on other sites

Sorry I had to clarify, the distance was just to try.

They keep spawning regardless.

I set the first to 10000000m and the 2nd without any rules so it could go to the 2nd.

I varied the distance to 10-20-50 and 100000000m.

FYI, the spawns appear without bouncing... Thats why I set up the debug messages.

Regards, donavlad

Link to comment
Share on other sites

That is wrong, if I set the trigger to 5M of a zone, it triggers when I am within 5M of the zone. Setting it to 0, would mean entering the zone.

Try this, if all else fails, upload the file if you like and PM.

Group: <Default>

Comment:

TEST Check Location random spawn attacker reinforcement

Trigger Event:

10 second(s) elapsed.

Responses:

Allow this block to be reactivated.

Continue executing responses if (The state of Flag - reinforce attackers).

Display "DEBUG REDIRECTING" to all players.

If ((The number of members of Platoon - Player within 10 meter(s) of Zone - reinforce attackers 1) is greater than or equal to 1), stop and queue a call to Group spawn 1.

If ((The number of members of Platoon - Player within 10 meter(s) of Zone - reinforce attackers 2) is greater than or equal to 1), stop and queue a call to Group spawn 2.

Prevent this block from being reactivated.

Link to comment
Share on other sites

I tried, for all I know, every possibility there is, the problem I see is that somehow it is not registering where player platoon is.

For example, If I set it up like my original post, but with the 2nd spawn location without rules (no proximity or anything) and I set the counter to be 1.

In this scenario I tested if it would register enemy forces. So I set up a proximity to the enemy platoon and the spawn location 1.

This was the outcome:

REDIRECTING

SPAWN 1

SPAWN 1 player gone

SPAWNED...

It is not locating the enemy forces aswell...

weird...

Regards...

Edited by donavlad
Link to comment
Share on other sites

So is it possible to put a reference point in the spawn zone to relate?

It would be something like this:

Group: Group Spawn 1

Comment:

TEST Spawn 1 availability

Trigger Event:

This block has been called directly from the script.

Responses:

Display "DEBUG Spawn 1" to all players.

If ((The number of members of Platoon - Player within 100000 meter(s) of ***PUT REFERENCE HERE***) is greater than or equal to 1), stop and queue a call to Group spawn 2.

Display "DEBUG Spawn 1 player gone" to all players.

Teleport AA1 to Zone - reinforce attackers 1.

Teleport AA2 to Zone - reinforce attackers 1.

Teleport AA3 to Zone - reinforce attackers 1.

Teleport AA4 to Zone - reinforce attackers 1.

Make Reinforcement - attacker visible to the game world.

Set Flag - reinforce attackers to false.

Group: Group spawn 2

Comment:

TEST Spawn 2 availability

Trigger Event:

This block has been called directly from the script.

Responses:

Display "DEBUG Spawn 2" to all players.

Teleport AA1 to Zone - reinforce attackers 2.

Teleport AA2 to Zone - reinforce attackers 2.

Teleport AA3 to Zone - reinforce attackers 2.

Teleport AA4 to Zone - reinforce attackers 2.

Make Reinforcement - attacker visible to the game world.

Set Flag - reinforce attackers to false.

But what can I set as a reference point that will relate to the players platoon?

AKA if The range parameter is not applied to zone objects then what reference will?

Link to comment
Share on other sites

Another idea,

how about making the invisible actors AA1-AA4 teleport all over the map BEFORE the flag is set.

Something like this:

Group: <Default>

Comment:

*Set Player Company to Variable Player Company

Trigger Event:

The simulation is starting.

Responses:

Set Platoon - Player to (The player-controlled platoon).

Set Timer - reinforce attackers to expire in 60 second(s).

Hide Reinforcement - attacker from the game world.

Group: <Default>

Comment:

Spawn away

Trigger Event:

An actor in Player Company is within 100 meter(s) of AA1.

Responses:

Allow this block to be reactivated.

Display "DEBUG - Too close to actor " to all players.

Set counter - reinforce attackers location to (A random integer between 1 and 2).

If ((The value of counter - reinforce attackers location) is equal to 1), stop and queue a call to Group Spawn 1.

If ((The value of counter - reinforce attackers location) is equal to 2), stop and queue a call to Group spawn 2.

Group: <Default>

Comment:

Spawn attacker - TIMER

Trigger Event:

Timer - reinforce attackers has expired.

Responses:

Set Flag - reinforce attackers to true.

Prevent this block from being reactivated.

Display "DEBUG - Flagset true" to all players.

Group: Group Spawn 1

Comment:

Spawn 1

Trigger Event:

This block has been called directly from the script.

Responses:

Teleport AA1 to Zone - reinforce attackers 1.

Display "DEBUG - Spawn 1" to all players.

Continue executing responses if (The state of Flag - reinforce attackers).

Make Reinforcement - attacker visible to the game world.

Display "DEBUG - Show spawn 1" to all players.

Set Flag - reinforce attackers to false.

Prevent this block from being reactivated.

Group: Group spawn 2

Comment:

Spawn 2

Trigger Event:

This block has been called directly from the script.

Responses:

Teleport AA1 to Zone - reinforce attackers 2.

Display "DEBUG - Spawn 2" to all players.

Continue executing responses if (The state of Flag - reinforce attackers).

Display "DEBUG - Spawn 2 show" to all players.

Make AA1 visible to the game world.

Set Flag - reinforce attackers to false.

Prevent this block from being reactivated.

Never mind this doesnt work either... :(

I tried it with visibility and without.

It seems the proximity on player and actor isnt working.

Any suggestions?

I think I might have a solution...

it seems that if I check proximity on player platoon, it doesn't work, BUT if I change it to friendly, it does!

gonna work on it again!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...