Yato

(aka Racheal)
Veteran
Joined
Mar 17, 2012
Messages
825
Reaction score
347
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?
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.
 

BTYsince88

Warper
Member
Joined
Jul 3, 2014
Messages
2
Reaction score
0
First Language
US English
Primarily Uses
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?
 
Last edited by a moderator:

jmarz

Villager
Member
Joined
Jun 24, 2014
Messages
10
Reaction score
0
First Language
English
Primarily Uses
how would i write $game_actors[X]

where X is the one with a state applied?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,904
Reaction score
14,540
First Language
English
Primarily Uses
RMMV
$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.
 

jmarz

Villager
Member
Joined
Jun 24, 2014
Messages
10
Reaction score
0
First Language
English
Primarily Uses
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 :(
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,904
Reaction score
14,540
First Language
English
Primarily Uses
RMMV
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.
 
Last edited by a moderator:

jmarz

Villager
Member
Joined
Jun 24, 2014
Messages
10
Reaction score
0
First Language
English
Primarily Uses
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 ^^
 

jmarz

Villager
Member
Joined
Jun 24, 2014
Messages
10
Reaction score
0
First Language
English
Primarily Uses
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
 

jmarz

Villager
Member
Joined
Jun 24, 2014
Messages
10
Reaction score
0
First Language
English
Primarily Uses
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?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,904
Reaction score
14,540
First Language
English
Primarily Uses
RMMV
text = "\\N[" + actor + " learnt a skill!"
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,362
Reaction score
8,085
First Language
German
Primarily Uses
RMMV
Shaz has a typo and missed a bracket:


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

jmarz

Villager
Member
Joined
Jun 24, 2014
Messages
10
Reaction score
0
First Language
English
Primarily Uses
thanks guys. still have lots to learn.

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

Ty sir
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,904
Reaction score
14,540
First Language
English
Primarily Uses
RMMV
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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,362
Reaction score
8,085
First Language
German
Primarily Uses
RMMV
the bracket was the typo I meant - only one error, my wording might have been sub-optimal if you read it as two errors...
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,904
Reaction score
14,540
First Language
English
Primarily Uses
RMMV
oh yeah, I did think you meant a typo AND a missing bracket.
 

jmarz

Villager
Member
Joined
Jun 24, 2014
Messages
10
Reaction score
0
First Language
English
Primarily Uses
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 ^^
 

Hathios82

Villager
Member
Joined
Aug 20, 2014
Messages
11
Reaction score
0
First Language
German
Primarily Uses
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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,362
Reaction score
8,085
First Language
German
Primarily Uses
RMMV
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.
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,904
Reaction score
14,540
First Language
English
Primarily Uses
RMMV
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.
 
Last edited by a moderator:

Shion Kreth

White Knight
Veteran
Joined
Jan 28, 2013
Messages
281
Reaction score
47
First Language
English
Primarily Uses
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?
 

Latest Threads

Latest Posts

Latest Profile Posts

Any progress...
index.php
CookingStation.png
And so the making of workstations continues...
Join @StudioBlueGames
as Steel and Teal play Ouroharas's The Unborn Daughter! A stranger on a distant shore. Live now!

If Mog working on ports, but going to the void it just stir a confusion on what's going on.
I don't know what to do with this character, but it mine

IMG_20210419_121108.jpg

Forum statistics

Threads
110,547
Messages
1,054,132
Members
143,652
Latest member
bbcream515
Top