| 
		
	
		| Statyk   Schrödinger's Mod
 
 Posts: 4,390
 Threads: 72
 Joined: Sep 2011
 Reputation: 
241
 | 
			| 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 |  |  
	
		| Unearthlybrutal   Posting Freak
 
 Posts: 775
 Threads: 12
 Joined: May 2011
 Reputation: 
26
 | 
			| RE: Global function not working quite right 
 
				As far as I know, doors cannot be deactivated
			 
 |  |  
	| 12-23-2011, 07:29 PM |  |  
	
		| Statyk   Schrödinger's Mod
 
 Posts: 4,390
 Threads: 72
 Joined: Sep 2011
 Reputation: 
241
 | 
			| RE: Global function not working quite right 
 
				 (12-23-2011, 07:29 PM)Unearthlybrutal Wrote:  As far as I know, doors cannot be deactivated Of course they can. It's a swing door. If the door is disappearing on certain integers but NOT disappearing on others... It can be set inactive. 
 
I also set it inactive in Sciophobia, so that's not the issue.
			 
				
(This post was last modified: 12-23-2011, 07:33 PM by Statyk.)
 |  |  
	| 12-23-2011, 07:33 PM |  |  
	
		| Unearthlybrutal   Posting Freak
 
 Posts: 775
 Threads: 12
 Joined: May 2011
 Reputation: 
26
 | 
			| RE: Global function not working quite right 
 
				 (12-23-2011, 07:33 PM)Statyk Wrote:   (12-23-2011, 07:29 PM)Unearthlybrutal Wrote:  As far as I know, doors cannot be deactivatedOf course they can. It's a swing door. If the door is disappearing on certain integers but NOT disappearing on others... It can be set inactive. 
 I also set it inactive in Sciophobia, so that's not the issue.
 I've tried a couple of times to set the door active and inactive with scripts and always failed, then I gave up.  
I tried it with mansion doors, I don't know if it works with other doors    
 |  |  
	| 12-23-2011, 08:20 PM |  |  
	
		| Your Computer   SCAN ME!
 
 Posts: 3,456
 Threads: 32
 Joined: Jul 2011
 Reputation: 
235
 | 
			| RE: Global function works now! MUAHAHAHAHAHAHAHAAAAA XD 
 
				 (12-23-2011, 07:04 PM)Statyk Wrote:  - When it is set to "2", the door is there, but when given the command "AddGlobalVarInt("openlivingdoor", 1);", it does not disappear...According to what little code you posted, at that point openlivingdoor would equal 3. So it is working as should be expected. Or am i not understanding your statement here? If you meant something else, then i would like a bigger traceback from your code; that is, showing a function that is obviously for a collision callback yet not informing us when that callback gets called is a way of leaving us in the dark. Likewise, if that AddGlobalVarInt from the collision callback is within conditional statements. 
Edit: A change in title, but no other information about the issue being solved?
			 
 
				
(This post was last modified: 12-23-2011, 09:42 PM by Your Computer.)
 |  |  
	| 12-23-2011, 09:41 PM |  |  
	
		| Statyk   Schrödinger's Mod
 
 Posts: 4,390
 Threads: 72
 Joined: Sep 2011
 Reputation: 
241
 | 
			| RE: Global function works now! MUAHAHAHAHAHAHAHAAAAA XD 
 
				I figured the title basically says it was fixed =\
 But no, I changed the "SetGlobalVarInt" to 0 and it works fine. =]
 |  |  
	| 12-23-2011, 10:16 PM |  |  |