Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Beacon
Re: Beacon [message #272020 is a reply to message #272013] Mon, 09 July 2007 15:43 Go to previous messageGo to previous message
a100 is currently offline  a100
Messages: 45
Registered: March 2007
Karma:
Recruit
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

 
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: Thu Nov 28 17:32:18 MST 2024

Total time taken to generate the page: 0.00899 seconds