Home   Help Search Login Register  

Author Topic: if something is done...  (Read 904 times)

0 Members and 1 Guest are viewing this topic.

Offline dalton

  • Members
  • *
  • i R n00b
if something is done...
« on: 14 Feb 2004, 02:50:52 »
i want a certain objective to be completed before they go to the extraction. and if they go to the extraction before they finish it, they die.

btw my objective is completed be an addaction thing if that helps

im guessin it has somethin to do w/ the condition field of a trigger but does ne1 have the correct syntax?
"freedom aint free"

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re:if something is done...
« Reply #1 on: 14 Feb 2004, 05:05:46 »
hmmm...objective completed by an addaction thing....i guess u call a script with this action.

if you put up a variable which will be set true by this script, and a trigger at the extraction point which checks if the variable is true. When it is false, a script which kills the player will be launched.

does this help you?

Offline dalton

  • Members
  • *
  • i R n00b
Re:if something is done...
« Reply #2 on: 14 Feb 2004, 17:52:06 »
um kinda...

can it be like at the end of the first script: v1 = true
and in a trigger at extraction it would be like: condition:v1 = false
                                                                        activation:player1 setdammage 1

is that right?
"freedom aint free"

gundernak

  • Guest
Re:if something is done...
« Reply #3 on: 14 Feb 2004, 21:40:07 »
You have to set a trigger at the extraction point which is activated by your units...

condition: this and v1
on activation: unitname setDammage 1

It means the trigger will activate only if your unit is there and v1 is true.

In the script you start by the objective completed:

v1 = false

It means if the script is executed, v1 variable becomes false, therefore your player will not be killed in the trigger.

Put this to the init.sqs:
v1 = true

Offline dalton

  • Members
  • *
  • i R n00b
Re:if something is done...
« Reply #4 on: 15 Feb 2004, 04:57:12 »
ok now how do i do it if only the player thats in the trigger dies (thers more than 1 player cuz its an mp mission)
"freedom aint free"

Offline dalton

  • Members
  • *
  • i R n00b
Re:if something is done...
« Reply #5 on: 15 Feb 2004, 14:42:40 »
ne1 know?
"freedom aint free"

Offline dalton

  • Members
  • *
  • i R n00b
Re:if something is done...
« Reply #6 on: 15 Feb 2004, 19:33:00 »
ne1?
"freedom aint free"

Offline dalton

  • Members
  • *
  • i R n00b
Re:if something is done...
« Reply #7 on: 15 Feb 2004, 23:21:30 »
is it even possible?
"freedom aint free"

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re:if something is done...
« Reply #8 on: 16 Feb 2004, 00:22:49 »
just guessing....

what happens if you put in the on activation box:

this setdammage 1

instead of unitname setdammage 1

??

dunno if this works...but ithink it's worth to try

gundernak

  • Guest
Re:if something is done...
« Reply #9 on: 16 Feb 2004, 00:51:28 »
 myke unfortunately it can not be working...

who is 'this'?

using 'this' always represents a unit or an object or something...

and always represents something within a certain 'environment'. for example: an init field,which refers to the certain unit

the condition field will not work as an 'environment' for using 'this'

because the 'environment' in this case is the trigger.

you can refer to the units who activated the trigger by:

'thislist' or 'list triggername'

I hope it is clear, my english....

I am not sure on what dalton want....

If you want the whole grouip to die use this:

Name the group (I named now group01), and use the following on activation:

"_x setDammage 1" forEach units group01

all units will die within group01.

If you have more else units you want to be killed, obviously you have to add the setDammage command for them as well

Offline dalton

  • Members
  • *
  • i R n00b
Re:if something is done...
« Reply #10 on: 16 Feb 2004, 14:35:57 »
wait the thislist would do it, how would i make it into the correct syntax?
"freedom aint free"

m21man

  • Guest
Re:if something is done...
« Reply #11 on: 16 Feb 2004, 14:42:51 »
Make some objective variables in your init.sqs file.
Code: [Select]
objective1 = 0
objective2 = 0
objective3 = 0
When one of these objectives is completed, you should set its variable to 1. Now create a trigger that checks if a condition is true:
Code: [Select]
?(objective2==0)And put player setdammage 1 in the On Activation field.
« Last Edit: 16 Feb 2004, 14:43:32 by m21man »

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re:if something is done...
« Reply #12 on: 16 Feb 2004, 15:01:23 »
@gundernak

ya you're right, there was a big mistake in my thinking. I thought "this" would refer to the unit which fired the trigger.

I should better be quiet when i don't have a clue what i'm talking about  ;D

@m21man

in general a good and simple way, but...

first, this won't work for AI controlled units.
second, a AI unit which passes the trigger area by mistake (i.e. a chopper fly over it) would fire the trigger and kill the player.

If you're sure, these things can't happen at all you can go with this.

@gundernak again  ;)

as far i understand dalton's prob, he will only the loon dying, which fired the trigger, not the whole group he's in.
In this case, would a "_x setdammage 1" work?

m21man

  • Guest
Re:if something is done...
« Reply #13 on: 16 Feb 2004, 15:06:10 »
Quote
in general a good and simple way, but...
first, this won't work for AI controlled units.
second, a AI unit which passes the trigger area by mistake (i.e. a chopper fly over it) would fire the trigger and kill the player.
If you're sure, these things can't happen at all you can go with this.
If you want it to kill any AI units in the trigger, put "_x setdammage 1" foreach thislist

gundernak

  • Guest
Re:if something is done...
« Reply #14 on: 16 Feb 2004, 18:27:51 »
 ...and you should set the trigger repeatedly

@myke

as m21 wrote in this case 'thislist' will refer to the units fired the trigger

forEach is for select all units from an array. Now the units who fired the trigger is the array...