Thendon

Script Noob
Member
Joined
May 31, 2014
Messages
7
Reaction score
2
First Language
German
Primarily Uses
actualy $game_variables[n]=game_actors[n].param(2) should work. What are you putting instead of "n" ?
 

iNBee317

Villager
Member
Joined
Jun 10, 2014
Messages
15
Reaction score
0
First Language
English
Primarily Uses
$game_variables[82]=$game_actors[0].param(2) is exactly what I have entered.

The error it gives is undefined method 'param' for nil:NilClass
 
Last edited by a moderator:

Thendon

Script Noob
Member
Joined
May 31, 2014
Messages
7
Reaction score
2
First Language
German
Primarily Uses
thats because of $game_actors[0] doesnt excist. The first actor is $game_actors[1]
 

iNBee317

Villager
Member
Joined
Jun 10, 2014
Messages
15
Reaction score
0
First Language
English
Primarily Uses
Wow haha thanks a ton. Now it works! I thought 0 referred to the first actor but I was mixing up the party members with the actors.  
 

RyokuHasu

Developer
Veteran
Joined
Jun 23, 2012
Messages
274
Reaction score
38
First Language
English
Primarily Uses
that's an easy mistake almost any programmer might make it since in the majority of programming arrays must start with the 0 index, but it's not always the case.
 

iNBee317

Villager
Member
Joined
Jun 10, 2014
Messages
15
Reaction score
0
First Language
English
Primarily Uses
When my script call entries are too long they jump to the next line and it throws and error. Is there a workaround for longer script entries?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,537
Reaction score
8,154
First Language
German
Primarily Uses
RMMV
When my script call entries are too long they jump to the next line and it throws and error. Is there a workaround for longer script entries?
You can't increase the length of the script command line, but you can use temporary variables to store part of the information into them, making the final call shorter.
Give us an example of a call you have a problem with, and we can show you how to handle that (it depends on the exact commands, there is no general solution)
 

iNBee317

Villager
Member
Joined
Jun 10, 2014
Messages
15
Reaction score
0
First Language
English
Primarily Uses
I am sort of struggling with multiple things ATM. First is the command line length, second is getting the for loop to work how I want it. I may need to learn how to create my own script and call it somehow. my issue below is the 3rd line.


Code:
for i in $game_party.members.id
$game_variables[9]=$game_actors[#(i)].mdf
$game_variables[9]+=actor_self_variable(#
(i),"acr"]
$game_variables[9]+=$game_variables[14]
if $game_variables[9]>=$game_variables[20]
actor_self_switch(#(i),"success",true)
else
actor_self_switch(#(i),"success",false)
end
 
Last edited by a moderator:

Jaide

"This guy are sick."
Veteran
Joined
Mar 17, 2012
Messages
443
Reaction score
48
First Language
English
Primarily Uses
So I'm trying to utilize the different frames of a sprite through the Change Graphic command under Move Route. This is the script call I'm using, as I understand it:

instance_eval("@pattern = 0")

I was told to use this after changing the direction of the sprite, but no matter what number I plug in for the step pattern, it always returns to the middle frame. Is there any way to make it actually stay on a stepping frame?
 

iNBee317

Villager
Member
Joined
Jun 10, 2014
Messages
15
Reaction score
0
First Language
English
Primarily Uses
Is it possible to include control variables in script call to display text same as you can when using the built in event process? i.e. \N[n] or V\[n] to display a character name or variable. I can't get it to work, here is something I am trying to do:

Code:
 $game_message.add("\v[40] succeeded ")
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,179
Reaction score
14,659
First Language
English
Primarily Uses
RMMV
When my script call entries are too long they jump to the next line and it throws and error. Is there a workaround for longer script entries?
Just make sure it breaks after a + - = or other mathematical symbol, or after a [ { or ( - this means you might need to add the line break manually.

However, that seems to be a very small script box, which means you're using an early version of the engine. If you download a newer version it should give you a lot more room before it wraps.

Is it possible to include control variables in script call to display text same as you can when using the built in event process? i.e. \N[n] or V\[n] to display a character name or variable. I can't get it to work, here is something I am trying to do:

$game_message.add("\v[40] succeeded ")
Yes it is, but you've got to speak the same language. \v[40] works in text boxes but not scripts. In scripts you need to use $game_variables[40]. I'm not sure why that didn't occur to you already, as you used that exact syntax a few posts earlier.

Code:
$game_message.add($game_variables[40] + " succeeded")
if var 40 contains a number, you'd need to do $game_variables[40].to_s or you'll get an error.
 
Last edited by a moderator:

iNBee317

Villager
Member
Joined
Jun 10, 2014
Messages
15
Reaction score
0
First Language
English
Primarily Uses
thanks, I had tried something similar though without the + or the .to_s
 

iNBee317

Villager
Member
Joined
Jun 10, 2014
Messages
15
Reaction score
0
First Language
English
Primarily Uses
Anyone know how to jump to label in a script call?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,179
Reaction score
14,659
First Language
English
Primarily Uses
RMMV
This is Game_Interpreter's method for Jump to Label:

def command_119 label_name = @params[0] @list.size.times do |i| if @list.code == 118 && @list.parameters[0] == label_name @index = i return end end endYou could TRY doing this in a script call, but I don't know if it'd give you the correct access to @list and @index.If you try, just do it like this (I'll call the label Go To Here, so replace that with whatever you need):

@list.size.times do |i| if @list.code == 118 && @list.parameters[0] == "Go To Here" @index = i i = @list.size endendI really don't know if that'll work though.For my game I just made a new method in Game Interpreter where I could pass in the label name as a string, and it did pretty much the same thing.
 
Last edited by a moderator:

iNBee317

Villager
Member
Joined
Jun 10, 2014
Messages
15
Reaction score
0
First Language
English
Primarily Uses
I am trying to assign the quantity of an item in inventory to a variable via a script call. I am doing the following

z=$game_variablesb=$game_party.item_numberz[81]=b($data_items[17])This is what the script call collection on this site recommends. Though I get an error from Tsukihime's long script call script that says line 45 unused arguments 0 for 1.

Tsukihime said that I can't assign a method to a variable like that. That ruby assumes I am making a method call. I am confused given that the above call was from the call collection.

Here is the script I am getting the error from:

=begin#============================================================================== ** Large Script Call Author: Hime Date: Oct 3, 2012------------------------------------------------------------------------------ ** Change log Oct 3, 2012 - initial release------------------------------------------------------------------------------ ** Terms of Use * Free to use in non-commercial projects * Contact me for commercial use * No real support. The script is provided as-is * Will do bug fixes, but no compatibility patches * Features may be requested but no guarantees, especially if it is non-trivial * Preserve this header------------------------------------------------------------------------------ This script changes events so that all script calls that are placed together will be evaluated as a single block of code rather than separate entries. A rough way to get around the 11-line, 484-char limit.#===============================================================================end$imported = {} if $imported.nil?$imported["Tsuki_LargeScriptCall"] = true#==============================================================================# ** Configuration#==============================================================================module Tsuki module Large_Script_Call endend#==============================================================================# ** Rest of the script#==============================================================================class Game_Interpreter def command_355() script = @list[@index].parameters[0] + "\n" while [655, 355].include?(next_event_code) @index += 1 script += @list[@index].parameters[0] + "\n" end eval(script) endendAnyway, Tsukihime said to ask around here to find a solution. How can I get this to work properly? Am I typing something wrong or is it a compatibility issue?
 
Last edited by a moderator:

Archeia

Level 99 Demi-fiend
Staff member
Developer
Joined
Mar 1, 2012
Messages
15,307
Reaction score
15,770
First Language
Filipino
Primarily Uses
RMMZ
inBee, why are you doing


z[81]=b($data_items[17])?
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,179
Reaction score
14,659
First Language
English
Primarily Uses
RMMV
And why are you breaking it up into multiple statements rather than doing a single statement?


Your problem is that $game_party.item_number is a method that requires parameters. You cannot assign the method to a variable and then use that variable to call the method and THEN pass in parameters (as far as I know)


$game_variables[81] = $game_party.item_number($data_items[17])


If that is too long for your script box, it means you are using a very early version of Ace. You can either redownload and get the full sized script box that would support a command that length, or type it as this:


$game_variables[81] =


$game_party.item_number($data_items[17])
 

BTYsince88

Warper
Member
Joined
Jul 3, 2014
Messages
2
Reaction score
0
First Language
US English
Primarily Uses
Hey all,

I absolutely LOVE the compendium you've built in the link provided. There's really no good way to acclimate yourself to all of the game data for RMVXA so that is really handy, especially for those who are familiar with code but get stuck in figuring out where to get the data you want or the event you want to invoke.

I did have some questions regarding the list provided:

There is a reference of $data_items[n] in the provided compendium. I've played around and found that there is also $data_weapons[n], $data_armors[n], $data_states[n], $data_skills[n], and $data_classes[n].

Each of these I've found have some attributes that can be returned, such as .id, .name, and .description (except for description on class and state, as there are no fields for this)

Firstly, are there data subcategories that I'm missing that are available?

Second, are there attributes for any of these that I'm not seeing that can be "script-called" or returned?

Third, I've (perhaps naively) observed that the id seems kind of useless, considering to return "3" you need to put "3" in for the n variable. Is there any use for this?

Finally, is this simply the database information? As in, if I change the 3rd actor's name, will $data_actors[3].name still return the default or the new name? I guess a sub-question of this would be is it possible to assign to these?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,179
Reaction score
14,659
First Language
English
Primarily Uses
RMMV
F1 to get the help file. Take the Ruby/RGSS Reference option (I don't know if it's really called that - I don't have Ace with me at work). Look at the built-in classes to see what they all inherit from and have in common.


id is useful sometimes, but usually when you look up an item (like actor's equipment) it returns the actual item, not just its id.


If you change actor 3's name via the database, $data_actors[3].name will always return the new name. If you have a saved game that was made prior to renaming, $game_actors[3] will have the old name. This is only because you've chosen the one database item (an actor) that is actually saved with the game. If you were to change the name of ITEM 3 in the database, ALL new games and saved games would show the new name of the item.


But those are really not questions for this thread - if you want more information, post in another thread in the appropriate place (RGSSx Script Support or Learning Ruby and RGSSx if you specifically want scripting tips)
 

Latest Threads

Latest Posts

Latest Profile Posts

The worst feeling in the world is going for a walk on a nice summer day, seeing an ice cream truck, and realizing you don't have any money with you :(
Mike running through an area that's influenced by his thoughts, thus his drawings are infused into the land.
We're playing Omori by OMOCAT starting at 2pm est :D
Hi there! Do you actively use your Itch.io account? How do you use it?

Forum statistics

Threads
111,339
Messages
1,060,298
Members
144,660
Latest member
Draker95
Top