Home   Help Search Login Register  

Author Topic: Placin stuff kinda RTS style  (Read 526 times)

0 Members and 1 Guest are viewing this topic.

Foo

  • Guest
Placin stuff kinda RTS style
« on: 12 Feb 2003, 14:19:07 »
i want to set up a "small shed", so that when the player uses an action it creates a shed where he is...so far ive got a shed, named"y".the player is called "x" .On Radio Alpha,:
y setpos[getpos x select 0, getpos x select 1]

So, what i want to do is
-1- make this shed face the direction the player is facing
-2-make it summoned by an action in the menu

Thanks in advance for any help

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:Placin stuff kinda RTS style
« Reply #1 on: 12 Feb 2003, 14:20:18 »
Y SetDir (GetDir X)

For rotating.  Though Im not sure if the "front" is infact the front of the shed.  It might be that you need to add an extra 90 degrees or somthing.
« Last Edit: 12 Feb 2003, 14:21:23 by [icarus_uk] »

Foo

  • Guest
Re:Placin stuff kinda RTS style
« Reply #2 on: 12 Feb 2003, 14:21:50 »
would you mind if u did the full command?
Would it read like:

y setpos[getpos x select 0, getpos x select 1];Y SetDir (GetDir X)


Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:Placin stuff kinda RTS style
« Reply #3 on: 12 Feb 2003, 14:27:49 »
From the top.

You need a trigger, script or WP to give your man the action to add a shed.  Depending on when you want to give the player the chance to do this, you might put the command in the init or in a trigger or WP.

unitname addaction ["Place A Shed","placeshed.sqs"]

This will give the unit you name in the first part the action "Place A Shed", when used, the game will run the script "placeshed.sqs".

In the script "placeshed.sqs" you want to write;


y setpos[getpos x select 0, getpos x select 1, 0];
Y SetDir (GetDir X);

exit


Now when you use the action it will move the shed.
« Last Edit: 12 Feb 2003, 14:30:21 by [icarus_uk] »

Foo

  • Guest
Re:Placin stuff kinda RTS style
« Reply #4 on: 12 Feb 2003, 14:29:51 »
thanks that a great help ;D