Script Call Support Boards

Discussion in 'RPG Maker VX Ace' started by Archeia, Apr 5, 2014.

  1. Yato

    Yato (aka Racheal) Veteran

    Messages:
    826
    Likes Received:
    344
    Location:
    Canada
    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.
     
    #41
  2. BTYsince88

    BTYsince88 Warper Member

    Messages:
    2
    Likes Received:
    0
    First Language:
    US English
    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: Jul 3, 2014
    #42
  3. jmarz

    jmarz Villager Member

    Messages:
    10
    Likes Received:
    0
    Location:
    Australia
    First Language:
    English
    how would i write $game_actors[X]

    where X is the one with a state applied?
     
    #43
  4. Shaz

    Shaz Veteran Veteran

    Messages:
    37,717
    Likes Received:
    11,423
    Location:
    Australia
    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.
     
    #44
  5. jmarz

    jmarz Villager Member

    Messages:
    10
    Likes Received:
    0
    Location:
    Australia
    First Language:
    English
    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 :(
     
    #45
  6. Shaz

    Shaz Veteran Veteran

    Messages:
    37,717
    Likes Received:
    11,423
    Location:
    Australia
    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: Jul 5, 2014
    #46
  7. jmarz

    jmarz Villager Member

    Messages:
    10
    Likes Received:
    0
    Location:
    Australia
    First Language:
    English
    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 ^^
     
    #47
  8. jmarz

    jmarz Villager Member

    Messages:
    10
    Likes Received:
    0
    Location:
    Australia
    First Language:
    English
    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
     
    #48
  9. jmarz

    jmarz Villager Member

    Messages:
    10
    Likes Received:
    0
    Location:
    Australia
    First Language:
    English
    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?
     
    #49
  10. Shaz

    Shaz Veteran Veteran

    Messages:
    37,717
    Likes Received:
    11,423
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    text = "\\N[" + actor + " learnt a skill!"
     
    #50
  11. Andar

    Andar Veteran Veteran

    Messages:
    28,447
    Likes Received:
    6,492
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    Shaz has a typo and missed a bracket:


    text = "\\N["+actor+"] learnt a skill!"
     
    #51
  12. jmarz

    jmarz Villager Member

    Messages:
    10
    Likes Received:
    0
    Location:
    Australia
    First Language:
    English
    thanks guys. still have lots to learn.

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

    Ty sir
     
    #52
  13. Shaz

    Shaz Veteran Veteran

    Messages:
    37,717
    Likes Received:
    11,423
    Location:
    Australia
    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.
     
    #53
  14. Andar

    Andar Veteran Veteran

    Messages:
    28,447
    Likes Received:
    6,492
    Location:
    Germany
    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...
     
    #54
  15. Shaz

    Shaz Veteran Veteran

    Messages:
    37,717
    Likes Received:
    11,423
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    oh yeah, I did think you meant a typo AND a missing bracket.
     
    #55
  16. jmarz

    jmarz Villager Member

    Messages:
    10
    Likes Received:
    0
    Location:
    Australia
    First Language:
    English
    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 ^^
     
    #56
  17. Hathios82

    Hathios82 Villager Member

    Messages:
    11
    Likes Received:
    0
    First Language:
    German
    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.
     
    #57
  18. Andar

    Andar Veteran Veteran

    Messages:
    28,447
    Likes Received:
    6,492
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    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: Aug 21, 2014
    #58
  19. Shaz

    Shaz Veteran Veteran

    Messages:
    37,717
    Likes Received:
    11,423
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    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.

    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: Aug 21, 2014
    #59
  20. Shion Kreth

    Shion Kreth White Knight Veteran

    Messages:
    281
    Likes Received:
    47
    Location:
    Ottawa, Canada
    First Language:
    English
    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?
     
    #60

Share This Page