Home   Help Search Login Register  

Author Topic: one of 3 options  (Read 1648 times)

0 Members and 2 Guests are viewing this topic.

Darren Fletcher

  • Guest
one of 3 options
« on: 24 Jan 2005, 17:27:17 »
Hi all this might be a simple thing to do but at this time i cant see any fix

I have a map that has 4 fuel depots under each depot is a laserbomb that triggers when a player hits the trigger to blow up the depot

whta im trying to do is make the map randomly blow up each depot from the triggerleaving 1 left that never blows up so it can be used.

Im looking so that the one thats left changes so making the map more dynamic

The mission basics are you start at a base and you have 3 tanks that are out of fuel, there are some fuel trucks at another location of the island that the team has to acquire but when they get there the trucks fuel tanks are empty so they need fuel. At the moment i have the same fuel depot that stays alive all the time so we can play the mission but with 4 depots on the island i though it might be nice for it to be random as to what fuel depot stays alive.

Any ideas would be good
Yours
Darren Fletcher
www.VS-UK.Net

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:one of 3 options
« Reply #1 on: 24 Jan 2005, 17:38:59 »
In your init.sqs initialise a counter variable

fuelBlown=0

In your triggers for each depot have this

Condition:  (whatever you already have) and fuelBlown < 3
On Activation:   whatever you already have;  fuelBlown = (fuelBlown + 1)


Each time a depot blows up it increments the counter by one.   But before it blows up, it checks the value the counter.    If three depots have exploded the fourth cannot, because the fuelBlown will have the value 3 so the trigger cannot fire.
Plenty of reviewed ArmA missions for you to play

Darren Fletcher

  • Guest
Re:one of 3 options
« Reply #2 on: 25 Jan 2005, 11:20:13 »
Great thanks that helps stop all 4 blowing up

But is there anything to make it random

IE i have 4 triggers and 4 fuel depots

players goto depot 1 and it blown so moves on to depot 2 and it blows then 3 it blows then 4 stays ok

What im looking for the no matter what order the the players arrive at the depots its random as to which one stays alive

ie 1st time you play the map depot 1 does not blow even though they might get there first
and the next time you get there its depot 3 that does not blow

not an easy thing to describe what your looking for sometimes :) Thanks for the fast reply!!

The triggers i have are just west detected by east so simple trigger really
an other way of this working would be to randomly blow 3 of the 4 depots and the players wont know which one is blown an which one to arrive at to get the fuel into the trucks

The other issue is a setcargo = 1 to refuel the trucks rear fuel tanks as if you use the game refuel it only refills the truck itself and not the tanks at the back.

I suppose i have to use some game logic here to move this trigger to the depot that is not blown but thats something im still learning to be honest.



Yours
Darren Fletcher
« Last Edit: 25 Jan 2005, 11:25:55 by Darren Fletcher »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:one of 3 options
« Reply #3 on: 25 Jan 2005, 11:35:35 »
Oh I see.     So it is as if the charges fail one time out of four?

Well we can easily do that, I have to run now but will answer later unless somebody beats me to it.


Edit later:

In your init.sqs

blow1=true
blow2=true
blow3=true
blow4=true
_rand=random 4
? _rand <= 1 : blow1=false; goto "next"
? _rand <= 2 : blow2=false; goto "next"
? _rand <= 3 : blow3=false; goto "next"
blow4=false
#next
etc.

The four variables are initially set to true.   Each fuel station trigger checks "its" variable and will only blow if the relevant variable is true.   For example, in the trigger for fuel depot 1 you will have

Condition:  blow1 and (whatever you already have)

If blow1 is true the trigger can fire:  if it is false it cannot.

The random command creates a random number between 0 and 4.  Depending on the value of that number one of the variables is set to false, so the corresponding fuel depot cannot explode.   It will be a different one every time you play the mission.

Is that what you want?    Syntax not guaranteed but the principle is correct.


The other problem.   Trigger:-

Condition:   fuel tanker1 > 0.9
On activivation:   tanker1 setFuelCargo 1

Syntax not guaranteed but the point is that when you fill up the tanker so that it can drive, the cargo tank on the back is also filled.   You don't need any gamelogics.
« Last Edit: 25 Jan 2005, 13:25:52 by macguba »
Plenty of reviewed ArmA missions for you to play

Darren Fletcher

  • Guest
Re:one of 3 options
« Reply #4 on: 25 Jan 2005, 23:51:57 »
OK all interesting stuff that ill give it a go and get back to you thanks

Darren Fletcher