Rable's Forum Posts

  • 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!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • Yes it's a top-down view. I think pathfinding is a good suggestion, I'll try that in a first time and see how it goes.

    Thanks for the help!

  • I'd like to make a character move on a Final Fantasy-like "wold map", but controlled by the mouse.

    To do this, I use Bullet behavior, and when the mouse button is down, I enable the bullet behavior in the angle between the character and the mouse position to make it move toward the cursor. Works wonder.

    My only problem is that I'd like my character to be stopped by background elements (trees, rocks, etc.) but I don't see an easy way to stop my bullet behavior when a collision is detected. There is a bounce off solids option, but it makes my object bounce (for some reason, even teleport away), and I just want it to stop, or rather, slide along the obstacle.

    The weird thing is, a few hours ago, the thing behaved just how I wanted to, and despite having the same events and same behavior, now the character truly teleports away from obstacle when touching one. :-/

    I just want it to slide smoothly along the obstacle like with the 8 directions behavior.

    Any idea of how to fix it, or is there another way to achieve this without using the bullet behavior?

  • zenox98

    No, this is to create a complete even, i.e. you have to define what's in it. What I mean is just to create a blank event, so it's much quicker to create. It is meant to be deleted 3 seconds later anyway.

    DrewMelton

    That's exactly what I'm doing, but a shortcut to create a blank event above will be much more time-efficient.

  • When I type to select an object (when creating an action or a condition), if I type "sorcerer" and I have two objects "sorcerer" and "HPsorcerer", HPsorcerer will always come first, so that I am forced to still select it with my mouse despite I writed down the whole object name.

    In my opinion, the first results should be the objects which have their first letter the same as the first letter that I wrote down, not the objects which names come first in the alphabetical order.

    This would avoid me to have "enemyTouchBox" come first when I write "touch", and thus to have me grab my mouse to double click on it, while I could otherwise just press enter.

  • This is something that would be very useful to me, but I can't find the keyboard shortcut in the manual.

    If I have a whole bunch of event copied and just want to copy them on the same level than a subevent.

    Or if I want to make some event the subevents of what's in the clipboard, I could just create a blank sub-event above, copy my clipboard event below it, delete the blank sub-event, then move the previously existing events to subevents of what I just pasted.

    Not sure this is clear, but anyway, this would definitely save time in the event sheets.