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
keep monster from despawining
Vale Offline
Member

Posts: 92
Threads: 13
Joined: Mar 2014
Reputation: 7
#2
RE: keep monster from despawining

just an idea. Im no expert in scripting, but when the map loads you could have it check a variable whether the monster is active or not. Just have the variable changed when the monster should spawn or despawn. Use a global variable.
Do you need a code example?

void 0nStart() //the first time the area ever loads
{
SetGlobalVarString("Monster", inactive); //sets a string variable that says the variable monster is inactive. works across all maps so each one may need "Monster" to be replaced with "Monster2", etc
}
void OnEnter() //runs whenever player enters map
{
if(GetGlobalVarString("Monster") == active) //checks when player enters that variable "Monster" is equal to active
{
SetEntityActive("monstername", true);//sets your monster active if previous statement true
}
}

when you first activate your monster, include
SetGlobalVarString("monster_variablename", active);

that code is a mess, and you may need to go over it a couple times. Everything is documented, and it should work. Hope this helps.
(This post was last modified: 04-14-2014, 03:19 AM by Vale.)
04-14-2014, 03:10 AM
Find


Messages In This Thread
keep monster from despawining - by lothabread - 04-14-2014, 02:42 AM
RE: keep monster from despawining - by Vale - 04-14-2014, 03:10 AM
RE: keep monster from despawining - by lothabread - 04-14-2014, 03:16 AM
RE: keep monster from despawining - by Vale - 04-14-2014, 03:24 AM
RE: keep monster from despawining - by lothabread - 04-14-2014, 03:30 AM
RE: keep monster from despawining - by Vale - 04-14-2014, 03:35 AM
RE: keep monster from despawining - by lothabread - 04-14-2014, 04:28 AM
RE: keep monster from despawining - by Vale - 04-14-2014, 04:31 AM
RE: keep monster from despawining - by lothabread - 04-14-2014, 05:23 AM
RE: keep monster from despawining - by Romulator - 04-14-2014, 05:45 AM
RE: keep monster from despawining - by lothabread - 04-14-2014, 05:43 PM



Users browsing this thread: 1 Guest(s)