Home   Help Search Login Register  

Author Topic: I really need help :(  (Read 782 times)

0 Members and 1 Guest are viewing this topic.

EFileTahi-A

  • Guest
I really need help :(
« on: 26 Oct 2002, 16:23:19 »
Like:

I have a group of five man. I want to make a script which will give me the name of the last dieing soldier...

So that name can be used to get its coordenates for a camera which will focus him and make a slow motion dieing scene with the "setacctime"

In theory I guess its something like this:

------------------------------------------------------------
#ini_loop

;Checking when only 1 soldier is alive of a target group:
;if its true goto "END"

else

goto "ini_loop"

#END

;Wait until he dies
 Hint "All members are dead"
     
_pos=getpos This_would_be_the_last_dieing_soldier
_camera="camera" camcreate[_pos select 0, _pos select 1, (_pos select 2) + 3.5 ]
_camera cameraEffect ["EXTERNAL","TOP"]
_camera camSettarget This_would_be_the_last_dieing_soldier
_camera camCommit 0.01

~5

exit
------------------------------------------------------------
Just a good "cheking how namy soldiers alive of a target group" couting script would be very nice!

Sorry 4 my bad english...

Tks to all!
« Last Edit: 26 Oct 2002, 19:54:46 by EFileTahi-A »

DeusRich

  • Guest
Re:I really need help :(
« Reply #1 on: 27 Oct 2002, 02:43:43 »
ok, im a little rusty on my scripting so this may not work but u seem to have the camera bit worked out. The bit that will tell you the last person alive could be:

Code: [Select]
_soldier1 = _this select 0
_soldier2 = _this select 1
_soldier3 = _this select 2
_soldier4 = _this select 3
_soldier5 = _this select 4

#loop
?(!alive _soldier1):_n + 1
?(!alive _soldier2):_n + 1
?(!alive _soldier3):_n + 1
?(!alive _soldier4):_n + 1
?(!alive _soldier5):_n + 1
?(_n = 4):goto: "checkwhich"
~0.2
goto: "loop"

#checkwhich
?(alive _soldier1):_lastmanalive = _soldier1
?(alive _soldier2):_lastmanalive = _soldier2
?(alive _soldier3):_lastmanalive = _soldier3
?(alive _soldier4):_lastmanalive = _soldier4
?(alive _soldier5):_lastmanalive = _soldier5

=*=*=*=*=*=*=*=*=*=*=

_pos=getpos _lastmanalive
_camera="camera" camcreate[_pos select 0, _pos select 1, (_pos select 2) + 3.5 ]
_camera cameraEffect ["EXTERNAL","TOP"]
_camera camSettarget _lastmanalive
_camera camCommit 0.01

~5

exit

now, if you wanted this to happen when the last man dies, not just when all his comrades are dead, then where i've put =*=*=*=*=*=*= you have to place the lines

#loop2
?(!alive _lastmanalive):goto: "loop2end"
~0.2
goto: "loop2"

#loop2end

hope this helps, and im not sure if you put the : after the goto, so you may need to edit that.

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:I really need help :(
« Reply #2 on: 27 Oct 2002, 06:15:49 »
Welcome to the forums, EFileTahi-A

You don't need a script at all to find the last living soldier... you can just use the leader command... eg:

cam camsettarget (leader group)

To get this to work you'll need to define the group. Put a line like this:

group = group this

in the leader's init field. The name (group) can be anything you want (apart from a few reserved words) ;)

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:I really need help :(
« Reply #3 on: 27 Oct 2002, 07:53:25 »


Welcome to the sewers of editing!
[/color][/size]



  ;D have a neat stay, matey!  :-*




EFileTahi-A

  • Guest
Re:I really need help :(
« Reply #4 on: 27 Oct 2002, 14:47:06 »
DeusRich:

Your script realy kicked ASS! It did not worked cooze of some syntax and array errors but I understood exactly your ideia! The script is now working... Many special thanks to you!


Sui:

Nice trick! So simple but efficient! Thank you!


Tomb:

Never had such welcome in a forum! That was pretty touch!
Thank you!

PEACE! :)