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 / Couldn't understand RPG mod variable system

Author
Message
Mr illusionest
15
Years of Service
User Offline
Joined: 5th Mar 2009
Location: Cairo , Egypt
Posted: 6th Aug 2010 21:30 Edited at: 6th Aug 2010 21:31
I feal bad on writing this thread , but I really couldn't understand
how RPG mod variables works , the points that I didn't understand are:
1- There is a rpg_createvar=x condition , and there is rpg_newvar=x action , what's the difference between them , and which 1 should I use to make a new variable ?
2- The rpg_varisequalto=x x , When I write the var name I write it that way : &varname or I just right the var name ? ( same with another vars conditions ) .
3- there are 2 rpg_initvar=x x commands , one is a condition and the other is an action , why is that ? and which 1 to use ?

Cheers .

"I am the night visitor when everyone is sleep , and when the last light fades"
The illusionest
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 7th Aug 2010 01:17 Edited at: 7th Aug 2010 01:18
I think it is just an illusion!

No seriously, I will get back to you on this. Sorry I didn't see this thread sooner. And don't feel bad about posting. I'm not perfect and I have to say that even though the manual is pretty thorough it is not without flaw. Also if you are seeing this in FPI EditPad I have to say that it is not completely accurate yet. I will be getting to updating the defs as soon as I can

Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 7th Aug 2010 01:36
First of all, the confusion between condition and actions are because of the fact you can define and initialize a variable within the RPG Mod definition setup file (rpg_setup.fpi - which is totally separate from the conditions and action commands that are used in-game.

Snippet shows a partial listing of the setup file that includes creating and initializing variables.



This will add two variables.

1. varsellist
2. varitemnum

They are called conditions because they need to be consistent in someway with how a script works. A script requires both a condition and an action on one line. The action is "none".

Now each variable is assigned a value in the following line:

:rpg_initvar=varsellist 1-varitemnum 2:none

Variable varsellist is set to a value of "1" and variable varitemnum is set to a value of "2".

These variables and values are set at the very beginning of loading the level.

Questions? Let me know one way or the other and I will then continue.

BTW, I have no idea what varsellist is a variable for so don't ask.

Also, don't ask why I set it up this way. It could probably be better but there is no way I'm going to change it now. :LOL:

Mr illusionest
15
Years of Service
User Offline
Joined: 5th Mar 2009
Location: Cairo , Egypt
Posted: 7th Aug 2010 01:59
Thanks so much for responding Flatlander , and yes , I have another questions :
Inthe rpg_varisequalto=x x , I have a var ( named varsellist for example ) , How to write the var name on the condition ? this way : rpg_varisequalto=&varsellist &varitemnum
or this way : rpg_varisequalto=varsellist varitemnum ?

Thanks again , Cheers

"I am the night visitor when everyone is sleep , and when the last light fades"
The illusionest
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 7th Aug 2010 02:17 Edited at: 7th Aug 2010 02:18
I have doc help in code snippet just so we have a reference point. BTW, I get confused at times with this as well.



Using your example it would be written:

rpg_varisequalto=&varsellist &varitemnum

or

rpg_varisequalto=&varsellist 2

This of course would return false because varselllist contains the value 1.

If a variable contains a string such as "sunburst" then you have to use a variable name you cannot use the literal even with quotes. So the comparison would be with a variable name that contains the string value.

Now, if you are wanting to create a new variable in-game (using a main AI script), then it will be an action.

rpg_newvar=mynewvar

You can then use rpg_initvar to initalize the variable or the five other variable actions to change a variable value.

1. rpg_addvar, 2. rpg_subvar, 3. rpg_mult, 4. rpg_divvar, and 5. rpg_modvar.

I hope this helps.

Mr illusionest
15
Years of Service
User Offline
Joined: 5th Mar 2009
Location: Cairo , Egypt
Posted: 7th Aug 2010 12:23
Well , I really appreciate your responding Flatlander , And thank you so much , Your posts have Made things very clear .
I'm woking now on The 3rd Multi Person Script for Fenix mod , I might send you an E-mail to help me on it , cause I'm really stuck .

Thnaks again , Cheers .

"I am the night visitor when everyone is sleep , and when the last light fades"
The illusionest
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 7th Aug 2010 20:29
I'm sorry illusionist but I don't actually know anything about Fenix Mod. If you are working with RPG Mod within Fenix and you run into problems other than help on actual commands (it is possibly buggy within Fenix Mod), then I won't be able to help because I no longer am supporting RPG Mod within Fenix.

In other words if a command doesn't seem to be working properly I can't be of any help.

Mr illusionest
15
Years of Service
User Offline
Joined: 5th Mar 2009
Location: Cairo , Egypt
Posted: 7th Aug 2010 22:01
I've guessed something like that Flatlander , The help I want from you is tto check my var system in the script , see I fit have any mistakes , that's all .
But on Fenix mod itself , It's working well , the problem came because I couldn't make my script depend on The variables system , that made it really awful and have alot of weakpoints and bugs .

Thanks for responding , Cheers .

"I am the night visitor when everyone is sleep , and when the last light fades"
The illusionest
sberk
14
Years of Service
User Offline
Joined: 6th Jun 2010
Location: next to a cup of coffee
Posted: 2nd Sep 2010 11:08
Flatlander, could you please add your answer to the RPG-Mod-Manual. I had lots of trouble understanding your variable system, but this answer was really helpful. I think other newbies probably have the same problems.
cheers

PS: Thank you, for the rpg mod system
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 2nd Sep 2010 16:41
I meant to revise the How-To for variables and forgot. If the explanation here makes sense then will use this. Thanks for bringing this to our attention.

I reject your reality and substitute my own!

Add more adventure to your game -- use RPG Mod

Login to post a reply

Server time is: 2024-11-24 19:50:57
Your offset time is: 2024-11-24 19:50:57