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
Global function works now! No more help necessary!
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#1
Global function works now! No more help necessary!

**
THE ISSUE IS FIXED, BUT IF YOU WOULD LIKE TO SEE HOW IT WAS FIXED, IT IS IN MY LAST RESPONSE.
**



So I'm trying a simple little global function, where a player walks into an area in one map, and it opens (removes) a door in another. The games runs, so there are no typo errors, only problem is, the door does not get removed. Yet, when I set the "SetGlobalVarInt" to 1, the door is permanently missing >> I feel so close to getting this working, yet it's not. I feel I need the if function in a separate command function... Could someone help me out here?
_____________________________________________________


global.hps
___________________

void OnGameStart()
{
SetGlobalVarInt("openlivingdoor", 1);

}



map1.hps
___________________

void OnEnter()
{
GetGlobalVarInt("openlivingdoor");
{
if(GetGlobalVarInt("openlivingdoor") == 1)
{
SetEntityActive("mansion_5", false);
}
if(GetGlobalVarInt("openlivingdoor") == 0)
{

}
}
}


map2.hps
_______________


void "hiddenname"_func(string &in asParent, string &in asChild, int alState)
{
AddGlobalVarInt("openlivingdoor", 1);
}

____________________________________________________

I hid the name of the last function because it could contain spoilers. But believe me that it is typed correctly. It is also the working function name for a script area collision with the player.

Some other details:

- The SetGlobalVarInt, when set to "1", the door remains open forever (door is set inactive)
- When it is set to "2", the door is there, but when given the command "AddGlobalVarInt("openlivingdoor", 1);", it does not disappear...
(This post was last modified: 12-23-2011, 10:28 PM by Statyk.)
12-23-2011, 07:04 PM
Find


Messages In This Thread
Global function works now! No more help necessary! - by Statyk - 12-23-2011, 07:04 PM



Users browsing this thread: 1 Guest(s)