Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Beacon
Re: Beacon [message #272022 is a reply to message #272020] Mon, 09 July 2007 15:45 Go to previous messageGo to previous message
BlueThen is currently offline  BlueThen
Messages: 2402
Registered: February 2006
Karma:
General (2 Stars)
a100 wrote on Mon, 09 July 2007 17:43

You need to get the facing and use basic trig.
This is pseudo code for how to achieve it.


First:
#include <math.h>
#define PI 3.14159265 

Then:
On_Beacon_Creation {
   float facing = Commands->Get_Facing(planter)
   Vector3 pos = Commands-> Get_Position(planter)
   pos.X += -1*(cos(facing*(PI / 180)))
   pos.Y += -1*(sin(facing*(PI / 180)))
   // -1 is the distance away from the player can be set to more/less
   Commands->Set_Position(beacon,pos)
}


Only one problem tho which is that player could face a buidling and beacon may spawn in the building in which case its un-disarmable




err I honestly don't know much C++, I can't even compile the scripts. Can you or someone else help me with this?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: calico submachine gun
Next Topic: Reflective Materials
Goto Forum:
  


Current Time: Sun Jan 12 16:28:35 MST 2025

Total time taken to generate the page: 0.00940 seconds