Jump to content
Sign in to follow this  
xealot

noob questions

Recommended Posts

Hello.

I started with mission scripting only a day ago and while I understand alot of it, I find it really confusing in the same time.

One thing im particulary confused about is how the arrays work..

Right now, I have just been toying around with random ideas and

came up with a script to create 'suicide bombers'

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_player = _this select 0

_group = _this select 1

setfire=true

titletext ["Click on the map to deploy your suicide solider","plain down"]

onMapSingleClick "h setpos _pos; setfire=false"

@!setfire

"Civilian" createUnit [getpos h, _group, "bomber = this"]

bomber addEventHandler ["killed",{"Bo_GBU12_LGB" CreateVehicle [getpos bomber select 0, getpos bomber select 1, getpos bomber select 2]}]

However this only works for one soldier at a time, So in order to have multiple suicide bombers spawned, each being able to explode upon death, I would need to put them in some sort of array wouldnt I ? banghead.gif

If anybody could be kind enough to help me, I would be really grateful

Share this post


Link to post
Share on other sites

you already have the array, it's the players group, accessed with the F1,F2,F3,... etc keys.

what you need is a GOTO loop.

if you just started scripting you should use the *.sqf syntax....it better.

Share this post


Link to post
Share on other sites

I mean like, in my script above.. I name all my units "bomber"..

Wont that cause a problem when I set a event handler for 'bomber' if there are several with the same name?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×