View previous topic :: View next topic |
Author |
Message |
ajcross Very Active User
Joined: 23 Dec 2003 Posts: 113 Location: Kansas City
|
Posted: Fri May 07, 2004 1:35 pm Post subject: How to remove Persistent Variables? |
|
|
How are persistent variables deleted from memory?
Is it done by setting these to "-1" or the empty string ""? _________________ Andy Cross |
|
Back to top |
|
|
crakerz Mega-Poster
Joined: 17 Sep 2003 Posts: 353 Location: California Bay Area
|
Posted: Fri May 07, 2004 2:04 pm Post subject: |
|
|
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 |
|
|
ajcross Very Active User
Joined: 23 Dec 2003 Posts: 113 Location: Kansas City
|
Posted: Fri May 07, 2004 2:57 pm Post subject: |
|
|
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 |
|
|
crakerz Mega-Poster
Joined: 17 Sep 2003 Posts: 353 Location: California Bay Area
|
Posted: Fri May 07, 2004 5:30 pm Post subject: |
|
|
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 |
|
|
PhillipEarl Mega-Poster
Joined: 12 Jan 2004 Posts: 329 Location: Charlotte, NC
|
Posted: Sat May 08, 2004 6:06 am Post subject: |
|
|
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 |
|
|
scottlu WI Founder
Joined: 15 Aug 2003 Posts: 1773
|
Posted: Sat May 08, 2004 5:47 pm Post subject: |
|
|
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 |
|
|
|