Warfare Incorporated :: View topic - How to remove Persistent Variables?
Warfare Incorporated Forum Index
 FAQ   Search   Memberlist   Usergroups 
 Profile   Log in to check your private messages   Log in 
 
How to remove Persistent Variables?

 
Post new topic   Reply to topic    Warfare Incorporated Forum Index -> Mission Authoring
View previous topic :: View next topic  
Author Message
ajcross
Very Active User


Joined: 23 Dec 2003
Posts: 113
Location: Kansas City

PostPosted: Fri May 07, 2004 1:35 pm    Post subject: How to remove Persistent Variables? Reply with quote

How are persistent variables deleted from memory?

Is it done by setting these to "-1" or the empty string ""?

_________________
Andy Cross
Back to top
View user's profile Send private message
crakerz
Mega-Poster


Joined: 17 Sep 2003
Posts: 353
Location: California Bay Area

PostPosted: Fri May 07, 2004 2:04 pm    Post subject: Reply with quote

I know you can set pvars to negative values, so the "-1" wouldn't work, and you can set them to a null string, so "" won't work. Actually, once they are created, I believe they are there to stay, until you exit the game.

Why would you want to?

_________________
Why negotiate when you can just blow things up?
------------------------------------------------------
Back to top
View user's profile Send private message Send e-mail
ajcross
Very Active User


Joined: 23 Dec 2003
Posts: 113
Location: Kansas City

PostPosted: Fri May 07, 2004 2:57 pm    Post subject: Reply with quote

I thought that they were getting saved when the game was saved. I don't want to accidentally overflow that area.

I also want some variables to reset between missions.

_________________
Andy Cross
Back to top
View user's profile Send private message
crakerz
Mega-Poster


Joined: 17 Sep 2003
Posts: 353
Location: California Bay Area

PostPosted: Fri May 07, 2004 5:30 pm    Post subject: Reply with quote

You need to reset them yourself. When a pvar is modified for the first time, it is "declared" and given a value of zero before the add/subtract. If you use the set pvar text to text action, then it is given that value.

I always "declare" my pvars at the beginning of a mission, esp. to avoid the ?pvar? error. If you want to use pvars between levels, and don't want values carried over, then set them at the start.

_________________
Why negotiate when you can just blow things up?
------------------------------------------------------
Back to top
View user's profile Send private message Send e-mail
PhillipEarl
Mega-Poster


Joined: 12 Jan 2004
Posts: 329
Location: Charlotte, NC

PostPosted: Sat May 08, 2004 6:06 am    Post subject: Reply with quote

ajcross wrote:
I thought that they were getting saved when the game was saved.


So if I were using pvars to, say, keep track of how many Rocket Troopers the player owns, and the player saves the game and exits the mission, will the pvar be preserved when the player reloads the mission?
Back to top
View user's profile Send private message
scottlu
WI Founder


Joined: 15 Aug 2003
Posts: 1773

PostPosted: Sat May 08, 2004 5:47 pm    Post subject: Reply with quote

PhillipEarl wrote:
ajcross wrote:
I thought that they were getting saved when the game was saved.


So if I were using pvars to, say, keep track of how many Rocket Troopers the player owns, and the player saves the game and exits the mission, will the pvar be preserved when the player reloads the mission?


Yes it will.

_________________
Warfare Incorporated Development Team
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Warfare Incorporated Forum Index -> Mission Authoring All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2002 phpBB Group