Rable's Forum Posts

  • Hi,

    I tried to implement a more complete Save/Load system into my game, using the system actions "Save" and "Load". I was previously using Webstorage with good result, but as I am developping a much more complete desktop version, I would like to change the way the game saves.

    Up to now, I have very mitigated success with the Save/Load system actions. the game loads at the right place, but when I launch a level afterward, enemies are not attacking... for the complete game!

    This is a bug I never have when playing the game normally, so I wonder how this could happen and how I can resolve it.

    I checked this tutorial, which states that the only things that are not saved are :

    • Input state (i.e. mouse position, or whether the player was holding keys or touches)
    • AJAX requests
    • WebSocket connections
    • The XML object
    • User Media video or audio feeds
    • Facebook login
    • WebStorage state
    • CocoonJS/Windows 8 state
    • Any in-app purchases on any platform
    • Anything with the 'No Save' behavior

    But I don't think my problem could be related to any of these. I tried to save my game at different times, on 3 different layouts and it wasn't better. I thought it could be due to Save not getting the groups in the right state (activated/deactivated) so I copied my "group management" group (putting each group correct at the beginning of a layout) before loading the game, but it didn't change anything (thus I suppose each group state is loaded).

    I save and load on the same computer and same game version (I just play 2 minutes, then try to load)

    Could it be due to the fact that I was previewing the game inside Construct 2?

    Any idea of what I may do wrong?

  • Problem fixed! Indeed "Global" was set to yes. I've set it to No, and it fixed everything!

    Thanks a lot!

  • Hi everyone,

    I'm experiencing a very weird "bug" (though probably a mistake on my part) with an object. Here is the simplified situation :

    I have a layout1 and a layout2. and I have to pass from one to another. When doing so, one object does not disappear. Always the same object, and only this one.

    Concretely, this object appears on the layout 2, but is never created, spawned or something else on layout 1. Still, when switching from layout 2 to layout 1, the object stays there, at the same size and same position than it was on layout 2. I tried to create multiple instances of this object on layout 2 and they all appear on layout 1.

    Even more surprising, if I destroy this object at the start of layout 1 (which was my only solution), it is also destroyed on layout 2 !

    I already had the same problem with the same object when going from layout 0 to layout 1.

    EDIT : I foud a solution to my problem : I destroy Object 1 at the start of Layout 1, and destroy it also at the start of layout 2, then recreates a new object just afterwards. But this sounds like a workaround. Does someone have an explanation of what's happening?

  • nimos100

    It worked out! Thanks a lot, it really helps + I learned a lot!

    Instance variable in families is definitely something I will use in the future.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • nimos100

    Thanks for the reply!

    [quote:32bvka2k]If you just need to select a random enemy on the your combat screen you can use "Pick random instance" from the system tab, and then you of course just choose the family as being the object.

    Yes it could work, but there is one subtility : there are (up to) 3 enemies on the front line, and up to 3 enemies in the back line. So I'm selecting a number between 0 an 2 and the ally attacks the line of enemies corresponding to this number. If the enemy on the first row of this line is already dead, the ally attacks the back line enemy of this same row instead. Now if I'm selecting an instance at random, the allies won't attack enemies on the back line before every enemies on the front line are dead, and that's a problem.

    I probably misexplained myself, as I never need to select an enemy type at random. This will be based on the current level. However what I need to do is to select one given instance of an enemy type, based upon a predefined instance variable which is equal to 0, 1 or 2 (the "number" variable, which defines the row number, so that the ally could attack the back line enemy sharing this number with the front line enemy, if the front line enemy is dead).

    So it can't be an instance at random, I'm afraid.

  • I'm already facing a problem actually. I need to select one of the enemies at random, so after selecting the enemy family just as you stated, how could I do that?

    In my code I made

    pick enemy where enemy.number=randomValue (targetArcher in my code)

    so that I select only one instance at random

    but as now it could be any sort of enemy (as I'm just selecting a family's UID), I don't see how to do that...

    The idea would be to pick fam_enemies where fam_enemies.UID = Param(0) and then check the "number" instance variable of each instances of the selected object type to select the correct instance. Is it possible to do this, given it could be any enemy type?

    I think that if there is a solution to this, it should work perfectly!

    Thanks again!

  • nimos100

    Hi and thanks a lot for your help.

    I really believe your solution should work in my game, and I'm ready to pass a few hours or days optimizing this part of the code, I'm sure it will be worth it + mastering it is time well spent.

    If I understand correctly, the code you are describing couldn't work without using families, right?

    Thanks again! I'll try your solution today!

  • Hi,

    I'd like to update some of my game's code so that it could be more efficient and easy to deal with.

    Here is the result I want :

    In Healer Quest, each level is the same layout and same event sheet, but sees you fighting different enemies. I would like all the 4 player's characters to automatically attack enemies at random based on the current level (selecting a valid target).

    There are enemies on the first line and enemies on the second line, and of course they should attack enemies on the front line first (refer to my signature for a visual clue, even though there is only first line enemies in the picture).

    Here is how I did it :

    For each playable character, I made a huge list of all levels (more than 100) and the code looks like this :

    (...)

    Level = 32 (you are fighting rats (1st line enemies) and bats (second line enemies))

    Rat is visible

    Pick random rat instance and deal damage to it

    Else Bat is visible

    Pick random Bat instance and deal damage to it

    Level = 33 (you are fighting thieves (1st line enemies) and knifeThrowers (second line enemies))

    thief is visible

    Pick random thief instance and deal damage to it

    Else knifeThrower is visible

    Pick random knifeThrower instance and deal damage to it

    (...)

    What I would like to change :

    Right now, if I want to change something in the way damage is dealt to monsters, I need to update more than 800 events! And I will need to update this code many times in the following months... So I'm looking for a solution to avoid this.

    I hoped I would be able to do this with functions, but if I'm correct, it appears that functions doesn't allow to define a certain object to which the function should be applied.

    Is there any simpler way to deal with that part of the code?

    Thanks in advance for any ideas!

  • Glad this has been useful to you.

    Good luck!

  • gumshoe2029

    Thanks a lot for your ideas and sorry for the very late reply.

    Actually it is an image sequence from which I made an image sequence. The problem with the image sequence in a sprite is that if I'm correct, these images will be used uncompressed in the code, and thus very very heavy! And there are a lot of them... Around 300 actually, which would make using them as an image sequence in an object impossible.

    Thanks a lot for your kind words on Healer Quest! The good news is that a PC, Mac and Linux version of Healer Quest is under construction.

  • Hi,

    I would like to create an effect similar to what is displayed here : http://codepen.io/ollieRogers/pen/lfeLc

    i.e. viewing a video based on a slider.

    To do so, I created a sliderBar, a video and the following code :

    On sliderBar value change -- > set video playtime to sliderBar.value/30

    The code works nicely, but in Construct's preview (Chrome) the result can't be used because I have around 1 or 2 frames per second.

    My video's weight is about 3M in WebM, and 10 Mb in H.264 Mpeg4. (1280x1080 - 300 frames)

    Any idea of what could be wrong and if I can achieve a better result?

    Thanks!

  • Just to keep this updated, I created a new provisionning profile with Distribution / Ad Hoc instead of Development, here :

    https://developer.apple.com/account/ios ... ate.action

    and just updated this provisionning profile. The build was successful. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    EDIT

    grigrizljac

    Once you have a successful build, you can very easily install it on your mobile device via http://www.diawi.com/

    I've got my game running on my iPad! <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    Good luck <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

  • grigrizljac

    Thank you once again for your help.

    badwolf

    Thanks for your kind words!

  • Hello,

    I already have a game published on iOS, and I would like to have a playable build of my next game on my iPad.

    For some reason I am unable to achieve this. Builds keep failing in XDK, with the only hint being "An unexpected error occured while attempting to build the application."

    I created the icons, splash screens, a new app ID, new provisionning profile and took back the certificate I used for my previous game, as stated here : https://www.scirra.com/tutorials/1353/h ... lkphonegap

    So I have no idea of what's the problem and would like to know if any of you know a simple way to have a prototype running on a test device. I don't want to upload to the App Store right now, just be able to show the prototype in a professional way.

    Thanks!

  • I figured out where my problem was coming from. It seems to be a bug caused by the fact that I resized my character (the "bullet" + "scroll to" object) inside Construct 2. It works fine as long as it is a single sprite, but when you resize

    multiple sprites to make an animation, the sprite is suddenly bouncing against solids. It did so with bullet, but also 8 direction and even MoveTo (from rexrainbow ) behaviors, with or without "Poushoutsolid" behavior.

    Once the problem was identified, it was an easy fix. I just resized all the images in photoshop, and now it works fine.

    I'm glad I asked this because the PushOutSolids and MoveTo behaviors are really great! I'll probably use these rather than my old bullet solution.