OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Tinky the target on 26 Sep 2003, 00:07:30
-
During one of my missions, there is a rather long dirving sequence...SO i thought i would have the 3 occupants make random comments, or maybe a random coversation.
Having little scripting knowledge, this is where i turn to you...the brainy peeps.
I assumed it would work like this, within the script a number is random chosen (i believe there is a random number selector comman)...this could be entered as a variable....which would nthen be called.
Now, the conversations could have number labels.
basically when a number is randomly chosen and called, I would like the script to jump to the part of the script labelled with that number... confusing???? ;D
That way, each time the mission is played, there should be a different conversation during the driving section....
Thanks for any help
-
_rnd = random 3
? _rnd <= 1 : goto "3"
? _rnd <= 2 : goto "2"
#1
wateveruwant
exit
#2
wateveruwant
exit
#3
wateveruwant
exit
dats wat u lookin 4 ?
LCD OUT
-
Yeah mate...exactly what i was after!!! 8) 8) 8)
Cheers ;D
-
Dont mean to be a pain. But could you explain how this works? It might help in the furutre as I think a random chat-o-script could have multiple uses.
As far as I can see (with my limited understanding)
With this script...if the random number is less than or equal to 1...it plays label 3.
If the the random number is lessthan or equal to 2...then it plays label 2.
so if it isnt less than or equal to 1 or 2 then i assume it plays label 1???
Thanks
-
yes it is ;)
wat i did is somin like dat
_rnd = random 3
_Rnd gets num between 0-3
? _rnd <= 1 : goto "3"
if da num is less or equal 1 it go to label 3
? _rnd <= 2 : goto "2"
if da num is less or equal 2 it go to label 2 (i already know dat its bigger dan 1 cuz it didint go 2 label 3 b4 - so now i dont have 2 check if its biger dan 1)
now if its not smaller dan 2 da script just continue readin - nd gets 2 label 1 w/o me telin it 2 do
LCD OUT
-
well now it makes sense....I think.
Thanks LCD