Creating an Event Message System Like Elona's? + Turnbased Combat Question

Discussion in 'JS Plugin Requests' started by ophaq, Sep 11, 2019 at 5:23 PM.

  1. ophaq

    ophaq Villager Member

    Likes Received:
    First Language:
    Primarily Uses:
    Would anyone know a script or method to create a message box that constantly updates based off of event messages?

    Like this:

    I'm trying to wrap my head around this myself basically it's a text box that is part of the UI. And it announces events based off of players actions.

    For example:
    Player walks into x NPC --> NPC moves a tile away --> "You displace the little girl"
    Player walks over x object on ground --> "You see a carpenter's tool here".

    Other applications of this are background events that are basically just sentences that add immersion to the world.

    For example, walking around in a town and a randomly selected phrase from a list of phrases is played from x% chance and announced into the dialogue box.

    The game would check this x% chance every movement turn. The game is turn based like a dungeon crawler. No final fantasy like combat but instead where the NPCs take a turn every tick the same time you move a tile.

    Example in this video here of movement and the event box (video starts playing around 14:00):

    I'm not quite sure how to do this type of movement & combat system either where the game is set on pause until you press a keystroke and every entity within a loaded map screen (regardless if it is in fog of war or not) performs an action when the player performs an action.

    I looked around for scripts or a tutorial to implement these mechanics and I couldn't find anything. Either I'm blind or no one has posted about this yet. If anyone can help me or teach me how, I'd be grateful. :kaocry:
  2. Bex

    Bex Veteran Veteran

    Likes Received:
    First Language:
    Primarily Uses:
    This Steam thread has 2 Links to different Plugins to show Variables on the Game Screen, i did not use it but i would probably test the Orange Hud first.
    Orange Hud:

    Variables can also contain Text.
    For example you make 4 Variables which are always shown on your Gamescreen.
    That would look like:
    - Var2
    - Var3
    - Var4
    - Var5
    Ingame it woud look like:
    - New Player arrived!
    - You see a treasure Chest.
    - The Guard arrived
    - Its getting Dark soon

    Everytime a new Message arrives, all messages are shiftet, like this:
    A Codeblock for a Parallel Event or Script could also look like this:

    If Var1 is not equal to 0
    - if true:
    Var5 set to Var4
    Var4 set to Var3
    Var3 set to Var2
    Var2 set to Var1

    Var1 set to 0

    Everytime some Event changes Var1 into a Textline or something else than 0, than this Variable will be displayed and all previous lines will shift.
    This is just Theory, but maybe it helps.

    About your Movement Question, this is new for me, but i would in Theory try and do this: Using Scriptcommand to Turn Self Switch D On for Every Enemy and than waiting a few Secods before initiating the next player turn. Every Enemys last Eventpage would be
    Page condition Self Switch D and on Parallel.
    The Eventcode would be a Moveroute given to itself with wait for completion and the deactivation of its Self SwitchD.
    Pc Games have no problems if a hundret Events are on Parallel for a one Time use aslong they dont stay on Parallel.
    Browser Games would maybe be better of with 1 Event controlling the Moveroutes for all 100 Enemys. But the lazy first way seems to provide easier copy paste stuff.
    One single Event seems to be best for timing, control and performance. But none of that should matter at the moment.

    Sorry my English aint the best, didnt know how to explain this in a good way.
    Hope it helps.
    Last edited: Sep 11, 2019 at 8:06 PM
    ophaq likes this.
  3. ophaq

    ophaq Villager Member

    Likes Received:
    First Language:
    Primarily Uses:
    Thank you for your input! I'm still learning so I will try and apply it sometime but it might not work exactly the way I want to. But they are good theories. I understand that it can be really complex to do some custom mechanics like this.

    I'm not quite sure how to implement the variables to be something like an event history, especially with that hud script. Basically it will show an event based off of certain factors or a % chance after moving or doing an action (which counts as 1 game turn or tick). Then it will move into an event history list which the player can access later.

    Once more than 4 events of text are shown, the newest message will push the 1st one up. I guess it will kind of work like a chat box which you can scroll up to see the history of what things you did? The messages are triggered every time the player or NPC performs an action that isn't walking and also background information such as walking over an object, random misc information, etc.

Share This Page