Altzan wrote on Tue, 12 April 2011 11:21 |
You can't have it spawn directly at an object's location using its ID? I don't remember, its been awhile.
|
yes you can with a different script.
Something like this should work hasn't been tested. We use a dummy object on the map to get spawn location and the facing.
void JFW_Preset_Buy_Poke2::Poked(GameObject *obj,GameObject *poker)
{
const char *preset = Get_Parameter("Preset_Name");
int x = Get_Int_Parameter("Player_Type");
int cost = Get_Int_Parameter("Cost");
int z = Get_Int_Parameter("LocationObject_ID");
if (!z) { return; }
if (CheckPlayerType(poker,x)) {return;}
if (cost <= Commands->Get_Money(poker))
{
cost = -cost;
Commands->Give_Money(poker,(float)cost,0);
GameObject *LocationObject = Commands->Find_Object(z);
Vector3 spawn_position = Commands->Get_Position(LocationObject);
GameObject *createdobject = Commands->Create_Object(preset,spawn_position);
float facing = Commands->Get_Facing(LocationObject);
Commands->Set_Facing(createdobject,facing);
}
}