Jump to content

Random Spawn and Random Time question


Quagmire

Recommended Posts

Hi guys

Just playing with a scenario where civilian vehicles are fleeing a town. Thing is, I want to randomise their spawn into the game and at various times.

So far I have Spawn If...

0 <== random variable X1 < 50

That is giving me a 50% chance of the spawn occurring which is OK but I would also like to randomise when they appear in a mission. I've played with the Mission>time box but that's still set at a specific time period.

How do I add a random appearance time to the 50% chance of spawning?

Plus (I know, a lot of questions), what exactly do I use at the top of the screen - a tick in left box before AND, or both?

Cheers all, hope the above made sense to someone. :biggrin:

Q

PS, I've been reading through scenario design in the wiki but not sure I'm following it right. Perhaps because its late here, or maybe the alcohol has had an effect... ;)

Link to comment
Share on other sites

You'll have to do it a long handed way.

Set up a group of events or conditions like this:-

  1. 0<= random variable X2 < 25 AND Mission time > 5
  2. 25<= random variable X2 < 50 AND Mission time > 10
  3. 50<= random variable X2 < 75 AND Mission time > 15
  4. 75<= random variable X2 < 100 AND Mission time > 20

Now set up an event to capture the above:-

{Event 1 is True} OR {Event 2 is True} OR {Event 3 is True} OR {Event 4 is True}

Then for your Spawn if you do:-

0 <== random variable X1 < 50 AND Event 5 is True

Note I've done only 4 time divisions. If you want to do more then you will have to use 2 events to capture the time and random as you can only do 4 OR's in a single event.

Link to comment
Share on other sites

Hi DarkAngel, can I ask a favour?

Would you mind taking a quick look at the attached Spawn Test scenario please?

I followed your advice above and created 4 Blue Events named:

Variable 1

Variable 2

etc.

Each was set as you outlined.

Finally I created a 5th - 'All Variables' that used the OR argument tying them all together.

I've added 4 vehicles to the scenario and each has a spawn of:

0 <== random variable X1 < 50 AND Event - All Variables - True

Each variable has a 10 second interval. Quite fast but good for testing. However, none of the vehicles appear. :confused:

I've gone over it several times but not sure if I've missed something.

Cheers!

Q

56e83caca213a_SpawnTest_zip.f1fb9cc1435d

Spawn Test.zip

Link to comment
Share on other sites

Right, I'm having a blonde moment...

I thought it was working now, but for some reason when it hits the :40 mark I get all or none of the vehicles appearing at the same time, instead of across the 40 seconds where there are 10-second intervals for the 4 Variable Events.

I've attached this test scenario with the 4 OR arguments set, but can't see why it's showing an all-or-nothing outcome 50% of the time. :confused:

Would you mind taking a quick peek at this please?

Cheers,

Q

56e83cacb17da_SpawnTestv2_zip.3a28fe8ae5

Spawn Test v2.zip

Edited by Quagmire
Link to comment
Share on other sites

Well that is exactly what the logic is telling it to do. you are saying (50% spawn chance) when one of the timing Events is true. As each of the tanks has the same "spawn if" condition using X1 this is the expected behavior.

If you want to set each tank to have a different spawn time then you will have to get more complex.

1. Four time division single event:-

0<= X2 <25 OR ((25<=X2<50 AND Mission time > 5) OR (50<=X2<75 AND Mission time > 10) OR (75<=X2<100 AND Mission time >15))

Set the "after true delay by" to be the time you want the spawning to start.

2. Make one of those for each tank and use a different X number. Lets call them tank1,tank2,tank3 and tank4.

3. On your tank set the "Spawn if" to Event tank(1,2,3 or 4) is true.

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...