Script calls and in game variables

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, 😮bjid, 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, 😮bjid1, $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 🙂  
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.
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)
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
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.



Thank you Andar, that is something I didn't realize, I will test this and get back to you 🙂  
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
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.
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.
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.



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 🙂
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. 

Original thread: https://forums.rpgmakerweb.com/threads/script-calls-and-in-game-variables.55417/