OlivierC's Forum Posts

  • the way I did it for my game: I design my level in a separate layout or projec and I add an empty textbox. In the event sheet I create an empty string global variable. When I loop trough the elements i want to save, I build an xml string by adding up information about my objects in xml format (position, size, type of sprite...). when it's done building the xml string, I output it in th textbox. And voila, i run the layout and i just need to copy/paste the text into a file. Then in the actual game I parse the xml and rebuild the level. Might not be ideal, but it works fine for me.

  • The alert function is already available, no extra plugin needed, it's an action of the Browser plugin. The interest of using the default alert over a custom message box is that it freezes the browser when displayed, in some cases it can be useful (like if you want to force the user to refresh the game because an update is available)

  • My game is not isommetric but a point and click, but here is how I did: I had the pathfinding behavior attached to a dummy invisible sprie and the character animation sprite pinned to the dummy, pinned by position only, no rotation. Then for the pathfinding behavior, make sure the "rotate object" property is set to yes.

    Then in the event sheet, I test if the dummy is moving along the sprite and as subevent, I test its angle. If it's between -45 and +45, I set the animation to right. if between 46 and 135, animation to bottom. Between 136 and 225, animation to left (or mirrored right), and if between -134 and -46, animation to top.

    You can see i in acion here

  • Is that the easiest way?ithout plugin, yes. If you really want to use a bullet behavior, set the bullet properties "Set angle" to No and "initial state" to disable. Then in the Drop event, use the action "Set angle of motion" to angle(Self.X,Self.Y,purple.x,purple.y) and enable the behavior. Then create an event for when the arrow overlap the purple square where you disable the behavior. You can also disable the dragdrop behavior when you enable the bullet, and reenable it when it overlap the square, this way user cannot try to grab the arrow while it's moving. Or you can allow it and cancel the bullet in the drag start event.

  • yeah but your approach only works if the enemy has already reached its destination. So if all the enemies are assigned targets at the same time, which is likely, it won't work. Plus, it's a matter of taste, but I'd rather have an array than managing extra dummy sprites and having to clean up garbage

  • You can store the occupied destinations in a array (by storing the destination instance ID or an actual XY position) then when you want to send an enemy to a destination, you loop through the destination instances and check for each if that destination is already in the array or not. If it is, skip it, else, add it to the array and send the enemy there. This should work until each destination has been assigned an enemy, then it's to you to see what you want to do from here

  • I'm nowhere near to having something ready to put up on Steam greenlight, but if that ever happens, it will be very useful. Thanks for the info

  • Just set "Pause on unfocus" to No in the project properties

    Edit: my bad, I forgot that's only for preview. Indeed, using the Browser plugin with the "on suspended" and "on resumed" triggers, you can compare how much time has elapsed between the two events.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • just select the object first by comparing instance variable, then find path to that object?

  • Where you can turn them into Beziers with tangent arms that can be controlled so you can create more complex shapes with less points.ess points maybe, but the collision computation would be a lot more complex

  • OlivierC: That might be a option, but dont you think its making crowd of xml files, I mean I have at least 65+ translations to do in 10 languages. So wont it take much space and slow the performance ? (just asking).Actually, regarding performances, I think it's more wasteful to have everything stored inside the construct project itself, people will have to load everything, including all the text for the languages they are not going to need, while by storing the text in separate XML file, they only load the on they need. Plus, you need to correct a typo or modify something? no problem with XML, edit the file, re-upload, done. You can even edit it directly online. Within the construct project, open the project, edit your big-ass array, re-export everything, re-upload the whole game...

    mindfaQ: Yeah it's true, but I try to avoid plugins when possible, and in that case, XML works just fine for me

  • for my project I went a much easier way. I have several XML files, one for each language, with a unique suffix for each language: menus_en.xml, menus_fr.xml, dialogues_en.xml, dialogues_fr.xml...

    Then in the game, I just have a global variable "language", which I set to "en" for english or "fr" for french. Then I just load the xml files with ajax by providing the parameter "menus_2&language. By keeping the text outside of construct, it is easier to edit, maintain or to add new languages.

    In fact I also detect the browser's language with the Browser plugin. If it matches one of the supported languages, it will set to that language by default, else it loads english. But you must still give the user the option to change it manually.

  • One way would be to send the snapshot URL to a server script with AJAX. there are many image libraries for PHP, which allow you to do such things. Then you can retrieve the URL of the new generated image when the ajax request completes, and invoke download

    Maybe it is possible to do it on the client side only, but I don't know how

  • Hi,

    I use a layer for transition in my game. For the "iris" effect I need the layer to have the "destination in" blend mode, it works fine. I want to use the same layer to make a fade transition, but it's buggy because of the "destination in" blend mode. I'd like to be able to change the blend mode at runtime, depending on the transition, but there does not seem to be any action available for that at the layer level. It's no big deal, I can create a separate layer for this effect, but I thought it would not be that hard to add since layers already have actions to change pretty much all their settings and that you can change the blend mode on other object. Just my 2 cents :)

    Edit: I found a workaround, when "destination in" is enable, you pretty much create the fade effect by reversing the opacity (going from 0 to 100 instead of 100 to 0 and vice versa). I works for now, but ideally it would be better to simply be able to change blend mode at runtime

  • It does not seems to be supported by Construct, if it was, it would probably be in the Browser plugin and I can find anything. However, it is possible with javascript, using the window.print() function. So you can try using the "Execute javascript" action, also from the Browser plugin.

    But I don't think you'll be able to print the canvas in it's current state anyway. You'll probably get what the page looks like before the game loads, not much. It requires more work, taking a snapshot, inject that image somewhere on the page, print that, then remove it and return to the game, not worth the trouble.