Script structure confuse me

Topics regarding Scripting with Reality Factory
Post Reply
santipi
Posts: 6
Joined: Sat Jul 30, 2011 8:22 pm

Script structure confuse me

Post by santipi » Sat Jul 30, 2011 8:36 pm

Good day,afternoon,night fellows :P ,see my after 2 weeks studing scripts i got stuck with a problem:
-if i flollow the manual scripting look like this:

Code: Select all

{
    Spawn[()
    {
        SetFOV(xxx);
...
but if i follow the web/scriptsamples of rf looks like this:

Code: Select all

{
    FOV[xxx]
    Spawn[()
    {
        SetFOV(FOV);
...
so my question is,Is the manual outdated or the 2 ways work exacly the same just writed diferent?
:?

User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Re: Script structure confuse me

Post by QuestOfDreams » Sat Jul 30, 2011 10:54 pm

These two versions are equivalent. The first one is specifying the float value directly in the method call. The second one declares a variable named FOV that holds this very value and is then used in the method call.

santipi
Posts: 6
Joined: Sat Jul 30, 2011 8:22 pm

Re: Script structure confuse me

Post by santipi » Sun Jul 31, 2011 12:24 pm

pheww,i really apreciate the answer,that problem was eating me allready thanks a lot :)

User avatar
Nighthawk_0973
Posts: 234
Joined: Tue Apr 19, 2011 2:08 am
Location: In front of my computer.

Re: Script structure confuse me

Post by Nighthawk_0973 » Tue Aug 02, 2011 6:49 pm

And if anybody doesn't understand what he said (for some reason) here's a more descriptive version:
(I don't know if the double slash indicates a comment in RF scripting but who cares it's just my way of pointing out specific lines in the middle of the code)

Code: Select all

{
    Spawn[() //starts the spawn command
    {
        SetFOV(xxx); //sets the FOV to 'XXX'
...
simple right? Well let's take a look at the other one

Code: Select all

{
    FOV[xxx] //creates a variable called 'FOV' with the value of 'XXX'
    Spawn[() //starts the spawn command
    {
        SetFOV(FOV); //sets the FOV to the value of the variable 'FOV'
...
Therefore it's the same effect, but changing the code is easier because you can go and change the variables value, which variables are typically at the top of the code, and the FOV of the pawn will change, but you don't have to go digging through the code too much.

Sorry if that seemed a bit rediculous (how I answered a question that had already been answered and person who needed help understood it just fine) I just have a habbit of explaining things in higher detail if they aren't already, provided I understand whats going on of course...
https://sites.google.com/site/theneverendinguniverse/ <-- Infinite Universe Website. It's a 2D MMORPG I'm releasing into beta near the late summer (I hope :D) note: RF isn't an MMO maker. Not yet anyways.

Post Reply