The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to replace entities?
GoreGrinder99 Offline
Member

Posts: 166
Threads: 47
Joined: Feb 2013
Reputation: 1
#1
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.)
05-24-2014, 09:19 PM
Find


Messages In This Thread
How to replace entities? - by GoreGrinder99 - 05-24-2014, 09:19 PM
RE: How to replace entities? - by Mudbill - 05-24-2014, 11:08 PM
RE: How to replace entities? - by GoreGrinder99 - 05-24-2014, 11:36 PM



Users browsing this thread: 1 Guest(s)