oosyrag's Forum Posts

  • If you want new random every battle, why not just set RandomMonster to choose(...)?

    I guess you want to set a list of which monsters you can choose from before going into the battle. In that case I would create an array - Start with a width of 0, and then push to fill it with the possible choices, then in the battle layout set RandomMonster to Array.At(floor(random(Array.Width)).

    That's the first thing I could think of, there might be an easier way, maybe someone else could chime in.

  • When you put "choose(1,2,3,4,5,6,7)" inside quotation marks as you have, it is no longer an expression, but a string.

    I don't think you can have an expression inside a variable. Are you trying to have the random number picked when you go into the next layout? Or have the next layout pick the random number?

    You can:

    1. Use an action to set your GLOBAL_MONSG variable to choose(1,2,3,4,5,6,7), in which case a random number whole number between and including 1 and 7 will be stored in the variable. Then you can set RandomMonster to GLOBAL_MONSG and get the same number.

    2. Use a function that returns "choose(1,2,3,4,5,6,7)", and have your action set your RandomMonster variable to your function output.

  • I'm going to guess that the previous instance isn't disappearing, but after you make a new instance, both of them get set to the exact same spot.

    What is the purpose of the second event running every x seconds? This is what is causing all the instances of your tent objects to be set on the same spot.

  • Either -

    1. Store the destination in a variable and lerp to the variable.

    2. Create an invisible object at the destination and lerp to the object.

  • When objects are created, they are immediately picked by default, so any actions you have affecting this object only affects the newly created instance within the same event.

    A more advanced topic would be if you wanted to specify only the last created instance of an object in an expression - you can do this with the IID - Sprite(-1).Expression, where the -1 represents the last created instance of this object. https://www.scirra.com/manual/78/expressions

  • Why are you unable to compare the entered data with the variables?

    Are you using quotes for your strings?

  • A simple way would be to put the 'do something' part in a function, and have two separate events. Or just copy the actions again in both events.

    Cond1 is true | call DoSomething()

    Cond2 is true |

    Cond3 is true| call DoSomething()

  • I would create an object for each type of weapon that that has similar properties. For example, a single object might contain swords and daggers, and another might contain bows. Each frame in that object would be the variations of looks of that type of weapon, basically reskins. This would separate out your total weapons into several spritesheets, aiding in the loading issue.

    As for your reference/object id problem, you can use Constants if you like to refer to your object by name rather than number

    ie.

    Rapier=72

    ChickenSlicer=73

    You can use these in function, or anywhere -

    On Call EquipBlade(ChickenSlicer) - Create BladeObject, Set BladeObject animation frame to (param0). This would create the object and set it to frame 73. Constants are also easy to change in case your animation frame changes, besides which it is also pretty easy to reorder your frames in the editor.

    If all of your weapons have unique properties, it would make a lot of sense to use an array to store the data. When you get to a huge amount of unique weapons, it becomes much more manageable to keep track/edit in a spreadsheet program, and import it via project files as a CSV or XML to parse into an array on load.

    If you're worried about loading a whole bunch of weapons you don't need at once, again, you can use project files to load only the sprites you need on demand at runtime.

    Basically if you're objective is to create objects via expressions and strings, your best bet still is to utilize constants and animation frames.

    In the end, you mention best practices, but it is a pretty common advice here regarding optimization - unless you can notice a difference in practice, it is best not to worry about it and focus first on your game mechanics. I don't think it would be a big deal/difference to download 10 or 30 or 50 weapon sprites/frames in one object versus splitting them into 2 or 10 or 50 different objects. How many unique weapons do you have?

  • You can use families.

    To prevent from scrolling offscreen, you would use conditions to limit the event to only work within the range you specify.

  • I've never used it myself, so maybe someone else can answer better, but that's where I would start myself if I were looking.

  • The hackier/simpler way that I thought of first was just to check the distance between the center of the patty and the center of the bun. Unless there is a reason you need to get the specific area overlapped - and that can still be calculated from the distance if both shapes are fixed size circles.

    When you have irregular shapes or multiple instances of shapes, it gets more complicated though, and I don't have a quick answer for that.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you use layers, you might be able to play around with parallax to get only that layer to scroll.

    You don't have to use layers though, you can just place and move your menu sprites up and down specifically.

  • Depends on how you set up your multiplayer architecture.

    If your game is hosted by a dedicated server, the server can keep track/log all your statistics.

    If it is peer to peer, do you have some sort of login system/database? By the same method you use to log in, you can also send statistics to the database to save.

    Any backend you use should have a way to communicate and save data.

    If you mean local multiplayer, then you'll need to set up something like Firebase.

  • There are a lot of Parse alternatives, and Rex also has a set of Firebase plugins. http://c2rexplugins.weebly.com/

    If you're looking to make no changes, you'll probably need to build your own Parse server, which is now open source. Here is the tutorial/guide - https://github.com/ParsePlatform/parse- ... #migrating

  • A server - computer that is always on. What you do/put on the server is up to you. Where the server is located is also up to you.

    You can build/run your own server at home or work, or you can rent a space in a colocation and host your server there.

    Or you can rent someone else's server if you don't have your own. Or you can rent a virtual machine that's on someone else's shared physical server.

    Basically once you have your server (it can run windows, linux, whatever you install/rent), you'll open a browser on it, log into your game, and leave it on. Going to recommend not using windows, as it tends to restart itself for updates and not turn back on unless you really know what you're doing.