Home   Help Search Login Register  

Author Topic: My timer wont work, and i cant see why?  (Read 841 times)

0 Members and 1 Guest are viewing this topic.

Cap

  • Guest
My timer wont work, and i cant see why?
« on: 26 Mar 2003, 13:40:16 »
It is a sqs file named "Timer"
In the init field of a trigger i have...
[] exec "Timer.sqs"
And yes the trigger is activated cos i have my CTF script activated there and that works fine.
It wont show my hints,
and it wont end the mission when Param1 is hit (this is done in another script if you are wondering where it is.
I just dont think the timer is being activated.
And yes my description.ext is set up properly (i hope) :-\
here it is take a look......

#Start
?Param1 == Timer: Goto "End"
~1
?Param1 - timer == 60: hint "1 min left"
?Param1 - timer == 120: hint "2 min left"
?Param1 - timer == 300: hint "5 min left"
?Param1 - timer == 600: hint "10 min left"
?Param1 - timer == 1200: hint "20 min left"
timer = timer + 1
goto "start"

#End
exit

Thanks in advance

Cap

  • Guest
Re:My timer wont work, and i cant see why?
« Reply #1 on: 26 Mar 2003, 14:41:11 »
Another few points

- When i load the mission it does not say that it cant find the "Timer.sqs". which is strange because it should, if it cant find it that is.

- This is my description.ext

respawn=base
respawndelay=20


titleParam1 = "Time Limit";
valuesParam1[] = {100000, 300, 600, 900, 1200, 1500, 1800, 2700, 3600, 7200};
defValueParam1 = 1800;
textsParam1[] = {"Unlimited", "5 min", "10 min", "15 min", "20 min", "25 min", "30 min", "45 min", "60 min", "120 min"};

titleParam2 = "Score Limit";
valuesParam2[] = {10000, 1, 3, 5, 7, 10, 15, 20};
defValueParam2 = 5;
textsParam2[] = {"Unlimited", 1, 3, 5, 7, 10, 15, 20};


class CfgSounds
{
   sounds[] =
      {
         UScore, UCapture
      };
   class UScore
   
   {
      name = "UScore";
      sound[] = {"UScore.ogg", 1, 1.0};
      titles[] = {   };
   };
   class UCapture
   
   {
      name = "UCapture";
      sound[] = {"UCapture.ogg", 10, 1.0};
      titles[] = {   };
   };
};

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:My timer wont work, and i cant see why?
« Reply #2 on: 26 Mar 2003, 15:16:03 »
x == 60 doesn't work very well in OFP.   Try

59.5 <= x <=60.5

or something.  

At the beginning of the script put a debugging hint

hint "Timer has started"

so at least you know if the script has started correctly.
Plenty of reviewed ArmA missions for you to play

Cap

  • Guest
Re:My timer wont work, and i cant see why?
« Reply #3 on: 26 Mar 2003, 15:39:23 »
Ok i did what you said, apart from i made it.....
Param1 - Timer == 61: hint "1 min left"
cos the seconds only clock up in whole numbers cos i used ~1.

I got the hint at the begining, but i thought it was because i put it before #Start. But i did not get any other hints so i put it after #Start to check if the loop was working and it was, i got a hint every second. :P

so the problem is here...

Param1 - Timer == 61: hint "1 min left"

but what is it?
« Last Edit: 26 Mar 2003, 15:41:36 by Cap »

Cap

  • Guest
Re:My timer wont work, and i cant see why?
« Reply #4 on: 26 Mar 2003, 15:50:33 »
And another thing is I am testing it offline in the editor, and i know the description.ext doesn't work in the editor but it does online, BUT I did set...
Param1 = 660; Param2 = 1
In a trigger and the trigger is definatly activated cos it is the trigger i activate "Timer.sqs" in and i get the hint in the begining telling me the timer started.

So does that make a difference (cos i would'a thought i doesn't).

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:My timer wont work, and i cant see why?
« Reply #5 on: 26 Mar 2003, 15:59:08 »
description.ext does work in the editor, at least it does for most things.   I'm not a real expert though

You don't appear to define Timer anywhere, that could be it.

hint "timer script starts"
Param1=660
Timer=0

#Start

?timer==5:hint "loop working"

?Param1 == Timer: Goto "End"
~1
?(Param1 - timer) == 61: hint "1 min left"

etc
Plenty of reviewed ArmA missions for you to play

silent1

  • Guest
Re:My timer wont work, and i cant see why?
« Reply #6 on: 26 Mar 2003, 17:14:18 »
Quote
you are gay

1. There is nothing wrong with being gay.
2. Nobody likes to hear remarks like that.

Macguba I think you've got it there :)

Cap

  • Guest
Re:My timer wont work, and i cant see why?
« Reply #7 on: 27 Mar 2003, 11:41:16 »
Praise the Lord i think he's cracked it!!! ;D

Yep that was the problem alright, im almost embaresed that i over looked that, it is just such a simple thing that i didn't think to check it cos i was sure i would not have been so dumb as to forget that :o but at least someone has a bit of brains :P thanks guys. :)