bowiz2's Forum Posts

  • Warning: There's a bit of a long read ahead. But try and get through it, I put a ton of thought into this and I think it's worth your time

    Construct 2 plays a very difficult game - a great balancing act of making an engine simple enough for non-programmers to use while maintaining the

    flexibility and complexity required by advanced developers. And it does this brilliantly - mostly.

    One feature, which is commonplace in just about every high level OOP language, seems to be neglected and forgotten about, even though it is

    crucial to almost every modern day application.

    I am talking, of course, about Classes. You know, those customizable objects with their own properties and variables.

    "So you mean Sprites?" I can hear you asking.

    Well, sort of.

    While Sprites do have the ability to store information in themselves through Instance Variables, I feel that they are severly limited. First of all, using a

    Sprite to store data just seems strange. I mean, sure, I can spawn new ones off the layout with their own variable values, but that seems way too

    much like a workaround rather than a feature. And I'm fairly certain that the process of creating a sprite, albeit offscreen, is far more resource

    intensive than manipulating much simpler data.

    Second of all, there are only three (3!!!) data types available for instance variables - Number, Boolean, and Text. While this may work for simple

    things, it is borderline unusable for more complex problems.

    Let's take an example:

    Let's say I'm making a pizzeria simulation game. A customer calls and places an order, and I need to fill out the order properly, through mini games

    and memorization. Stuff like remembering toppings, customer details, slice cutting, seasoning, and the works. Sounds simple, right? But let's look at

    the classes and properites needed:

    Customer - First Name(text), Last Name(text), Phone Number(number), Address(text), Slices Ordered(???)[/code:23trtued]
    
    If I were to use a conventional programming language, this would be very simple. I would simply create a Slice class that looks like this:
    
    [code:23trtued]Slice - Toppings(text array)[/code:23trtued]
    
    And then make the Slices Ordered property be an array of Slice objects.
    
    [code:23trtued]Customer - First Name(text), Last Name(text), Phone Number(number), Address(text), Slices Ordered(Slice array)[/code:23trtued]
    
    While simple through conventional programming, [b]this is ridiculously difficult in Construct 2.[/b]
    
    Sprites cannot have arrays, dictionaries, or other Sprites (or even anything remotely object related) as an Instance Variable. So instead, I'd have to 
    resort to using confusing, sideways solutions like using 3D global arrays (for something so obviously non global!) as subsitutes and just parsing 
    through row, column, and depth for each property, value (which can be an array!), and customer respectivly. And parsing that is hell. And should be 
    entirely unnecessary.
    
    I hope you see my problem by now.
    
    [i]"So, what's your solution?"[/i] I can hear you asking.
    
    Well, it's definitely not going to be easy to implement, but I definitely think it's possible, and necessary. Please note that this is just how I envision 
    this, and is definitely not the only way to do this.
    
    So you double click the screen, and add a "Class" object. It's added to your object bar, but not shown on screen, like an array or dictionary. When 
    selected, it shows the "Object type properties", "Container", and an "Variables" bar (just to avoid confusion with Instance Variables. You'll see why in 
    a second). The only thing that is different here is that the Variables bar (which has an "Add/Edit" option, like we're used to) when clicked, and after 
    pressing the add button, the available types shown are: Number, Boolean, Text, Array, Dictionary, and [i]any other classes that you have created 
    on this layout[/i]. If the Array or Dictionary options are selected, the Initial Value field expands to contain all of an Array's or Dictionary's starting 
    Properties panel (in the case of an array - width, height, and depth), and in the case of a Class, all non-complex variables (number, text, boolean) 
    are shown, and then, in a recursive hierarchical fashion, each complex object shows its information until the lowest, only non-complex variable level is 
    reached. Just visualize it like nested dropdown lists, much like [url]http://orteil.dashnet.org/nested[/url].
    
    So you've created your class! Whoo! But be patient - it's not on the layout yet. You've just built the abstract of it. Let's jump to the event sheet and 
    get this thing in our game.
    
    Let's have a look at it's actions. Click "Add Action", and each Class object that you've created appears there, like any other object does. Each class 
    has the actions "Initialize", "Destroy", and "Set Variable" (there could definetly be more, these are just the essentials). "Initialize" opens up a menu 
    box identical to what is shown when setting the Class's default variable values, except at the top it has a "Tag" or "Name" option, much like audio 
    files. This is what will be used whenever you need to access this specific instance of the class. "Destroy" takes a name and destorys the instance 
    related to it. "Set Variable" allows you to set the value of one of the variables in this instance.
    
    So if I want to compare the value of "Name" inside of the instance "customer1" of the Class "Customer" with the string "Bob", I would access it by 
    typing something along the lines of
    
    [code:23trtued]Customer.getInstance("customer1").getValue("Name")[/code:23trtued]
    
    Or if I wanted to get his street number, which is stored in another class called "Address", I would access it by typing
    
    [code:23trtued]Customer.getInstance("customer1").getClass("Address").getValue("Street Number")[/code:23trtued]
    
    Or if I wanted to access an Array of something stored in the customer
    
    [code:23trtued]Customer.getInstance("customer1").getValue("SomeArray").At(1,1,1)[/code:23trtued]
    
    This may seem a bit too programmer-y, but again, this is just the way that I see things, and is completely up to anyone's interpretation.
    
    Condition-wise, there shouldn't be too much, just maybe a "Is Initialized" option or something along those lines.
    
    And that's basically it. So while this may be difficult to implement, it definitely is possible. Thanks for taking your time to read this, and if you have 
    any questions don't hesitate to respond here or shoot me a tweet @bowiz2. I tried to make this as understandable as possible, but I may have failed 
    miserably - so let me know!
    
    Have a great day!
  • I'm trying to add a margin in between list items, and in in the future change the background color of list items dynamically, but using the "Set CSS Style" event doesn't seem to give me access to the actual list items themselves, rather the entire list as a whole.

    Am I missing something, or is this simply not possible?

  • If you think about it, no time travel is needed.

    If I understand your question correctly, what you should do is make a condition in which both A and B happen, and then check for B, wait 1 second, and then check for A.

  • Being an Early Adopter has really paid off - there's no way in hell I could afford C2 if I wanted it now. Though the change does make sense, I just hadn't realized the price of a personal license has reached over 100 dollars.

  • I'd be interested (as a programmer experienced with C2), but I have a few questions first:

    1) What are your actual long term goals? As in, what scale of game do you have in mind (quick pick up and play games, lore heavy rpg, etc.)?

    2) Do you have any past experience working with hobbyist teams?

    3) About how many members are you looking for to join your team?

    Thanks in advance!

  • Arima I realized that, however I still think native support would be better. A quicksave would be one event, and instead of loading everything into the bank and then out, it would do it automatically. But yes, rex's plugin is the best workaround until native support comes out.

  • Tokinsom Fimbul But wouldn't the automatic save also keep all of the sprites the way they were? With all of their own instance variables and such? You could go as in-depth as you want, and just have it all be right there when you need it. You could destroy objects, save, leave the layout, come back, and it would still be destroyed. You go up a level? Your player's sprite's instance variable for 'Level' goes up by 1, his instance variable for 'Strength' goes up by 1, and etc. You would still have plenty of access to whatever variables you wanted.

  • Hey,

    So I came across this post recently, in which Ashley states that the quicksave/quickload function will hopefully be available within the next few stable releases.

    It's been a while since that post, and there is still no sign of it arriving. I know that Scirra has a long to-do list, but I feel that this feature should have a higher priority than most on there.

    First off, the current state of saving in C2 is fine for small games. But once you start getting into more complex layouts and more variables and objects, saving becomes an extremely arduous task. If you look at most of the games on the arcade, they are all small, short and fun games. There are next to no decent length RPG's, adventures, or anything else that requires a simpler way of saving.

    I just think that the lack of this feature is preventing C2 from making the jump from 'mini-game engine' to a full-fledged 'game engine'.

    If this post sounded accusing in any way, I'm sorry. I don't mean to point the finger of blame towards Scirra in any way, means, or form, I'm just trying to present my point in a way that will hopefully show how urgently this feature is needed.

    Thanks for taking the time to read this!

  • Haven't posted in a while, feels good to do so again :D

    Does anyone know how I might go about making a game be playable over LAN? As in having the ability to send variables to other connected computers, like Winsock or something along those lines?

  • It's a nice plugin rfisher, but the maze generation is a bit difficult to understand. There are a lot of parameters that are important (all the grid and height stuff) but I don't understand how they work. A little description would be a nice addition to the plugin post.

  • No problem! Keep me posted if you do anything with it :)

  • Hey,

    I found a plugin for Construct Classic which could generate a random maze or a dungeon. This would be an awesome plugin to see in Construct 2, however I lack the skills to create it myself.

    So basically, is anybody out there up to the challenge of porting this awesome plugin to C2?

    Link to CC post: Click Here

    If that's too difficult, there's also a dungeon generator written in javascript, which should be much easier to turn into a C2 compatible plugin.

    Link to JScript Dungeon Gen:

    Click Here

    Thanks in advance!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Happens to me as well

  • I thought I tried that... obviously not - thanks! It worked!

  • Hey,

    I have a strange problem, which I hope someone can help me with.

    I have 7 toggle buttons, each with a boolean instance variable called "isEnabled". When you press a "Submit" button, a global array which I have is reset to size (0,0,0. Then, I check each toggle button if its isEnabled value is true. If it is, then it does the action: Push Front 2 (or something else) on X axis (its a 1D array). When I cycle through the array, the array is the size of the amount of enabled toggle buttons, which is what I was trying to achieve, but everything in the array is 0. So the array is being pushed and cells are being added, but their value is 0 instead of the specified number.

    Sorry if this is confusing, its a bit hard to explain.

    Thanks in advance!