![]() |
|
|
|||||||
| 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. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Master Sergeant
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 |
|
|
|
|
|
#2 |
|
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.
__________________
You don't mess with the Zohar! http://www.blackfootstudios.com/forums/ http://www.blackfootstudios.com/foru...blog&blogid=2& |
|
|
|
|
|
#3 | |
|
Master Sergeant
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:
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 |
|
|
|
|
|
|
#4 |
|
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
__________________
You don't mess with the Zohar! http://www.blackfootstudios.com/forums/ http://www.blackfootstudios.com/foru...blog&blogid=2& |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|