Nilom's Recent Forum Activity

  • Ah yeah that makes sense. I will test it later when I'm home. Thanks again!

  • Thank you for your detailed reply!

    Okay I see. So it is mostly up to me.

    I will continue using a single layout and groups for now and hope that I will not realize one day that I should have used seperate event sheets instead. :D

    I have a last question though. When using nested groups, if the main group is deactivated on startup and a group inside it is active on startup, does it mean the active group inside the inactive group is inactive as long as the upper level group is inactive? Maybe a stupid question but the fact that this nested group is not greyed out in the editor made me wonder.

    Thanks again :)

  • Hello there.

    I'm wondering about what the best practices are in regard to performance and development efficiency with the eventing system for a multilayer game.

    Currently in my game people can set up a room, connect to a room and create their character.

    I'm using a single layout and a single event sheet for this as I thought things like reconnecting might be easier with a single event sheet. I use groups that I enable or disable to change the state of the game like signalling, hosting, character creation etc. .

    But now I'm wondering if I should instead use different event sheets for the different states. Like one for the connection, then if connected go to the lobby layout (and event sheet) and then if the game is started to a different one.

    Also I wonder if it is better to have a group for being the host and one for being the peer (like in the multiplayer tutorial) or instead simply check "is host"...Do This..."else"...Do That... .

    How do you do it? What do you think is more efficient while developing and performance wise?

  • Ohhhh. Stupid me! I will test it tomorrow with pick all. No I did not do that because I didn't think of that. Thank you for that hint. :D

    Edit:

    Tested it and still the only way it works as inteded is from my screenshot above. I guess that's because On Text created is triggered simultaneously and not after the text creation which will not make the local variables accessible.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Okay that was a good hint about the top level event. Both the text creation function call and the z ordering where inside the on selection changed event of the list object.

    Now I have a top level trigger_order_z check that will order z when it's 1 and set itself to 0 afterwards. Works perfectly now. Thanks.

    Edit: Got it even simpler. Now I made an On Text created -> order z event. So I do not need to trigger or use variables at all.

    Edit 2: On Text created won't work. Don't know why. Guess I have to trigger variables..

    Last Edit:

    Okay I did some testing. The only way I got it working correctly while still being automated without me needing to manually trigger the z ordering was as follows:

    When I used z ordering inside the On Text created event it just did not order any text at all. Even when wait was used. So I need to trigger a variable and in the following event I can order z. I guess it has to do with something like On Text created it can not access instance variables yet.

    When using the Sort event the first time the text is created will appear on the bottom of the layer for no reason. The second and following times the class is changed it works as inteded. Just the first time the class icon will not appear because z index will be below the character frame.

    Anyway. The way I sat it up in the screenshot works.

  • Hello there!

    I have some text objects that I need to order.

    For every text that I "spawn" I use a function for setting the size, color etc. . And one of these function parameters is z-order, which defaults 50.

    So I have one text. The character name. It should always stay over another text.

    I got it kinda to work this way:

    The name now always is above the other text. But what I find confusing is that it will be the case no matter what I set for the z_order value. Remember z_order defaults 50. I want to sort the objects from 0 to 100, 50 being the average middle. This way I have enough "virtual layers" for placing objects above or below another.

    But no matter what I set the z_order value of the text object, it will always stay below the name. I wanted it to appear above the name for testing, so that I know it is working correctly as it should. Which it doesn't.

    Oh and this by the way did not work at all:

    What am I doing wrong? Or am I ordering too soon?

  • Okay thank you. Then I'll just go for it.

  • Hello there!

    I'm wondering what's the best way to have all the data of a "typical RPG" stored.

    I really like the modularity of javascript objects. So is there anything wrong with using JSON to store most, if not all of the data instead of using arrays, dictionaries or global variables?

    Some time ago I worked with RPG Maker MV and liked the way the battle system handled the battle formulas. I'm thinking of a similar system where I can do things like

    player1.hp = player1.hp - (player2.atk-player1.def)

    (Just a very basic/bad formula for easy demonstration.)

    Sure I could use dictionaries for this and call them player1, player2 etc. . But with JSON I imagine to be a lot more flexible with storing the data.

    Are there any downsides in using JSON as a database and for runtime calculations (turn-based rpg)?

    As always, thank you in advance!

  • I'm good for now, thank you! I noticed that I can not send the project via private message. Although it is strange I will just use a sub-event for the evaluation. It works that way.

    Thank you for your help. :)

  • Ah I wrote resource indeed wrong. But I did it on all places where I used it. It is written with double s in my native language. Corrected it. :D

    I now finally got it to work! But I think it is a little strange. Comparing the instance variable of the TextObject didn't work either. But when I made a subevent and moved the evaluation there it suddenly worked.

    But what I find quite strange is with the first ListObject (role) the picking inside on selection changed totally works.

    Both ListObjects use the same logic and call the same function to just spawn a different description text.

    Edit without an edit:

    Ahhh I now found out that if I remove the | (OR) statement and just have a single evaluation it stops working in the first list too.

    Is this a bug or did I do something wrong?

  • Hey there!

    In my project I use a function to let text (TextObjects) spawn. For being able to differentiate between these TextObjects I use a local variable usage inside these TextObjects.

    Okay now I have 5 different TextObjects. Two of them are just titles above the two ListObjects. They just stay there. Two of the other ones are descriptions of the ListObjects, below them. These descriptions change when selecting items of the corresponding ListObject above them. The last one is another TextObject which changes depending on the selection of the first ListObject.

    How I tried it is as follows:

    Every TextObject will be checked for its usage local variable by evaluation. If it is "role_icon" or "role_description" it should be deleted before spawning another one of these (or there will be overlapping text). That works perfectly fine.

    But when I try the same with the second ListObject and its description text below it just will not be triggered at all.

    Even if I remove the delete text command there will be no description text. Only if I remove the evaluation there will be description text. But either all other TextObjects will be deleted or text will overlap (depending if I remove the delete text or not).

    Am I missing something?

    Thanks in advance!

  • First, thank you very much for trying to help me! Very appreciated.

    I am running this function only once and at the end of the drawing. Because as you say it is processing intense. Good idea, I might reduce the size of the DrawingCanvas to 500x500 or even 400x400.

    The user will have all sorts of colors. Maybe I will even add a color picker tool.

    I also thought about storyng the picked colors rgb values and then count the colored pixels on the fly.

    But I'm not sure how to do that. I could use getred(mouse.x,mouse.y) etc., but I don't know what to do if the brush is not 1, but 10 pixels wide. Also it would be complicated if I implement a paint bucket / fill tool.

    I would like to know what I did wrong with my events. Maybe someone has an idea.

Nilom's avatar

Nilom

Member since 26 Dec, 2019

Twitter
Nilom has 1 followers

Trophy Case

  • 4-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • x2
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

9/44
How to earn trophies