caiorosisca's Forum Posts

  • Thanks alot both of you guys, for the current time newt 's solution should work fine. Already implemented it and it's all good.

    But I won't be able to use that solution as the project grows, I'll need to choose between layouts, backgrounds, sizes, etc.. so saving just these itens info is really what I want.

    I was just looking for a way to optimize creating all objects one by one, with many creation events.

    I'll try to make something using the instance variable, just not sure yet how to access it. Any help with an example? I mean, once I parse the JSON to an array each index will be an object, I know that all of them are "PlacedObjects(Family)", but how would I acces an instance variable of it?

    Any way I can imagine now would be instantiating a PlacedObject(random), set it to the AsJSON string, get the type instanceVar, then destroy it and call another function CreateObject(type, layer, x, y), which returns instanced object UID.

    Then pick PlacedObjects by UID using the returned UID and set its info to the AsJSON string from the array?

    Any better ideas? This way I would be creating each object twice, not sure on how to use a while loop and have access to the instance variable there.

    Btw I was using array with size(0,1,1)..thanks for clarifying that 99Instances2Go .

  • scirra.com/manual/160/no-save

    newt I really can't think how this can be organized. I would need to have the NoSave behaviour on all objects of my project beside the PlacedObjects family.

    It just feels kinda messy, isn't there a way to make something like what I was going to? I might be missing something.

    By the way I imagine families don't know which object they are from your answer.

  • scirra.com/tutorials/526/how-to-make-savegames

    newt That's a work around to save the whole game state.

    But how should I go about saving only these specific objects?

  • newt , rexrainbow ? Just tagging some people that usually help me and I saw is online now

  • I'm making an level editor and I need to save all placed objects in a json file to be able to load later on.

    I'm doing it like this:

    Save:

    LevelArray.Clear()

    foreach PlacedObjects > LevelArray.Push( PlacedObjects.AsJSON)

    LevelArray.Push( PlacedObjects.Count )

    InvokeDownload ( LevelArray.AsJSON )

    Load:

    LevelArray.LoadFromJson (Ajax.LastData)

    objectsCount.Setvalue(LevelArray.At(0)

    LevelArray.Pop(front)

    Activate group "Set objects from json"

    for( max:objectsCount) > CreateObject (PlacedObjects, "layer", 0,0)

    Deactivate group "Set objects from json"

    Group "Set objects from json":

    PlacedObjects . OnCreated > PlacedObjects.SetFromJSON (LevelArray.At(0)

    LevelArray.Pop (front)

    Placed objects is a family with many different objects, when saving the object state as JSON, does it save which objects it is? Will that be enough for solving my problem?

    Or do I need to divide it for each kind of object?

    Any toughts on that?

  • I just found a solution using Browser.InvokeStringDownload, or something similar to that.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • rexrainbow is there a way to export this xml? I need to download it to my computer.

  • caiorosisca

    rex_XMLWriter

    rexrainbow , so long since last time I used the forum and you are still here saving me. Thanks man

  • Hi guys, I haven't touched Construct for a while and now I'm building a simple level editor to save/load game levels.

    I managed to get all the stuff I want into a text variable but I can't figure out how to create/write a XML file from withting construct, any solution works, I just need to export a file with my text variable content on it. Loading xml files and building the levels already works fine using FileChooser to select the level file.

  • nimos100

    That's not really what was happening because the path didn't have to change at all

    ramones was right on that one, I set rotate object to yes to check and the delay before it started walking was the time it took to rotate.

    Setting rotate speed really high solved the problem.

    Thanks everyone

  • I'm working on a point and click, whenever I click somewhere my character walks to there.

    For some reason the pathfinding seens to take a while before starting to move the character, cell size is pretty big and path is extremely simple, only 1 obstacle, so most of the paths have 2 or 3 nodes only.

    Please check out the wip at http://www.cheny.com.br/puleomuro , click "Jogar" at the bottom right on first screen, and on seconds screen click any character.

    You can press "M" to check out the pathfinding cells.

    That doesn't seem to happen when testing the Pathfinding Template that comes with Construct2. Am I missing something?

    I uploaded a capx representing the problem.

  • Thanks guys, I've managed to get it working, Noncentz's capx lead me to a simple solution, I hadn't used blend modes before, seens like that was what I was looking for.

  • I have a timer that I would like to show using a 'clock effect', something like the transition in this video:

    Subscribe to Construct videos now

    When the time is at maximum it will show a perfect circle, 50% time would be half circle and when time finishes nothing shows up.

    How can I achieve it without needing lots of frames of animation?

  • Thanks newt, had to adjust a little bit to get the expected results but the logic worked for me

  • Hi,

    how can I remove the last part of a string? All the elements are separated by a "," and there's is always another "," at the end.

    String will usually look something like this:

    "Ingrediente8,Ingrediente13,Molho18,Ingrediente2, Ingrediente9"

    I need a way to delete the last element of that string.