Script Call Support Boards

Thanks as always Shaz. I understand this now. Thank you 🙂
@Shion Kreth, can you post a new thread (this thread is about how to use script calls to do certain stuff, not how to set up events so the correct script call will be made at the correct time - that's pure eventing) and provide screenshots of the event as you already have it set up?
I am trying to create a hunger bar I display a picture with display picture which works fine. Now I am trying to change the zoom to shrink it with a script call using an event 

screen.pictures[2].move( 0, $game_player.screen_x, $game_player.screen_y, $game_variables[1], 100, 255, 1, wait) where game variable[1] is my stamina variable.

I keep getting this error

Script 'Game_Interpreter' line 1409: ArgumentError occurred.

wrong number of arguments (0 for 1)

I cant seem to figure it out.
I've already responded to your thread about this (please don't post about the same issue in several places - you could have just put this in your existing thread).


Line 1409 of Game_Interpreter is trying to build the script command. I suspect what you posted above is not exactly what you've got in the script. Can you do a screenshot with your Script command opened up so we can take a look at it?
Sorry about the posting in two places this is the script command

scriptcall.png
wait is meant to be true or false
I'm setting up a common event for stealing where it sets the selected target for the theft (from the enemy troop) to a variable, and based upon that variable determines which of the enemy's stealable items is stolen, if any. I want to make sure I am referencing the enemy correctly (their place in their encounter group). I am currently using:

$game_troop.members

but I want to reference the "number" of the selected enemy, i.e. if I have 5 goblins, and target goblin 3 for the theft, I want it to store 3 in the variable (which would then determine which "list" to "steal" from).
That would simply be the index, perhaps combined with the id of the enemy. Wouldn't all goblins give the same things? It would make more sense to me that if you were battling 3 goblins and 2 ogres and you chose to steal, you would want to know whether it was a goblin or an ogre you were stealing from, not whether it was goblin 1, 2 or 3, or ogre 1 or 2.
That would simply be the index, perhaps combined with the id of the enemy. Wouldn't all goblins give the same things? It would make more sense to me that if you were battling 3 goblins and 2 ogres and you chose to steal, you would want to know whether it was a goblin or an ogre you were stealing from, not whether it was goblin 1, 2 or 3, or ogre 1 or 2.
What I am doing with the eventing is to set each enemy's common, uncommon, and rare item in the troop events (using variables), and reference those variables in the common event "Steal". I use conditional branches to determine whether that enemy is the first, second, etcetera, and another to determine which item, if any, is stolen (5%, 10%, and 25% chance; rare to common). Also, is the following a proper reference for gaining said item:

@game_party.gain_item(v[41],1)

where v[41] is the variable of enemy 1's common item (adjust for each enemy and item), and you gain 1 copy?
No. v[41] (or \V[41]) is used in text boxes, not scripts.

Code:
$game_party.gain_item($data_items[$game_variables[41]],1)
would be the correct call. But that should be in the first few posts of this thread.
No. v[41] (or \V[41]) is used in text boxes, not scripts.

$game_party.gain_item($data_items[$game_variables[41]],1)would be the correct call. But that should be in the first few posts of this thread.
Thank you. I didn't notice that when I was reading through the thread the first time, probably because I was looking for my original question regarding which enemy from the troop.

Back to my original question, though. You mentioned that I can reference the id or index of the monster. Would referencing the index:

$game_troop.members[enemy_index]

give me the enemy number from the troop (i.e. 2 of 5)? I plan on setting up a troop event on each troop page which would set each monster's stealable items to my variables, the ones being referenced by my steal event.

Also, what is the script call to run a common event. I am trying to call a common event from a battle event, and a skill, but I want the event run to be based upon a variable. My current script call is:

$game_variables[53]=$game_variables[45+$game_troop.members[enemy_index]]

followed by an event line:

$game_CommonEvent.$data_common_events_id[$game_variables[53]]

Within the battle event, I run a few control variables once per battle on turn 0 (i.e. right away). These variables are set to the up to 5 monster loot "tables" (common events that are nested conditionals for common, uncommon, and rare loot items). The first script call above sets the monster loot variable (i.e. sets which of the loot "tables", 1-5, the thief will steal from); it basically will equal one of the variables I set in the battle event page. Variable 53 will be set to a number (within the range of common events I will set aside for "loot tables"). The second script call will theoretically run a common event based upon that variable. Example, my first troop battle event is two wolves and an orc (for now). So variables 46 and 47 will be set to 7, and variable 48 will be set to 8 (the wolf and orc loot tables, respectively). If the player targets either of the two wolves (which should be indexes 1 and 2, unless it is an array and should be 0 and 1), then the "monster loot" variable is set to variable 46 or 47 (which both are set to 7 in this case, but I am going for re-usability), otherwise it will be set to variable 48, which is 8 (Since there are only 3 enemies, it won't deal with variables 49 or 50).

Is my script call correct? I can't test it right now until I resolve an issue I'm having with Yami's Battle Engine Symphony.
No. enemy_index IS the enemy number in the troop. Enemy 1 would have index 0, enemy 2 would have index 1, etc. You cannot reference the enemies unless you HAVE the index.


I suggest you start a new thread in RGSSx Script Support as what you're after is quite specific and sounds a bit complicated. Better to have it in its own thread where it can be discussed at length, rather than derail this one.


Also, where are you putting this command - is it in the damage formula? In a troop event page? In a common event? Where are you putting the script call? In the damage formula? In a troop event page?


Perhaps a few screenshots (in your new thread) showing how you've got it set up now, might be helpful.
Any way to call info from the map? specifically how many tiles X and Y it is? 
Okay, this SHOULD be simple by all means, but I'm not sure what I'm missing here.  I have a conditional branch set up in a parallel process event and I'm trying to use it to reference how many actors are in the party and alter a variable accordingly.  Right now it's: 

Spoiler
if $game_party.members == 3  $game_variables[17] = 3

elsif $game_party.members == 2

  $game_variables[17] = 2

else

  $game_variables[17] = 1
It isn't throwing an error, but it also isn't changing the variable at all??
Any way to call info from the map? specifically how many tiles X and Y it is?
$game_map.width$game_map.heightOf course you will need to do something with them ... put them into variables, use them in a conditional branch ... whatever. You'll get an error if you JUST do what I've got there.

Code:
if $game_party.members == 3  $game_variables[17] = 3elsif $game_party.members == 2  $game_variables[17] = 2else  $game_variables[17] = 1
 It isn't throwing an error, but it also isn't changing the variable at all??
Nothing wrong with the code. Though if you're only going to have 3 people in your party, this would be easier:

$game_variables[17] = $game_party.members.sizeHowever, why are you using a script call for this? You can do Control Variables > Game Data > Other > Party Members to put the party size into a variable.If the above isn't good enough and your script call really isn't working, show us a screenshot of your event. It's probably the way your event is set up (switch needs to be on for it to run and it isn't on, or you have another event page with a higher number that's active instead), or there's something else that's resetting that variable.
Nothing wrong with the code. Though if you're only going to have 3 people in your party, this would be easier:
$game_variables[17] = $game_party.members.sizeHowever, why are you using a script call for this? You can do Control Variables > Game Data > Other > Party Members to put the party size into a variable.If the above isn't good enough and your script call really isn't working, show us a screenshot of your event. It's probably the way your event is set up (switch needs to be on for it to run and it isn't on, or you have another event page with a higher number that's active instead), or there's something else that's resetting that variable.
...I completely forgot about the "Other" tab in Game Data, that makes my life so much easier... 

Thank you for that  :blush:
I'm trying to call the substitute effect through scripting. 

I see in Game_BattlerBase that FLAG_ID_SUBSTITUTE = 2

I've tried to use that flag id multiple ways, but with no luck.  I imagine the answer is simple, but I'm just not using the correct command.

Any help appreciated.
Question, I want to make a conditional branch to make a variable operation

(For example if Variable 44 + Variable 46 is greater to variable 45)

I could use a variable operation for that, but I'm using a lot of variables actually so I want to make it via script call, is that possible?
you don't even need a script call, you can use the script condition of the conditional branch for that.


the reference you'll need is $game_variables[iD] and then use regular Ruby expressions to check any condition with that.
So, according to my example, it'd be something like: ($game_variables[44] + $game_variables[46]) >= $game_variables[45]

Am I right?

Original thread: https://forums.rpgmakerweb.com/threads/script-call-support-boards.25767/