Home   Help Search Login Register  

Author Topic: Variable Q's (basic)  (Read 595 times)

0 Members and 2 Guests are viewing this topic.

Offline Burn

  • Members
  • *
Variable Q's (basic)
« on: 29 Apr 2003, 19:42:04 »
Ok I'm going to start with something I read on another thread...
Is this true?:
Quote
You have to define the variables in init.sqs otherwise:  if OFP finds a variable that has not previously been defined it assumes that the whole expression is false.

My problem is that I hawe a trigger that sets a variable true:on activation: Alarm = true
and another trigger that has that variable in its condition field.
The first trigger activates fine but the other one won't...

If the abowe quote is true qould someone give me some pointers, on how to create a init.sqs file and predefining your variables in it... is it somewhat similar to creating a description.ext ???

All help is greatly appreciated!!!... Thanx in advance ;)
« Last Edit: 29 Apr 2003, 19:45:25 by Bizon »

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Variable Q's (basic)
« Reply #1 on: 29 Apr 2003, 22:18:53 »
Hmmm... this would shoot. Have you tried another word such as "TheAlarm=true"?
When I have trouble launching triggers I put in a titletext in the effect section in the trigger just to see if itÂ's the triggers on act field who is f00kin or if it is the triggers cond field, try that too!

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Variable Q's (basic)
« Reply #2 on: 30 Apr 2003, 03:18:16 »
Is that true?

Well... sort of.

All your variables have to be initialized (eg set to true, false, 0, 1 or whatever). However it doesn't have to be in the init.sqs

For your situation you could just put:

Alarm = false

in the init line of any unit. It will have the same effect as having it in the init.sqs would ;)

Offline Burn

  • Members
  • *
Re:Variable Q's (basic)
« Reply #3 on: 30 Apr 2003, 16:11:57 »
@ The real Armstrong:
Quote
When I have trouble launching triggers I put in a titletext in the effect section in the trigger just to see if itÂ's the triggers on act field who is f00kin or if it is the triggers cond field, try that too!
I've allready tryed that but I'll try to change the name as you suggested...
thanx.

@ Sui
Quote
For your situation you could just put:

Alarm = false

in the init line of any unit. It will have the same effect as having it in the init.sqs would
Thanx alot Sui :D

Thanx alot for your replys guys :D

Offline Burn

  • Members
  • *
Re:Variable Q's (basic)
« Reply #4 on: 30 Apr 2003, 16:35:18 »
Oohh crap :P... didn't seem to work, could the parameters of the triggers hawe anything to do with it ???...
the first trigger activated fine... but the second for some reason din't.
Any ideas?

Offline Burn

  • Members
  • *
Re:Variable Q's (basic)
« Reply #5 on: 30 Apr 2003, 17:23:51 »
This is what I hawe in my mission:
TRIGGER#1[/b]

Axis a: 500
Axis b: 500
ellipse
Activation: Resistance
Repeatedly
Detected by east
Countdown: 0, 0, 0.
Type: none
Condition: this
On activation: alarm=true

TRIGGER#2

Axis a:0
Axis b:0
ellipse
Activation: None
Repeatedly
Detected by east
Countdown: 0, 0, 0.
Condition: alarm=true

I've tryed to change the variable name to v1, and I allso set the variable to false in a units init. field... both triggers where tested with various effects to see if they work... only the first trigger was activated. If you are out of suggestions, do you recall any mission that might use something similar... so I could unPBO it and check what I'm doing wrong here :P... BTW I'm using version 1.90

Thanx in advance :)
« Last Edit: 30 Apr 2003, 17:30:06 by Bizon »

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Variable Q's (basic)
« Reply #6 on: 30 Apr 2003, 18:39:12 »
Hmmm... WhatÂ'll happen if you change repeatedly to once on both triggas?
« Last Edit: 30 Apr 2003, 18:39:29 by The real Armstrong »

Offline Burn

  • Members
  • *
Re:Variable Q's (basic)
« Reply #7 on: 30 Apr 2003, 20:01:22 »
Yuppee :D... I figured it out, u can't type alarm=true. the correct syntax is: alarm... so it would't activate the trigger because u only hawe to put the, variablename in the condition field. SO i skipped the: =true, in the second triggers condition field and BAM it worked ;D...

Thousands of thanx to you two for all the help :D ...I couldn't hawe done it without your advice :)

-----------------------------Bizon OUT :-X------------------------------------------------