Generic question about Script Calls

● ARCHIVED · READ-ONLY
Started by Otto 3 posts View original ↗
  1. Howdy,
    as title says, I have a genric question about how the Script Call event command works: if I need to create - inside the script - those command that can then be executed via Script Call, or the event command goes on to call some functions that already automatically exist within a script?

    I don't know if I was able to express myself properly, so I'll use the Battle System script that I'm currently working on, as an example:

    This system allows the player to reload the firearm he has currently equipped by pressing S on the keyboard, that's something that already existed as part of the script. Let's say I want to be able to reload a firearm in the middle of an event (example: at the start of the game, after the opening cutscene the main guy automatically reloads his gun - because at the start of the game all firearms are empty, because of how the script works), do I have to actually create some sort "call script" response function (sorry I don't know the correct terminology) within the script, or it already exists (because the script has the reloading mechanic built in) and I can automatically call it via an event?

    Thanks to anyone that can clarify :p
  2. You were having a hard time about explaining your own question, and it's also not an easy question to answer either if you basically don't know much about scripting. But let me try to explain.

    First thing first, asking about particular script the one you mentioned I believe it should go under RGSSx support with the title "is there sort of script call to reload bullet within this script?", because I'm not sure if you're asking about "what is script call?" or "I want this script to work the way I want". Anyway, I'm answering the former.

    How to determine if you can use script call is to look at the script. For example, you see in Game_Actor, you see all methods defined by "def method_name", all those methods can be called by using script call.

    For example, we want to call equip_slots from Game_Actor.
    Code:
    msgbox_p $game_actors[1].equip_slots
    It will pops up a message box containing array of equip slot type.

    If you want to define your own method, and preferable for a single line call with custom call name, the script call is called within Game_Interpreter. For example, here is mine. This within the Game_Interpreter
    Screenshot_440.png
    And the script call.
    Screenshot_441.png
    (end_scene is an alias name, bcz sometimes I wrote it as end_event or end_scene unconsciously and I dont want to fix that)

    Now to answer your question whether if you need to create a custom script call for the script you're using, we can't answer that, and it's highly depends on how the script is done. So you need to look at the actual script to determine if you need make one.
  3. Thanks, Theo, I think I understood how that works.

    And sorry if I gave you the impression that I was trying to disguise a specific need with a general question, because I didn't want to look like I was taking advantage or I was being too lazy... I am a lazy pos most of the time, so I'm not shy about asking for the specific solution if I feel it's something too complex for me to learn in a short period of time, this was not the case;

    TheoAllen said:
    because I'm not sure if you're asking about "what is script call?" or "I want this script to work the way I want". Anyway, I'm answering the former.

    The two things are somehwat related; I do, in fact, need that particular script to work that way, but I prefered to know (or at least catch a glimpse of) how the whole script call thing worked in general (because I might need it in the future with other scripts too) rather than ask to be provided for the case-specific solution that would serve me only this one time.

    It's like the thing with the fish, you know... you ask a man for a fish, you eat one day. you ask a man to show you how to fish, you eat your whole life. .. I think it was like that... can't quite remember LOL

    Anyway, I digress... thanks again for the explanation :)