Arcticus's Forum Posts

  • Thanks guys!

    Yeah there's still many problems, it's all to do with the order in which it performs the er... ordering. Had I put the player at the top of the map, rather than at the bottom as in this demo, it completely falls on it's head

    This is because it assembles a 2D array using the amount of objects in the family as the width and height, it then uses the array to check each object's position relative to every other one. This also means that each object has to have it's bounding box defined, eg: xFront and xBack.

    The problem is, I check through the array left to right, top to bottom, so some objects don't have the correct relationships set up because they should be in front of/behind other objects that haven't been checked yet. I've come close to kind of 'retroactively' setting up an object's order before it gets checked, based on the relationship of other checked objects (confusing huh?) but it's usually just a couple of numbers off...

    Yeah Lucid, it's all events, I've done a little programming and am currently doing a Bachelor of IT, soon to be majoring in software development, I've never looked at making a plugin though...

    I'll go into further detail as to how I've done it if anyone's interested. I haven't put the .cap up because honestly, the code is pretty sloppy and hard to understand if you're not me.

  • Hey guys, if you've read my stuff before, you've probably noticed I'm either spouting something about isometric sorting or the animation editor not being robust enough lol.

    Well, I've basically only been working on one thing for about 2-3 years on and off (off being some pretty large amounts of time), and that is, my isometric sorting engine for my somewhat grandiose plan for a game.

    There is one thing I have learnt, isometric sorting is REALLY HARD TO DO!

    Here's a little demo of what I've got at the moment:

    <img src="http://dl.dropbox.com/u/1289341/isodemo.png">

    http://dl.dropbox.com/u/1289341/ISOsemiWorking.exe

    Yes there are variable heights, yes there are larger sprites sorting correctly for the most part

    It's not a game at all yet, it's kinda funny that I've spent all this time just on sorting....

    Anyway, it may look like it works perfectly, but trust me, it doesn't, it's still broken

    I'm still kinda happy with this, tell me what you think

    Also I would love to know how this runs on slower computers, mine is currently quite fast, and I know there's a pretty fat loop constantly running at the moment, so performance will vary. The engine isn't close to done yet, I'm going to work on a way of sorting more efficiently, this demo is just doing it's best to get the correct order, efficiency be damned

    I'm posting this because basically I'm getting disillusioned haha. I'm doing my best to make this sort everything perfectly, no matter what the configuration of objects are. It's close, but it's not there and I'm finding it incredibly daunting! I could leave it where it is, and just use level design to get around some of the sorting errors, but I'd much prefer not having that problem.

    Anyway, enjoy! Feel free to ask questions or to give some feedback.

  • Here's a little .cap I made a while ago to implement an aiming system similar to a lot of space sims (in this case, I modeled it after Privateer 2 )

    It uses lerp quite a bit. Have fun

    http://dl.dropbox.com/u/1289341/AimTest.cap

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here's a fun fact, upside down crosses aren't actually satanism (from what I've read at least). People just think it is, when the Apostle Peter was to be crucified, he didn't want to have it done in the same manner as Jesus, so requested that he be crucified upside down. Because of this, the upside down cross is usually a symbol of respect for the Apostle Peter. I think the Catholics put more stock into that kind of thing than other demoninations though (There are a lot of things about Catholicism that I don't think is right at all, but that's a different story).

    I'm glad to see all those black metal/death metal bands giving props to Peter hehe

    And about black metal, lol, they're just doing it to look hard and shocking, whether they believe in it or not, not to mention make all the fans go, 'YEAH! I'm evil like you guys!' (yes I know there are exceptions, but cmon, most of them take a verse or something from the Bible and try to make it sound evil). Sells records I guess, but I bet if someone made an anti-muslim band, there'd be some huge uproar or something. (I'm not just throwing around these ideas, I used to listen to a fair bit of black metal and have a lot of friends that still do, I also had to do a speech on the whole thing and did quite a bit of research, so sit back down lol)

    Just to clarify, while I do not really want to turn this into a religious discussion, yes i AM a Christian, no I'm not a Catholic. I do not want to debate about all this, I mostly just made a post about the upside down cross thing, so for all those that want to disagree and argue with me or whatever, feel free, but know that you're not going to change my point of view, and I'd imagine I cannot change your point of view either. So let's save everyone the the annoyance of a big fight and agree to disagree Thank you, sorry if I derailed this thread

  • Um, its at the bottom right, but it is inside the layout border

    Pretty sure you have to have the hud in the top left regardless

  • Are you sure you wrote value 1 in the pick by comparison as:

    distance(enemyName.X, enemyName.Y, playerName.X, playerName.Y)

    Don't forget to put the distance in front of the paranthesis around the x1, y1, x2, y2, also use lower or equal. Make sure you're using the names of the sprites you're using, not the names I've given, they're just examples, I'm sure you're doing it the right way anyway.

    I'll show you in a little .cap I made just then, works fine.

    http://dl.dropbox.com/u/1289341/MoveTo.cap

  • For the distance, you can use the System object's distance between points expression in the math section.

    it's formatted thusly;

    distance(x1, y1, x2, y2)

    The x1 and y1 refer to the first object to compare and the x2 and y2 refer to the second object, so in the case, the enemy would probably be x1, y1 and the player would be x2, y2.

    The condition I would use is the 'Pick by comparison' under the enemy object's conditions list in the 'Pick' category. So it would look something like this:

    Pick by comparison

    Value 1: distance(enemy.X, enemy.Y, Player.X, Player.Y)

    Is lower or equal to

    Value 2: <insert distance in pixels you want the enemy to notice you>

    Then insert the follow/attack action that you're currently using.

    IF you're using a version of construct that does not have the system object's 'distance between points' function, simply use pythagora's theorem

    So replace distance(x1, y1, x2, y2) with: (it's a little more complicated)

    sqrt(((enemy.X - player.X) ^ 2) + ((enemy.Y - player.Y) ^ 2))

    ^^ This is actually simpler than it looks, in plain english it's:

    The square root of; the distance between the enemy and player's X coordinates squared plus the distance between the enemy and player's Y coordinates squared. High school maths ftw

    I hope this has been useful

  • You could probably change the firing event into the 'blink' event. This is a pretty long post so I'll bold the more important stuff in my rants.

    So if we use something similar to my previous example:

    if player is within range of the gun

    --->Look in the direction of the player

    <subevent>gunthing animation Blink is not playing

    ------>add timedelta to gunthing.Value('Timer')

    if gunthing.Value('Timer') is greater or equal to 1000

    if gunthing animation Blink is not playing

    --->Change gunthing animation to blink

    --->Set gunthing.Value('Timer') to 0

    If gunthing is playing 'Blink' animation

    --->add timedelta to gunthing.Value('Timer')

    <subevent>if gunthing.Value('Timer') is greater or equal to 1000 (or however long you want the blink to last)

    --->Inset your gun shooting code here

    --->Set gunthing.Value('Timer') to 0

    Once again, I've been naughty and not actually tested this, but this where I would begin if I was about to try and achieve what you're after. To achieve the 'if animation blink is not playing' condition, add a condition 'If animation blink IS playing', then right click on it and click on 'invert condition'. This makes it so the event triggers when the OPPOSITE of what is listed in the condition is true.

    I don't know how much you know about subevents, but I'm using two there, that's where you either click on one event, click on it again and then select, 'create new subevent' or you drag an existing event underneath and to the side of another existing event (so it's indented). There's probably smoother ways to do this code, but I made it so the blink has its own timer check too in case you want it shorter, like 500.

    The thing with subevents, they behave exactly like a normal event, except that the event that they're indented from has to also be true. I basically threw that in there for two reasons, I'm so used to doing it these days, and it cuts down on having the same condition in multiple events:

    For example:

    Instead of this:

    If player is running

    if jump is pressed

    --->do this

    If player is running

    If fire is pressed

    --->do something else

    You can condense this using subevents (it may seem like not a whole lot at the moment, but in larger projects it really helps):

    If player is running

    <subevent>If jump is pressed

    ------>Do this

    <subevent>If fire is pressed

    ------>Do something else

    The advantage, besides saving space, you can also use the event 'If player is running' in the above example to also have its own action too when neither jump or fire is pressed and just running is playing, if that makes any sense.

    I hope this has helped and that I've said it in an understandable manner Sorry if it's miles long haha. If you have further questions or need me to translate or illustrate what I mean, I'll be happy to help.

  • The way I would do it, is just make two more global variables

    something like:

    savedX

    savedY

    and when you're saving the globals and about to swap layouts:

    set savedX to (Square.X - Circle.X) * -1

    set savedY to (Square.Y - Circle.Y) * -1

    ^ This will give you the Circle's 'offset' from the Square's position

    When you load up the new layout

    set Circle.X to Square.X + global('savedX')

    set Circle.Y to Square.Y + global('savedY')

    I've only -kinda- tested this, it should work though

  • You could have drawn the gun facing left, if you draw it facing right, it should work.

    Construct treats facing right as the 'default' rotation

  • Hey there, just as an additional thought;

    If you wanted to make it so each gun fired at a different time to each other, but still at regular intervals (assuming you have multiple guns going), you could always give the gun object a private variable called like 'Timer' and do something like this (semi-pseudocode):

    if player is within range of the gun

    --->add timedelta to gunthing.Value('Timer')

    if gunthing.Value('Timer') is greater or equal to 1000

    -->Do your shooting code here

    -->Set gunthing.Value('Timer') to 0

    if player is out of range of gun

    -->Set gunthing.Value('Timer') to 0

    (or if you want the gun to fire as soon as you're in range)

    --->Set gunthing.Value('Timer') to 999

    I know it's probably pretty sloppy and I haven't actually tested it, but it should work close enough, obviously you'd use something like the system object's 'calculate distance between objects' condition under math (i think that's what it's called) to determine the range of the gun.

    Also i -think- 1000 is the value for one second, so if you wanted two seconds, you would replace that value with 2000 or whatever suits your fancy. The best approach would be to make a global variable called something like 'gunInterval' and use its value instead of rewriting code.

    If you have questions about all that garbage I just said, feel free to ask

  • How was it with performance? What would happen if you had a couple of hundred of those mini canvases? That's a big ask I know, I don't really need anything like that at the moment, I'm really just wondering if a quick, easy, per object masking layer type thing is available at the moment

  • Hey all, this is partially a help request and partially a suggestion, depending on what the answer is heheh. Sorry if this has been covered somewhere, as usual, I did a quick search on it beforehand and didn't find much.

    So what I'm wondering is, yes we can do layer masking and stuff, but is it possible to mask an individual object? And by extension, multiple objects on the same layer? By that I mean, similar to an alpha map.

    Perhaps a better question would be, do objects have an individual opacity mask? If so, how do I use it?

    If not....

    I suggest that construct (probably construct 2) have an opacity mask option of some kind for sprites

    Potential possibilities include:

    Clever shadow casting

    Cool dissolve effects

    Destructible Sprites! Imagine shooting a hole in a tank!

    Anything a cool, crazy community could think up!

  • Ah rightio

    That's a real drag then, thanks Arima

    Yeah Newt, let's just say I'm using one 'Box' Sprite but using families to do all the coding for it and the .Count would work fine, as soon as I did something like add another sprite, 'Box2' for example, the .Count would fall over and only return 1

  • Ah I get it.

    The for each method works a little better for what I need.

    Thanks for your input guys

    The actual counting isn't the real issue for me here, it's that I really thought Family.Count should have done it, the weirdest part was that it DID do the trick fine, until I added a different object to the family. I don't actually think families are supposed to behave this way, correct?

    I haven't submitted it to the tracker or anything as yet because I haven't been around here a lot recently so I'm not entirely sure if this has been addressed yet and I'm posting to see what other people have to say about the issue. If other people are having issues with it, I'd glady pop it on there