Bohemia Interactive Forums  

Go Back   Bohemia Interactive Forums > BI MILITARY GAMES FORUMS > ARMA 2 EDITING > ArmA 2 & OA - MISSION EDITING & SCRIPTING

ArmA 2 & OA - MISSION EDITING & SCRIPTING For discussing the technical aspects of creating custom ArmA 2 & the standalone expansion Operation Arrowhead missions as well as scripting.

Reply
 
Thread Tools Display Modes
Old 03-18-2010, 12:28 AM   #1
LJF
Master Sergeant
 
LJF's Avatar
 
Join Date: Sep 2008
Location: Australia NSW
Posts: 707
Counter - Count up and stop - Rally

Hi all,

I'm trying to make a simple rally mission but have no idea how to do a counter, let alone the other things.

I'm trying to do the following:

An mp mission where each car (player) starts behind the starting line, as each car goes through they get a timer (preferably one they can see counting up) which stops only after they have arrived at the finish and have passed through all of the checkpoints (it would also be good to have a message or sound when they pass each checkpoint so they don't end up at the finish line and swear alot ). Then whoever has the smallest time [when all surviving cars return] is declared the winner of the race.

Is it possible? It's quite beyond my knowledge of RV scripting. Thanks,

Sam.
__________________
Question Everything - Believe Nothing

AMD AM3 X4 OC @ 3.2
4gb DDR3 1600
ATI 4890
Asus VK24 @ 1080p
LJF is offline   Reply With Quote
Old 03-18-2010, 01:23 AM   #2
galzohar
Warrant Officer
 
Join Date: Jun 2009
Posts: 2,933
Yes, it's possible, most of what you done requires simple triggers and variables. Just have a variable initialized to 0 and increase it by 1 every time the specified player enters the trigger area.

To play a sound:
playSound

Not too sure how to show a timer without spamming, but the simplistic way would be to use the hint or titleText and format.
galzohar is offline   Reply With Quote
Old 03-19-2010, 02:31 AM   #3
LJF
Master Sergeant
 
LJF's Avatar
 
Join Date: Sep 2008
Location: Australia NSW
Posts: 707
Ah thanks mate, sorry it too me so long to reply, I'd forgotten I'd ever made the thread lol.

How do I use a variable? And what do I do in regard to local/global? Would it be

Quote:
variable time = 0
?

Would I have to make a variable for each car or would there be a more robust way of doing things?

Could give the player and update on the time every time they go through a checkpoint with the hint, but can you make sure it only goes to one player?

Keep in mind you are talking to someone who still uses a civilian running between two points into a trigger on repeat to get continuous events going For example to get it to rain I had a hooker run back and forth and everytime she did it triggered setrain 1 I basically haven't got a clue.
__________________
Question Everything - Believe Nothing

AMD AM3 X4 OC @ 3.2
4gb DDR3 1600
ATI 4890
Asus VK24 @ 1080p
LJF is offline   Reply With Quote
Old 03-19-2010, 11:18 AM   #4
galzohar
Warrant Officer
 
Join Date: Jun 2009
Posts: 2,933
The hint command is local and thus will only show on the computer where that command is run, so if you only show the hint when the player reaches the point then each player will see it when he himself reaches it.

You can also have 1 variable per computer tracking its own player, though it's usually better to have the server doing those kinds of things.

myVar = 5; will make myVar a global variable with a value of 5.
_myVar = "blah" will make _myVar a local variable with a value of "blah". Local variables are only accessible from within the same block (code surrounded with {}) where they were defined.

http://community.bistudio.com/wiki/Variables
galzohar is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:47 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.