Home   Help Search Login Register  

Author Topic: Getpos, setpos for alive units only?  (Read 1472 times)

0 Members and 2 Guests are viewing this topic.

Mike

  • Guest
Getpos, setpos for alive units only?
« on: 09 Sep 2002, 06:38:02 »
Ok what I need is a script to simply move my 6 playable units to another location when the script is activated.

Basically my group has run into a roadblock and gets arrested, I want the screen to fade to black for a few seconds then fade in again when the units are in the "prison"

I kinda suck at sripting currently.  ;) Which is why im here..

So if someone can do this it would be verry awsome!  :cheers:

I need my 6 players, named R1, R2, R3, R4, R5, R6  to move to a gamelogic object named prison.

I dont think its too hard.. just need a fade to black, then a setpos for the 6 men, then a fade in.. but I dont know how to put it together properly..
« Last Edit: 11 Sep 2002, 02:45:11 by Mike »

Cedaie

  • Guest
Re:I need a script
« Reply #1 on: 09 Sep 2002, 14:34:51 »
hrrm, firstly, don't use game logics for teleportation, which is what your trying to acheive, game logics are huge in there Icon size, and, they kinda look shabby, use triggers instead, and just name them, buut, anywayz:

this is the script you'd want:


~3
titlecut ["","black out"5]
~6
;is the leaders name R1?
"_x setpos getpos triggername" foreach units group player
~2

titlecut ["","black in"5]
~5
exit

Mike

  • Guest
Re:I need a script
« Reply #2 on: 09 Sep 2002, 19:42:13 »
the leaders name is R1 so would it be:


~3

titlecut ["","black out"5]
~6

"_x setpos getpos prison" foreach units group R1
~2

titlecut ["","black in"5]
~5

exit


Or does the R1 have to be the Groups name??
« Last Edit: 09 Sep 2002, 19:43:08 by Mike »

Mike

  • Guest
Re:I need a script
« Reply #3 on: 09 Sep 2002, 21:49:59 »
Ok well, Ive tried it how it is above and it warps the players fine, but the fade out and in doesn't work, it comes up with an error message at the top of the screen..?

what does the    thing do?
« Last Edit: 09 Sep 2002, 21:51:26 by Mike »

Offline KTottE

  • Former Staff
  • ****
Re:I need a script
« Reply #4 on: 09 Sep 2002, 22:39:10 »
There is no command named , they are just using that to explain that it is not the entire script shown.

 in this case would mean all the code you had before this particular part.

Just delete that line and you should recieve no more errors.

Cedaie: Please don't use words that can be mistaken for commands, it's just hard on everybody.
Instead, use the (code) (/code) feature instead and incapsulate the script with that.
It will make stuff appear in neat windows, like this:

Code: [Select]
~3
titlecut ["","black out"5]
~6
;is the leaders name R1?
"_x setpos getpos triggername" foreach units group player
~2

titlecut ["","black in"5]
~5
exit

Oh, and (code) (/code) isn't how it should look. The ) should be replaced with ] and the ( with [
So
) = ]
( = [

After that it'll work.
I had to use ( and ) instead, otherwise it would have turned into BBC code ;D

Cheers, KTottE
« Last Edit: 09 Sep 2002, 22:40:02 by KTottE »
"Life is not a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming 'WOW What a Ride!'"

Mike

  • Guest
Re:I need a script
« Reply #5 on: 10 Sep 2002, 03:03:03 »
I copied that exactly and changed names to the following:


~3
titlecut ["","black out"5]
~6
;is the leaders name R1?
"_x setpos getpos prison" foreach units group R1
~2

titlecut ["","black in"5]
~5
exit


and it still wont use titlecut.. Gives me a message at the top of the screen?..

and the name of the script is "prison.sqs"

I exec it with

[] exec "prison.sqs"

Is that right?
« Last Edit: 10 Sep 2002, 03:08:54 by Mike »

Mike

  • Guest
Re:I need a script
« Reply #6 on: 10 Sep 2002, 05:20:34 »
Well I found the problem myself and thought I should share ;)

Wrong:

titlecut ["","black out"5]

Right:

titlecut ["","black out",5]
« Last Edit: 10 Sep 2002, 05:21:06 by Mike »