Warfare Incorporated :: View topic - How to use "Set Persistent Variable text to text"?
Warfare Incorporated Forum Index
 FAQ   Search   Memberlist   Usergroups 
 Profile   Log in to check your private messages   Log in 
 
How to use "Set Persistent Variable text to text"?

 
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: Thu Apr 08, 2004 1:19 pm    Post subject: How to use "Set Persistent Variable text to text"? Reply with quote

This appears to set a variable with a string.

Is there any way to use the string?

Can I use the string for 'text' in any of these?
Cut Scene, ECOM, Jump to Mission, Set Formal Objective, Set Next Mission, Set Mission Objective, Show Alert, or Start Countdown

If this is varA := varB, then
Could quantities be set between variables for these?
Side's Credits, Modify Persistent Variable, Start Countdown Timer, or Wait
Back to top
View user's profile Send private message
darrinm
Established Forum User


Joined: 15 Aug 2003
Posts: 90
Location: Seattle

PostPosted: Fri Apr 16, 2004 11:37 am    Post subject: Persistant Variables Reply with quote

Yes, you can have pvar strings substituted into Ecoms, objectives, formal mission objectives, alerts, countdown timer, etc. Pretty much everywhere you can set text to be displayed.

Use like this:

set persistant variable 'whatever' to "my happy string"
set side1's mission objective to "substitute {whatever} here"

It does NOT work to set a pvar to another pvar, thus the following won't work:
set persistant variable 'whatever2' to "{whatever}"

Also you cannot pass pvars to actions/conditions that don't accept strings (e.g., credits, wait). That would be cool.

Note, a bug in WI versions <= 1.1 makes it so the 'set' variation of "Modify Persistant Variable" does nothing. E.g.,

modify persistant variable 'whatever': Set 10

is ignored! An equivalent workaround would be:

set persistant variable 'whatever' to "10"

_________________
Spiffcode, Inc
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: Mon Apr 19, 2004 9:09 am    Post subject: Re: Persistant Variables Reply with quote

[quote="darrinm"]set persistant variable 'whatever' to "my happy string"
set side1's mission objective to "substitute {whatever} here"[/quote]

Cool! Now I can debug and use less Triggers to do my messages.

[quote="darrinm"]It does NOT work to set a pvar to another pvar, thus the following won't work:
set persistant variable 'whatever2' to "{whatever}""

Also you cannot pass pvars to actions/conditions that don't accept strings (e.g., credits, wait). That would be cool.[/quote]

Setting Persistent Variables to other variables or Setting other variables with Persistent Variables would be cool.

Is there any way to set persistent variables with program variables like Credits, # of Unit Types on Side X, Mission Time, Countdown Timer? I am trying to setup some triggers to modify the next mission with past mission success.

[quote="darrinm"]Note, a bug in WI versions <= 1.1 makes it so the 'set' variation of "Modify Persistant Variable" does nothing. E.g.,

modify persistant variable 'whatever': Set 10

is ignored! An equivalent workaround would be:

set persistant variable 'whatever' to "10"[/quote]

"Modify Persistant Variable" does something. I had to use it to reset some variables at mission load. I'll have to try this to see if it clears up one of my bugs.

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: Tue Apr 27, 2004 8:47 pm    Post subject: Reply with quote

pvars you create stay alive from one mission to the next. I have created pvars that pass values from one to the next, but I think the built-in ones are automatically reset.
_________________
Why negotiate when you can just blow things up?
------------------------------------------------------
Back to top
View user's profile Send private message Send e-mail
LawrenceA
Administrator


Joined: 15 Feb 2010
Posts: 1135
Location: New Zealand

PostPosted: Sat Dec 18, 2010 10:06 pm    Post subject: Re: Persistant Variables Reply with quote

darrinm wrote:

It does NOT work to set a pvar to another pvar, thus the following won't work:
set persistant variable 'whatever2' to "{whatever}"

does anyone know if its possible to do the opposite of this and set the pvar name to that of a value of another pvar?
for example
set pvar 'hello' to "1"
set pvar {hello} to "a"
doing this could simplify a lot of things

_________________
You've just been
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