Guizmus's Recent Forum Activity

  • Well, the PS wasn't mandatory, I think we understood that this could upset you. To be clear, reading your post, I started to see the problem coming at the point 4.

    Duplicating a layout is duplicating a layout, and copy/past everything that is inside. It isn't cloning object types. Object types are common to your project, so if you add or remove a behavior on an object, it affects all instances of this object, no matter what layout it is in. Why ? Because it is common to use the same objects in different layouts. It is understandable when you look at the project window in C2, as the objects are not in a "layout directory", but in their own directory.

    Event sheet from the first layout aren't used in the second layout, unless you include them, it's the object configuration that is common, and that is most likely what went wrong here.

    There is nothing we can do here, it's too late, unless you kept a backup somewhere, or didn't close C2 for a while (Ctrl+Z is then your friend). Your problem wasn't duplication, but modification of used elements to fit your other layout.

    EDIT/PS : seems DUTOIT and me understood you differently here. I hope your problem was the one DUTOIT understood ^^

  • What do you mean by "supported format" ?

    Something that would format your json if not formated right in order to load an array from it ? no.

    A way to get data from a given JSON without loading it in an object ? yes : javascript. The system object has "execJS" action, that will execute a JS string and return the return value (if used inline). In this context, if X is your JSON string, you can execJS("var a ="&X). This will set the window.a variable to the content of the JSON. You will then be able to access data from a using execJS again.

  • I made this example showing different uses of functions. This isn't a tutorial nor a video, but it's a start, and a commented capx of every type of function calls in C2.

    Of course the manual is a good start, but I'm sure you took a look at it already

  • You can try out procedural level generation, but in a case like Motherload, I would just go with some smart randoms.

    First, start by filling your level with the standard tile (grass on top, then dirt everywhere else).

    In a second time, depending on the ore distribution you need, do a random on each layer to see what tile to change into an ore, and repeat for each layer until the bottom of the level.

    Example, if you want :

    • 1000 tiles width
    • 30% stone
    • 5% gold

    on one layer Y, then you should have around 300 stones and 50 gold on this layer. So in a "for" loop, go form 1 to 300 (then from 1 to 50), and replace the tile at X=random(1000,Y) with stone (then with gold).

    Repeat this for each layer, changing the % depending on Y (you may want more gold in higher depths), and you should be good.

  • This may not work because you change layout. It is possible (i'm not sure) that the "once while true" doesn't work between layouts. In this case, functions is the way to go. Keep updating "currentLayout" like you do, but after substracting/adding one to currentLayout, call a function "changeLayout" in witch you put all the other events. Remove the "once while true" if you do so.

    This way, those events won't be evaluated every tick, but only when the user clicks on sprLeft or sprRight.

  • You've got it, but it's On AJAX complete -> execJS(Ajax.LastData)

    I'm not on my computer right now, I'll add an example later.

  • It all depends how you do it. As long as the event sheets you include don't have unnecessary evaluations every tick, it shouldn't be a problem. As onFunction events are real triggers, this will not influence the performances.

    For more intensive group of events that act only on one object, you could put them in a group and toggle activation of this group on creation/destruction of the corresponding object.

    To sum up, what you want to do is CPU friendly as long as you include only what you need where you need it.

  • If you retrieve the string from the js file using Ajax, you can execJS this script and it will immediately be usable.

    To check if a function is defined, typeof(myFunction) == "undefined" should do the trick.

    Rexrainbow's solution is better than mine though, you should try it this way.

  • I don't think you can have a trigger in C2 "on load" for this.

    But you could, after the first execJS action where you happen the script, activate a group in C2. This group would just have one event, a condition checking in the FunctionA is defined. Once this event gets triggered (aka the library is loaded), you can call a function in your events that will handle the next steps, and un-activate this group.

    Or you could have your external script do an action on load, like simulate a click on a button. If you added this button in C2 (setting an ID, making it invisible), the event "onclick" (the C2's one, in the event sheet) should be triggered.

  • You should ask a big friend of us all those questions : google... It's not that hard, and sure will be in the first page of results...

    Publishing on the Apple app store requires a dev account, so it's around 100€ I think (not sure right now), and then you can submit games, and hope they are accepted.

    On facebook it's free, but again, google and tutorials are the best to help you. Like this one.

  • Well, Joskin is kind of right you know, you come on a forum with developement help, and ask for a finished game to package and distribute... I thought I would just stop at my first sentense since you didn't search for it either. Glad if it helps though...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Basicaly, you want a game made and then change sprites ? Sorry don't have that. I have hints on how to make one yourself though if you like.

    CookieClicker is an incremental game, and I know you can even find some "incremental game generator" online, where you only have to replace assets, and choose building types, power, prices, ... Orteil (the one behind coockie clicker) even made one (here is the help section, the game maker is under maintenance).

    As for the coockie clicker game, it's realy not that hard to build. It's a sprite that you click, it does some effects, it adds each time points to a cookie total. Buildings are also just sprites, a base price, and a counter of how many you have. Everything else is calculated every tick with good old maths, functions, ... and finaly displayed.

    One last thing, if you are going to make one of those games, try to take a look at this article on coockie clicker, explaining how it did things right.

Guizmus's avatar

Guizmus

Member since 26 Mar, 2013

None one is following Guizmus yet!

Trophy Case

  • 11-Year Club
  • x4
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies