OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: wired on 11 Feb 2004, 18:53:47

Title: Ok, im finding this mapaclick thing hard...
Post by: wired on 11 Feb 2004, 18:53:47
Ok, some of u may hav seen the post i made about the 'onmapclick' thing but i really need help. I've got an explosion script, and i want it to be activated after around 15 secs, where the player has made a marker. i tried to modify snypir's usermarker script from the smoke script he made, or to try and learn how he did it but nothing succeeded. HELP ME PLZ  :'(
Title: Re:Ok, im finding this mapaclick thing hard...
Post by: Spinor on 11 Feb 2004, 23:00:11
The syntax to define the map click handler should look something like this
Code: [Select]
onMapSingleClick{"myMarker" setMarkerPos _pos; [_pos,15,...] exec "explosionscript.sqs";true}You can put it into any Init-line or the "init.sqs" script. It defines the code to be executed everytime the player clicks on the map. In the above case, it moves the marker "myMarker" (which you have to place in the editor) to the click position and calls your explosionscript with the click position and the time delay as parameters. As I do not know the explosion script I can only guess what its parameters are. The easiest way to create the time delay is to modify the explosionscript like:
Code: [Select]
_pos = _this select 0
_delay = _this select 1
;etc... any other parameters

;this causes the script to pause for _delay seconds
~_delay

;continue explosion script

Hope this helps,
Spinor
Title: Re:Ok, im finding this mapaclick thing hard...
Post by: wired on 12 Feb 2004, 18:04:56
didn't work.......the script gives me an error when i try to camcreate the explosion because it dont recognise the position.
Title: Re:Ok, im finding this mapaclick thing hard...
Post by: Spinor on 12 Feb 2004, 18:09:40
Well, I have no idea what the script looks like, hence I was only guessing how it has to be executed. Could you post the script?
Title: Re:Ok, im finding this mapaclick thing hard...
Post by: Azraell on 13 Feb 2004, 05:09:37
http://azraell.rendervisions.com/downloads/explosionscript.zip (http://azraell.rendervisions.com/downloads/explosionscript.zip)


Here, download this i made real quick.

Put it in ur user/missions folder with ur other editor missions...
open in ur editor and start it and click on the map and wait 15 seconds.

Study it, learn it, know it ;)
Title: Re:Ok, im finding this mapaclick thing hard...
Post by: wired on 14 Feb 2004, 16:39:42
Cheers man....thats gr8........it finally works!
WHHAAAAAAAAHOOOOOOOOOO!!!!!!  ;D ;D ;D ;D ;D ;D ;D

U've really helped guys, thanx a bunch!

wired