Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Trying to drill down on 2 varaibles to eliminate one if the other is active

Author
Message
Meows
7
Years of Service
User Offline
Joined: 12th Oct 2011
Location: Totally over the Rainbow
Posted: 31st Jul 2014 02:35 Edited at: 31st Jul 2014 02:43
There are 2 quests. both for armour.
Quest one is good Armour =armourwon
Quest two is better Armour = GOLD

I am trying to get this script to only activate the Highest Armour.
If they only succeed to get the good Armour then give them that and forget the Gold. but if they have won BOTH then only give the GOLD Armour.



I separated these because it crashed trying to give BOTH armors to theplayer
:state=1,varequal=Gold 1:state=5
:state=1,varequal=armourwon 1:state=35

I added this
:state=35,varequal=Gold 1:state=5
hoping that if they had the gold Armour
the script would stop and not continue
to this next line
:state=35:makesvar=armour IDOL

needed a IF gold = 1 Then

BlackFox
FPSC Master
11
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 31st Jul 2014 17:47
While I do not use the makesvar=x y z command, it does say the following in the script syntax...



I believe the reason it stops is because you have the line...



... which is invalid based on the syntax. X is the variable name (armour), y is the default value (I believe this is numeric), z is the "setup.ini" name (IDOLComplete). I don't use this, so I do not know if you just have to have a line that says "IDOLComplete" after everything else or not, but it does have to reside in the INI file.

There's no problem that can't be solved without applying a little scripting.
Meows
7
Years of Service
User Offline
Joined: 12th Oct 2011
Location: Totally over the Rainbow
Posted: 31st Jul 2014 22:32 Edited at: 31st Jul 2014 22:39
FPSC 1.20.018

BlackFox, I was praying you would take a look.
right now BOTH armors activate.
Quote: "While I do not use the makesvar=x y z command, it does say the following in the script syntax"

Now the reason I put makesvar the way I did is that the only makesvar=x y z command that works is.


And it kinda works backwards from the code file.
LevelsCompleted is put in the setup.ini file with a value of 9

I also found that only the LAST makesvar/savesvars
in a 5 level built test is actually saved in the Setup.ini.

I would build a 5 level test with



in each level. with the varaible 1 in level one 2 in level 2 and so on. exiting the game at each level shows only the current variable, no matter if you played 3 levels and exit only the last level's LevelsCompleted=3 would be in the setup.ini

In summary only
works.

The newest test.
Trigger1=armourwon.fpi


Trigger2=goldwon.fpi


Trigger3=armourTEST_1.fpi


Trigger4=ArmourRregen1pts.fpi



Trigger5=ArmourRregen2pts.fpi


I put Trigger1 and Trigger2
in first level

Second level I put
Trigger3=armourTEST_1.fpi
Trigger4=ArmourRregen1pts.fpi
Trigger5=ArmourRregen2pts.fpi

Third level I put Hurt zone and win zone.
bringing armour hit points down shows both
Trigger4=ArmourRregen1pts.fpi
Trigger5=ArmourRregen2pts.fpi
are active.

My brain is fried.. Right now the only solution is to make 3 copies of each remaining level..
1st copy no armour
2nd copy armour regen of 1
3rd copy armour regen of 2

Lastly. I see I can still use the
:state=0:makesvar=LevelsCompleted 33 LComplete,state=1
:state=1:savesvars,state=3
if they win the Gold and levelcomplete 32 if they win the first quest.

I was in hopes of using internal code as I use a outside program to control the game as each series of levels are completed but as savesvars and makesvar do work for one variable per set of levels i really needed to do this internally.

Thanks for looking.. if you know of a way to test 2 variables and only use ONE, please advise me.

Meows
7
Years of Service
User Offline
Joined: 12th Oct 2011
Location: Totally over the Rainbow
Posted: 1st Aug 2014 17:56
We have a winner "kinda"
Failing Miserably at FPI scripting,. I went to something I am marginally better at.
to gift Armour to a quest that was won.

But as usual for me there is a hitch in the saddle still.
Here is the story,.

This is a section of my game wrapper. that assigns the right Armour per quest.




Now the first two tests work great, however if you missed both quests or failed both quests the program defaults to the last qualifer.
And I just found my error.. Don't ya just love it when you are asking for help and you go back through the code and see what you missed? I missed
in the second qualifier..

Without that every time I removed the ini files it would default to test 3 but they still had armour.. I even added a trigger with
at the start point and they had armour. but no longer..

Thanks for the ride.. it was fun and I kinda learned something,, yet again.
Thanks for listening

Login to post a reply

Server time is: 2019-09-19 02:05:09
Your offset time is: 2019-09-19 02:05:09