Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Renegade Coordinates
Re: Renegade Coordinates [message #434282 is a reply to message #434266] Thu, 05 August 2010 16:21 Go to previous messageGo to previous message
a000clown
Messages: 363
Registered: May 2005
Location: Canada
Karma:
Commander
Vector3 Position = Commands->Get_Position(obj); //Gets position of an object
float Facing = Commands->Get_Facing(obj); //Gets facing of an object
Position.X += static_cast<float>(1.5*cos(Facing*(PI/180))); //Sets the previous position to be directly in front of the object
Position.Y += static_cast<float>(1.5*sin(Facing*(PI/180))); //^
Position.X += 0,Position.Y += 0,Position.Z += 0; //Depending on what you're spawning, you may want to manually change the position, so the object doesn't do something stupid like spawn partially in the ground/terrain
                                                 //Simply replace 0 where necessary, with however mugh change you feel is needed
                                                 //X is horizontal, increase to move right, or use a nagative number to move left
                                                 //Y is vertical, increase to move forward, or use a nagative number to move backward
                                                 //Z is height, increase to move up, or use a nagative number to move down
GameObject *Buggy = Commands->Create_Object("CnC_Nod_Buggy",Position); //Spawn your new object with the newly set Position (note: it's been a long time, not sure if that's the correct preset for a buggy)
Commands->Set_Facing(Buggy,Facing); //Set the facing of this new object to match the facing of the original object

I noticed you're on the nite-serv IRC, if you need anymore help you can PM me there (I'm usually under the nick Mike)
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Looking for a specific HUD
Next Topic: huds
Goto Forum:
  


Current Time: Sun Oct 20 18:35:26 MST 2024

Total time taken to generate the page: 0.00747 seconds