View previous topic :: View next topic |
Author |
Message |
ajcross Very Active User
Joined: 23 Dec 2003 Posts: 113 Location: Kansas City
|
Posted: Thu Apr 08, 2004 1:19 pm Post subject: How to use "Set Persistent Variable text to text"? |
|
|
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 |
|
|
darrinm Established Forum User
Joined: 15 Aug 2003 Posts: 90 Location: Seattle
|
Posted: Fri Apr 16, 2004 11:37 am Post subject: Persistant Variables |
|
|
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 |
|
|
ajcross Very Active User
Joined: 23 Dec 2003 Posts: 113 Location: Kansas City
|
Posted: Mon Apr 19, 2004 9:09 am Post subject: Re: Persistant Variables |
|
|
[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 |
|
|
crakerz Mega-Poster
Joined: 17 Sep 2003 Posts: 353 Location: California Bay Area
|
Posted: Tue Apr 27, 2004 8:47 pm Post subject: |
|
|
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 |
|
|
LawrenceA Administrator
Joined: 15 Feb 2010 Posts: 1135 Location: New Zealand
|
Posted: Sat Dec 18, 2010 10:06 pm Post subject: Re: Persistant Variables |
|
|
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 |
|
|
|