Pulstar's Recent Forum Activity

  • Check the collision polygon shape of the button sprites. Maybe the "guessed" shape got mangled up and you need to shape it manually.

  • Use a custom string to mark newlines in the text inside the XML. I used "\n\". When retrieving the text from the XML I used replace() to replace all instances of "\n\" with newline (without quotes around the newline).

  • Sup with that? The problem with using normal functions, is that you cannot use it with multiple objects. Say you have a bunch of enemys, and you attack one. If you use normal functions, every single enemy takes damage.

    You can, you just need to use pick by uid in subevents of the function. Here's an example where I pass the attacker's uid and the defenders uid in separate parameters of the function (my function object is called f):

    http://imgur.com/a/qSRqc

    Of course if I need something from the attacker (a variable value) in a sub-event where the defender is picked I use pick all to reset picks and pick by UID attacker again. Although I prefer to just store everything I need in variables local to the function.

  • The best way to do it is to use bezier curves, they are rather intuitive. Look up the math on wikipedia. Depending if you just need simple curves or very windy paths you can use more control points.

    However drawing good looking curves in C2 is not exactly easy. The best I could come up with is using small sprite sections, calculating the slope at the point in which the section is placed, rotating it to the angle of the slope and so on. Unfortunately you easily end up with hundreds of sprites just for that. That might impact performance. Maybe there is a plugin that does that better.

    However if you just want calculate a curve and translate it into a set of tiles constituting a path that you autotile, the whole thing become much simpler. No need for calculating the slope, sprite/object count goes down.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In your capx do the following

    Instead of :

    set width: Sprite35.Min+1+experience.nextLevel

    Do:

    set width: Sprite35.Min+1+((experience.experience/experience.nextLevel)*124)

    This way sprite35's width will always go up only to 125 and the width will be (nearly) proportional to the fraction of experience you have out of total needed to level up. So it will increase slower with each level (assuming experience gained from defeating foes stays the same).

    Also you can use a 9-patch object for an experience bar as it can be tiled easily/expanded easily without stretching it so it can look prettier.

  • My recommendation is to first get the easystar behaviour for tilemaps if you are using a square grid like AW did. I use it myself for my projects and its fantastic. It is possible to recreate its functionality with events but believe me it is faster to have a plugin/behaviour for this rather than do it via events. And by faster I mean it will use less CPU power.

    You can also get the move to plugin as well and see how the demo of easy star with move to works (found in the topic below):

    Basically you need two things. You need pathfinding functionality with diagonal movement disabled (easystar can be set to do that) that returns a list of tiles describing the path (easystar does this, accessing it might be a bit tricky at first). You also need something to move a unit along the path (after the tile is clicked/selected).

  • > For those who don't like subscriptions, but demand console export:

    > https://www.yoyogames.com/blog/437/game ... ts-out-now

    >

    Wow. I expected a high price tag for GMS, but nothing like that, and it's only for 12 months.

    I just read a dev response at their forums and apparently the sudden price hike is because in the past Sony and Microsoft "subsidised" the console export development and support of GMS (including support for getting all those certifications and other occult rituals the console companies demand before you can ship). Now they need to pay it out of their own pockets so the cost was offset to GMS users, so they introduced the subscription model for those platforms.

    Makes me wonder if Unity can afford lower subscriptions due to economics of scale.

    Also I googled a bit about TRCs for console development and to my shock console development is even more of a pain than I thought.

  • Yes, see example below. You need to use the layeropacity system expression to get the current opacity of the layer and then set it to:

    layeropacity+percentage of opacity per second*dt every tick.

    https://www.dropbox.com/s/jtqpq5cksqk53 ... .capx?dl=1

  • Just for my own understanding... (because I keep seeing this subject pop up and I never understand it)

    I am quite deep into my project,

    must be 600 events in total now,

    In game I am creating dozens of enemies and in subsequent events or sub events I am changing their instance variables, positions and pining stuff to them etc at the point of creation. and as far as I can see everything is working well and smoothly. I have never ever needed to use wait 0 seconds for a anything, I don't even know why or when I would need to use it, it sounds like a hack, could someone enlighten me?

    I use it when I need to evaluate all objects with a function after they are created.

    For example I have a radar minimap made with a tilemap. In order to drawn enemy positions on the minimap I have a function, the function uses for each enemy set tile at x = radar.positiontotilex(enemy.x) and y = radar.positiontotilex(enemy.y) to a tile representing an enemy. Since it is not necessary to refresh the radar map every tick (for each is fairly expensive CPU utilization-wise), I only call the radar refreshing function when needed.

    That is to say it the bare minimum when it needs to be called is when an entity that can move changes its current location to another tile or when new enemies are created. But if I call it without wait 0 after creating new enemies those new enemies will not show up on the map.

    Of course there are workarounds which would achieve the same thing for this example, but they all would require adding more new actions than just "wait 0, call function". Less events is better if the performance penalty is not material (less to change/debug if you decide to revise something). Sometimes it is a matter of convenience, there are probably a few cases where it is absolutely necessary and cannot be achieved otherwise. But to be honest nothing comes to my mind at the moment.

    Another use is if you want to make buttons with sprites that have different frames/animation when they are pressed. You can do the pressed/unpressed change in one event:

    conditions

    mouse over object, left mouse button down

    actions

    set frame 1 (pressed)

    wait 0

    set frame 0 (unpressed)

    The effect is that once the mouse stops being over the button sprite it will revert to the previous state by itself. However if the mouse is still over the button, the frame 0 will be changed to frame 1 anyway and the user will not see it has changed. No need to check if it was pressed but the mouse is no longer over it.

  • No and I won't. I do not see any gain for myself that would justify the extra expense over what I have with C2. The extra features are nice to have but not in the area of "I really really need this". And that is before considering my dislike for the web-based tool model.

    Also after my time with C2 I decided that in the long run I need a slightly different tool, harder to use maybe but more flexible in other aspects and with features that are not present in C2. The C3 announcement basically convinced me to buy that different tool (and I paid once for it). I was already kind of on the fence before but I was eager to see what C3 will feature, unfortunately the direction C3 is taking is simply not the one I would prefer.

  • One approach, since you are drawing/showing the connections anyway, is to store the end point nodes of a connection in two variables in the connection object (A and B in the example I added). When you arrive at a new node (via FTL jump, portal or whatever) you store all the connection where your current location is one of the end points in an array (A = node or B = node). Then all you need to do is cycle through the array's indexes based on input.

    Capx example using arrows, the random generation is a bit crude (in the way that the paths cross unlike in FTL). But you are more interested in how to store connection information and how to cycle the chosen paths from what I understand.

    https://www.dropbox.com/s/be1lanyiv7fe6 ... .capx?dl=1

  • The way I do it is that I use a 2D array for this. In your case this would be a (12.2.1) size array.

    I store the values I want to shuffle at y=1.

    At y=0 for each x element of the array I store a random number. Then I sort the array using the x axis as always the element at y=0 will be taken for sorting. Repeat this every arbitrary number of seconds.

    Example capx, after 1 second the first random sort will show then the next for values from 0 to 11:

    https://www.dropbox.com/s/b3bf1exx745z2 ... .capx?dl=1

Pulstar's avatar

Pulstar

Member since 10 Jan, 2016

None one is following Pulstar yet!

Trophy Case

  • 8-Year Club
  • Email Verified

Progress

9/44
How to earn trophies