Script calls and in game variables

Discussion in 'RGSSx Script Support' started by Arcandrus, Jan 22, 2016.

Thread Status:
Not open for further replies.
  1. Arcandrus

    Arcandrus Villager Member

    Messages:
    11
    Likes Received:
    0
    First Language:
    English
    Hey guys, new to the forum so not sure if I'm posting in the right place but here goes.


    Pretty new to RPG Maker, but I do some knowledge of other languages... heres my question:


    I'm using Vlues Basic Quest Control system, and within it he has set a script call for "set_obj:)questid, :objid, value)" which sets the designated objective to desired value.


    Is there anyway to call the value of a global variable, and have the script set that as the objectives value?


    I tried something like this:


    set_obj:)questid001, :objid1, $game_variables[0001])


    but it returns errors I dont understand currently, still learning Ruby :)  But almost 100% sure I've stumbled into a syntax issue


    Any help trying to resolve this would be lovely :)  
     
    #1
  2. Andar

    Andar Veteran Veteran

    Messages:
    27,961
    Likes Received:
    6,313
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    do not use zeroes in scripted IDs - that is one mistake ([1], not[0001])


    Additionally it might be that the function requires direct values - that depends on the script and I don't know what to do then.
     
    #2
  3. Shaz

    Shaz Veteran Veteran

    Messages:
    37,184
    Likes Received:
    11,053
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.


    Please post a link to the script so people can find it quickly without having to search around.  (that does not mean posting the script itself into your topic)
     
    #3
  4. Arcandrus

    Arcandrus Villager Member

    Messages:
    11
    Likes Received:
    0
    First Language:
    English
    Apologies, as I said I am new here, I'll be more careful about where I post in future.


    Here is a link to Vlues pastebin where the script I'm using is  http://pastebin.com/tyM7s1Pj
     
    #4
  5. Arcandrus

    Arcandrus Villager Member

    Messages:
    11
    Likes Received:
    0
    First Language:
    English


    Thank you Andar, that is something I didn't realize, I will test this and get back to you :)  
     
    #5
  6. Arcandrus

    Arcandrus Villager Member

    Messages:
    11
    Likes Received:
    0
    First Language:
    English
    ok so I realize now that theres was very little information in my first post, sorry


    Any ways I have now attached a snap of the error itself and one of the event I'm working on


    My goal is to have obj1 value be equal to that of variable 1 (Slimey Slimes)


    Thanks again guys :)


    erroc.png


    error.png
     
    Last edited by a moderator: Jan 22, 2016
    #6
  7. Shaz

    Shaz Veteran Veteran

    Messages:
    37,184
    Likes Received:
    11,053
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Arcandrus, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


    If you need to add to, or change, information, and yours is the last post in the thread, please just edit it rather than making a new post.
     
    #7
  8. Sixth

    Sixth Veteran Veteran

    Messages:
    2,121
    Likes Received:
    788
    First Language:
    Hungarian
    Primarily Uses:
    RMVXA
    There are multiple issues in your script calls.


    Number 1:


    It is not "$game.variables" but "$game_variables". So, not a point between the words, but an underline.


    Number 2:


    This is which gets triggered in the error report.


    You can not divide a method call between multiple lines like that. The only places you can start a new line is when the code clearly gets that the method call is not finished.


    This means that you can start a new line after commas, operator signs (+, -, etc), logical operators (&&, ||, etc), and some other signs.


    Number 3:


    The first script call (which triggers the error) is wrong in structure.


    I only guess here, but I think it should be:

    Code:
    set_obj(:questid001,:obj1,$game_variables[1])

    This will pass variable 1 to be the value of the script call. 


    I did not test that script (didn't even read the instructions, to be honest), so this is just my best guess on how this script call works.
     
    #8
  9. Arcandrus

    Arcandrus Villager Member

    Messages:
    11
    Likes Received:
    0
    First Language:
    English


    This... Wonderful piece of information, I broke the script into three lines at each comma as you suggested and amended my errors, all working now, Thanks everyone! Think we can close this up now :)
     
    #9
  10. Shaz

    Shaz Veteran Veteran

    Messages:
    37,184
    Likes Received:
    11,053
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    I will close this for you now, but next time, please report the post to ask for it to be closed as instructed in the forum rules (see link in my earlier post), and any moderator will take care of it. 
     
    Last edited by a moderator: Jan 22, 2016
    #10
Thread Status:
Not open for further replies.

Share This Page