How to replace entities?
I'm not sure why anything I do is failing... I currently have two separate entities cloned over each other, one is a non-lit flare, the other, ignited. I've had luck with the SetEntitycallbackFunc function by enabling and disabling the other on ignition using the OnIgnite. Everything is labeled correctly in the map as it is in the script but I get this error when I load up the map.
---------------------------
FATAL ERROR
---------------------------
FATAL ERROR: Could not load script file 'maps/starting_map.hps'!
main (16, 5) : ERR : 'type' is not declared
main (16, 5) : ERR : Expression must be of boolean type
---------------------------
OK
---------------------------
Here is the script
void OnStart()
{
SetEntityCallbackFunc("flare", "flare_ignite");
}
void OnEnter()
{
}
void OnLeave()
{
}
void flare_ignite(string &in EntityName, string &in Type)
{
if(type == "OnIgnite")
{
SetEntityActive("flare", false);
SetEntityActive("flare_lit", true);
}
}
The unlit flare is a tinderbox item and the lit flare is a grab object.
I have been out of remission on level editing/scripting for like a year and just getting back into it so I could very well be missing something obvious.
Is there any other way to replace entities, beside the new patch scripts?
-Grind to the Gore-
(This post was last modified: 05-24-2014, 09:22 PM by GoreGrinder99.)
|