Script Call Support Boards

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?
I know this is from a few weeks back, and I don't know if you ever found your solution, but to make pattern changes stick, I've found you need to the change the "original pattern" as well. So a call of
Code:
@original_pattern = @pattern = 0
should work.
Thanks! Sorry if this wasn't the right spot for that question, I just assumed this would be the place as it seemed important to understand the difference between $data_ and $game_ to know how to set up my script calls properly.

Hopefully this question is more on topic:

I noticed in the list there are two alternative options shown for playing SE/ME/BGM/BGS:

Audio.bgm(play(name,volume, pitch)

RPG::BGM.new(name, volume, pitch).play

Is there any difference between these that I should know about before using them as a call?

I also noticed that there are these:

$game_map.screen.change_weather(type, power, duration)

screen.pictures[n].erase

Is there a reason why in one scenario I should call screen stuff with the prefix and another without?
how would i write $game_actors[X]

where X is the one with a state applied?
$game_actors.select {|actor| actor.state?(id)}[0]


where id is the id of the state you're interested in (no leading zeros). This COULD give you an array of several actors, which is why I added the [0] at the end, to select just the first one. That might cause an issue though, if NO actors have the selected state. It would probably crash and say [] invalid for nil object or something like that.
thank you Shaz.

i've been working on this since this morning and cant get it to work

what is wrong with this?

 

learn require eval

if $game_actors.select {|actor| actor.state?(103)}[0].weapons.include?($data_weapons[8]);

then $game_switches[8] = true;

else;

end

/learn require eval

 

my error reads

script 'yanfly engine ace - learn skill engine v' line 706: NoMethodError occurred.

 

private method 'select' called for # Game_Actors:0x7b9ebe4

 

im trying to only allow the skill to be leant by when the weapon is equiped

guessing i could probably cut the state and use something like

$game_actors.select {|actor| actor.weapons.include?($data_weapons[8]}

im a complete newbie in script 🙁
Oh - I thought you wanted the actual actor. If you just want to see if ANYONE has that state AND that weapon, this will be easier:

$game_switches[8] = $game_party.members.any? {|actor| actor.state?(103) && weapons.any? {|weapon| weapon.id == 8} }or maybe this:

Code:
$game_switches[8] = $game_party.members.any? {|actor| actor.state?(103) && weapons.include?($data_weapons[8])}
$game_actors refers to ALL actors that have ever been added to your party (even if they're not there anymore) or any that you've referred to for any reason (even if they were never in your party).
$game_party.members is what you need if you want to refer to the actors currently in the party.


If you have trouble with that, I suggest you start a new thread in RGSSx Script Support and include a link to the script you're using. This is really only for simple stuff, for example, wanting to use a script call instead of an event command to do something a bit more clever than events allow. It is not a support thread to help you understand or work with other scripts.
Thank you so much.

My problem isnt fully resolved but what youve given me has cut out a lot of work in my end goal.

I'll do as you said about the thread after i try fixing it myself.

thanks again ^^
quick question

if im using

 

actor = 1

text = "Someone learnt a skill!"

 

inside a script call

how would I make

 

text = "\\N[actor] learnt a skill!"

 

work, where \\N[ 'actor' ] equals what actor equals?


hope that made sense haha
I don't know if this is bad etiquette or not but its been a while so I'll post about it again.

I'm learning ruby to try and resolve it myself but I want to keep working on my game still.

I think I have the solution but it doesn't work

what is wrong with this?

actor = 1

text = "\\N[#{actor}] learnt a skill!"

Is it because actor isn't a string?
text = "\\N[" + actor + " learnt a skill!"
Shaz has a typo and missed a bracket:


text = "\\N["+actor+"] learnt a skill!"
thanks guys. still have lots to learn.

This is the third time your helping me out now Shaz ^^

Ty sir
alright ... what was the typo? That's going to bug me now until you tell me. I can't see it. I can only see the bracket you added.
the bracket was the typo I meant - only one error, my wording might have been sub-optimal if you read it as two errors...
oh yeah, I did think you meant a typo AND a missing bracket.
Hello again. Another easy question I hope

 

Why does

 

for x in 3..8

  $game_temp.reserve_common_event(x)

end

 

only run comment event number 8?

 

I think it has something to do with numbers 3..7 either not being placed in que or getting skipped?

I've worked around it so its not an issue but i'd like to find out why.

Please help ^^
If this is wrong please don't delete just move it to the right place.

Nice Scripts you have there when I click on the link but what I didn't read is where to put it in.

The position in the Script is important I think but I don't know where to put it in.

And I am asking for all possible scripts.

These three are the ones I want to add:

Passive Skills: http://pastebin.com/raw.php?i=qJQxcTdu

Enemy HP bar: http://pastebin.com/Qj9gAKq9

Skill level: http://pastebin.com/5bHYb2pm

Please help me.

And before you ask, Yes I read the scripts and still don't know where to place them in the script of the RPG Maker VX Ace.
The position in the Script is important I think but I don't know where to put it in.
In the case of the first and third script, they specifically instruct you where to put them: In the script editor, below materials and above main - where 99% of all scripts are supposed to be placed, with only very few exceptions.
You open the script editor, scroll down to the materials section, and then copy & paste them there.


Don't forget to name the slots after you placed the scripts there.
Why does


for x in 3..8


  $game_temp.reserve_common_event(x)


end


only run comment event number 8?
Because only one common event can be reserved at a time. The common event will not run until your script is finished and you return to the map. So you are just putting lots of different numbers into a variable, and when you return to the map, only the last number you put in will be there.


$game_temp.reserve_common_event sets a single value. It is not an array that you can just keep adding to, where one element will be pulled off, processed, and then moves on to the next.

If this is wrong please don't delete just move it to the right place.
Yes, it is in the wrong place. This thread is specifically about things in the first post, not for getting help putting OTHER scripts into your project or making them work together. If you need help with scripts, your thread should be posted in RGSSx Script Support.
Is there a way I could set up... something... so that turning a switch on runs a script call, and turning it off runs a separate script call, preferably using common events rather than an event that has to be always running/on every map? I'm trying to use this to change screen resolution in my game but if I have an autorun common event that changes it(via script call) when a switch is turned on it won't return to normal without a separate script call to set it back to normal. Any creative solutions?

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