Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-12-2011, 07:47 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
level classes saving?

I have a class which is joined by a level NPC (not putnpc2) which is a door. I've added a feature where you can lock and unlock your house door. However, it's not saving this flag, it's as though it's resetting after some time.

Putnpc2 saves these flags and only change them when necessary- but level joined npcs revert to the origional code if someone enters and it hasn't been entered in a while (onCreated is called again)

Is there any way to store this flag without it being wiped? I was thinking of making it a level variable, but wouldn't that just do the same thing? (clear it after someone enters after it's been empty for some time)

thanks
__________________
Reply With Quote
  #2  
Old 08-12-2011, 08:10 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
When a level is inactive for 10 or so minutes the npc is wiped from memory then when a player enters the level everything is re-created again.

As long as this.savelocally = true; Your npc should be saving that value permanently. (On iOS: the furniture class does it, so unless you're making a door that doesn't join/inherit that you'll need to set it.)

So if you're setting this.unlocked to true in your onCreated function that's probably why it doesn't appear to be saving for you.
__________________
Quote:
Reply With Quote
  #3  
Old 08-12-2011, 08:20 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Interesting.

That wouldn't effect the rest of the script would it? What does
HTML Code:
this.savelocally = true;
do exactly?

Oh by the way, it's not furniture. It's actually the door to lead into a house

thanks
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:28 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.