Jump to content
Sign in to follow this  
Lorenzo

1 unit/group protect unlimited units

Recommended Posts

hello,

this is my second script biggrin.gif

this time i want 1 unit or 1 group of units protect an unlimited amount of units who's scatter on the map and go next the unit who take damage (1 time) ..

this is an exemple :

p1 is the unit "protector"

bb1, bb2, bb3, bb4 is the units to protect ...

you put a trigger and in condition you put : getdammage bb1 !=0 OR getdammage bb2 !=0 OR getdammage bb3 !=0 OR getdammage bb4 !=0

in activation you put this : [p1,bb1,bb2,bb3,bb4] exec "move.sqs"

don't forget to cut the trigger : no other activation and select "plusieurs fois" .. perhaps "more time" in english ... i'm not sure

this is the script in move.sqs

; [nom_unité_a_deplacer,nom_unité1_a_verifier,nom_unité2_a_verifier,...] exec "move.sqs"

;/*******************************************************

;*

;* move.sqs

;*

;*******************************************************/

_nom_garde = _this select 0

_nb = count _this - 1

#boucle

_nom = (_this select _nb)

? (getdammage _nom != 0) : goto "actions"

_nb = _nb - 1

? _nb == 0 : goto "fin"

goto "boucle"

#actions

_pos = getpos _nom

_nom_garde domove[(_pos select 0)+10,(_pos select 1)+10]

#fin

--------------------------

it's a simple script but you don't have to put a lot of triggers or waypoint with it ....

perhaps someone who's good in mathematique can make a little fonction with sinus and cosinus for place the "protector" align in the right side of the unit who take damage ??

i reach how i can destroy the trigger who don't have utility after the "protector" move ?

Share this post


Link to post
Share on other sites

No offense, but you could make scripts more clear by using

english in the variable names and so on..

Share this post


Link to post
Share on other sites

Laury Thorn - no offense, but why has a variable to

be in english? A variable as far as i know, is a couple

off letters, where to put a value or string in.

If you are reading the script, you can see the difference

if it's a variable or a command (if you know about scripting)

I for myself think, it's even an advantage, that he's using

french variable names, because so people would know,

that all, they can't understand, are variables, and the stuff,

they can understand are commands wink.gifbiggrin.gif

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (DV Chris Death @ Mar. 21 2002,18:50)</td></tr><tr><td id="QUOTE">I for myself think, it's even an advantage, that he's using

french variable names, because so people would know,

that all, they can't understand, are variables, and the stuff,

they can understand are commands  wink.gif  biggrin.gif<span id='postcolor'>

DV Chris Death : biggrin.gif lol ...... it's facts life ? biggrin.gif

you're right, normally it's not a big problem

LauryThorn : no problem smile.gif ... i put my script in spanich/english/french forums and i can't make a good translation at each time confused.gif ... it's long for me to translate .... While i am writing this message i have 2 dictionnaries next me and i look all the time inside ..

i have make a little traduction smile.gif :

nom == name

garde == protection

boucle == ??

actions == actions

fin == end

; [name_unit_to_move,name1_unit_to_protected,name2_unit_to_protected,...] exec "move.sqs"

.......

Share this post


Link to post
Share on other sites

boucle=cycle

enfin si sa peut aider/ if that can help a bit

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">no offense, but why has a variable to be in english? A variable as far as i know, is a couple off letters, where to put a value or string in.<span id='postcolor'>

Let's say we have this mission that I made.

Which one of these sentences is easier to read and understand:

1)

vihollisen_tarkka_ampuja doMove ( getpos tahystamispaikka )

2)

enemy_sniper doMove ( getpos observation_post )

I didn't mean that variables have to be in English, maybe just

Lorenzo could get better help here if people would understand what his

script is doing.

Of course scripts with french variable names can be understood, it just

takes more time..

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE"> DV Chris Death : lol ...... it's facts life ? you're right, normally it's not a big problem

LauryThorn : no problem ... i put my script in spanich/english/french forums and i can't make a good translation at each time ... it's long for me to translate .... While i am writing this message i have 2 dictionnaries next me and i look all the time inside ..<span id='postcolor'>

I did not mean to offend.. This was just an idea.. See I'm a programmer and I've learned

that it is easier for me to get help if I have used English instead of Finnish in the code..

Share this post


Link to post
Share on other sites

Laury Thorn: if you would now write one in german language,

i would say this one is easiest to read (i'm from Austria) biggrin.gif

Now really, i wouldn't have any problem with both of your

samples, 'cause the only thing i see in there is:

x domove (getpos y) - probably i've been for to long in this

computer business tounge.gif

OK i know, what you wanna say here, and i also understand this, but you have to understand my point then too

wink.gif

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">but you have to understand my point then too<span id='postcolor'>

Oh yes, I do. Although I didn't say that my way is the right way, I just wanted to point that thing out..

I recently started working in a software house that has

400000 lines of uncommented and undocumented code.

I learned a lesson there when I tried to figure out some

things about the code..

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  

×