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 / Variables, and how to use them?

Author
Message
Inspire
17
Years of Service
User Offline
Joined: 23rd Dec 2006
Location: Rochester, NY
Posted: 12th Sep 2011 04:51 Edited at: 12th Sep 2011 09:52
I have a decent knowledge of Basic, and can program in most web languages, so it's not like I'm incompetent in the realm of programming. Let me just put that out there.

I am having issues with the variable system. I don't know what variable commands are actually in v.1.18, considering the Complete Syntax List sticky and the addendum.rtf file in my FPSC folder are telling me to different things. It looks to me that the Complete Syntax List shows the Project Blue variable commands, whereas the addendum still shows the old variable commands that Lee originally implemented.

I've heard around that with 1.18, Lee added the Project Blue variable system. With the gross lack of documentation on how to do anything with FPI's, as well as the difficult change list that they offer with the download, I'm entirely confused as to the syntax required to use user variables with my scripts.

Can anybody help me figure out how to use custom variables in v.1.18?

For example, could somebody help me with the following:

Declaring two global test variables, as well as some debugging text for each, ideally in my setuplevel.fpi file.

Also, are strings implented in v.1.18? The documentation for this is so God awful.

EDIT: Figured out variables for the most part, see post below:

Inspire
17
Years of Service
User Offline
Joined: 23rd Dec 2006
Location: Rochester, NY
Posted: 12th Sep 2011 09:51
Okay, so I finally got that debugging stuff working. Now I have a new problem.

I have tested my scripts multiple times, and it seems as if "varless=X" is testing if the variable is less than or equal to the number.

I simply added the following to my setuplevel.fpi (this is the abridged version, the full one also displays the value of this variable):



AND I DIE. Last time I checked, 5 is not less than 5.

maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 12th Sep 2011 13:25
2+2=5, watch/read orwells 1984^^

are you a .... free mind trying to ...think ..on his own?? bad, really bad. BURN HIM!


same with vargreater=-condition.
Ched80
14
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 12th Sep 2011 15:03
That sounds liek a bug to me - the source definately shows that varless/greater is true when the variable is less/greater than and NOT equal to.

There may be some weird rounding effect by not stating a float value during setvar. Try setvar=money 5.0 instead of setvar=money 5

Just a thought.

PS: the syntax list is up-to-date. the PB variable commands are in v118. I do have an update nearly ready which will include gunspec and flakspec commands.

PPS sorry for hi-jacking your thread.

Inspire
17
Years of Service
User Offline
Joined: 23rd Dec 2006
Location: Rochester, NY
Posted: 13th Sep 2011 00:10
I just tried that, it still doesn't work. Is the entire variable system broken? I literally only changed that part of the entire setuplevel.fpi.

Inspire
17
Years of Service
User Offline
Joined: 23rd Dec 2006
Location: Rochester, NY
Posted: 13th Sep 2011 04:04
Can somebody add this code to their setuplevel.fpi and tell me if it really is a glitch in the software?



Of course, put the states in the correct spots. I know that's not the problem.

Inspire
17
Years of Service
User Offline
Joined: 23rd Dec 2006
Location: Rochester, NY
Posted: 16th Sep 2011 08:52
For the epic triple post, I'd like to add that I'm back where I started, not being able to get that huduservar thing. I've even copied and pasted scripts Ched80 and some other guys have posted on here and it doesn't work. I legitimately had it working, and I come back to my FPSC today, and the setuplevel.fpi script has reset back to default, for no apparent reason.

Inspire
17
Years of Service
User Offline
Joined: 23rd Dec 2006
Location: Rochester, NY
Posted: 21st Sep 2011 22:31 Edited at: 21st Sep 2011 22:35
Problem solved, I had one too many colons.

xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 22nd Sep 2011 02:34
Not only has he double, triple and quadruple posted in this thread, but he has personally authored 6 of 8 posts. It is with great pleasure that I present the the first and highly coveted, Annual Quadruple Post Award, to our very own Inspire. Congratulations on your well deserved win and new title.



Sorry, I don't know much about variables.

Brian.

Inspire
17
Years of Service
User Offline
Joined: 23rd Dec 2006
Location: Rochester, NY
Posted: 22nd Sep 2011 08:23
It's an honor, really. I'd like to thank the fans, my producer, and my mom and dad for being there every step of the way.

But really, I'm a 3D artist, not a script guy.

French gui
20
Years of Service
User Offline
Joined: 11th May 2004
Location: France
Posted: 23rd Sep 2011 21:04
Quote: "if conda > aiconditionseq(seq).valueb then airesult=0"


From fpsc source it looks like VARLESS is returning true if the variable is less or equal. ( conda is your variable value and aiconditionseq(seq).valueb is the value you want to compare to. airesult is the...result 0 or 1)
TheDesertEagle
13
Years of Service
User Offline
Joined: 7th Jul 2011
Location: Canada - Who knows where else???
Posted: 24th Sep 2011 04:20
Whoa,Yay! you won a award.....a weird one too........

Joey-May god have mercy upon my enemies, because I won't.
Favourite Game-Call Of Duty MW2

Login to post a reply

Server time is: 2024-11-24 04:26:14
Your offset time is: 2024-11-24 04:26:14