Tobye's Forum Posts

  • Hey mate,

    The problem is in the 'stones overlapping' group. While the stone is overlapping the those border objects it disables the bullet. So if you just toggle 'set bullet disabled' off you will see the stone continues to drop. Hope that helps!

  • Hey all,

    I have recently been getting some terribly frustrating issues where inverted conditions just simply don't work (like they are completely ignored as a condition).

    I had this with Line of Sight and booleans. It usually fixes though if I add a new LOS behaviour or new boolean and reference that instead. Has anyone else come across this? I am unable to recreate it consistently, it just seems to happen on occasion since the last update.

  • Perhaps you could just as a letter to it in the array (so 'is' and 'isa'), then alter the displayed text. So like: set text to array.at(0), text = 'isa', set text to 'is'.

    There's probably a cleaner way, but this is pretty simple as is.

  • I still use UIDs instead of containers a lot. I can do stuff like destroy the turret but leave the tank alive for a few seconds before also being destroyed. It takes a little extra effort, but I always end up needing that freedom at some point.

    Just make an event that says: 'on tank created > tank spawn turret > set turret variable 'id' to tank 'UID''.

    Then: 'on tank destroyed + turret.id = tank.UID: destroy turret'

    But really if you are just making something simple, use containers.

  • If you post a capx I'll be glad to have a look for you :)

  • Thanks guys, but I'm not really any closer. I can smooth scroll and scale no problem, the main issue I have is getting it so all enemies in LOS are only just within the screen and the view constantly scales to accommodate. I'll keep at it!

  • Hey all,

    I want a game mechanic where when the player has LOS with an enemy, the view stretches out so that the enemy is included in the screen. I want it to stretch to include all enemies you have line of sight with while not stretching the view in a way that areas outside the layout are shown. Also it needs to shrink back when LOS is broken.

    Does anyone have any methods for this? I have a lot of experience with C2, but this is new territory for me and I just can't even seem to get close.

  • Hey mate, I'm interested. I've done quite a bit of testing for professional games companies down here in Melbourne.

    I don't have a large amount of time, but I have been watching for development for a long time now and would like to see how it's turned out, so why not help test it at the same time? :)

  • I always add a linking 'id' variable that is the moving object's UID. So 'enemyBox is moving + enemySprite.id = enemyBox.uid -> Set Animation...'

    Maybe there is an easier way, but I use the id variable for so many things anyway that this is how I manage it.

  • Hm, no I haven't seen any. I learnt all this stuff myself and don't have any demos ready. But I will try to explain it:

    1. Create an array in the editor. Add an instance variable to it for each value you wish to store (attack, defence, etc.)

    2. On start of the game, destroy array (just to keep it clean)

    3. Condition 'on character created' > create object 'array'. Set value of array's instance variable 'id' (which you also include when creating the variables for the array) to 'character.uid'. Then set all other variables to the desired values.

    4. Whenever something affects 'character', pick the corresponding array by adding the condition 'array.id = character.uid'. Now alter the values of the array's variables asthough it was the character.

    This is a very simple way to do things that still allows more flexibility than storing the values directly on the character. If you think that you will need more control over the information, then yes also use the array's cells.

    I don't have time to fully explain my methods for that right now sorry, but essentially you just use 'push' to add a string value (say 'attack') on the X axis, then values on the Y axis (starting from 1, because 0 will be your string). Then you can do things like run loops for 'array.height' times, using local variables as counters to get the value for each cell under a string: array.At(array.indexOf("attack"),counter))

    That method is actually quite easy to use, just there is a lot of possibility so deciding the right ways of indexing and retrieving the information for your game will likely take some time and thought. Hope that helps!

    EDIT: Also in case you haven't noticed, I'm not a fan of using a single array for all the characters. I really can't see any reason to do it that way and many reasons why not to. So unless you have a very specific reason for doing so (and if you do I'd like to know why out of curiosity :) ), the main thing I suggest is to store values for each character in their own object.

  • But arrays do store strings...? I have used them several times for exactly this. But now that you can just save the game state, I prefer to just use variables on arrays. This works totally fine unless you are doing something like a CCG which requires in-depth information, like how many times an attack has had a modifier increase.

    EDIT: I should clarify that I prefer variables on arrays, then creating an instance of that array when a character is created and linking it to them (set instance variable 'id' to character 'uid'). It's a better method than storing the variables directly on the character for a number of reasons, like if the character gets destroyed but comes back later or you find you do want to store some info in an array later down the track, or maybe you want to store the data of each character for a debriefing layout.

  • One solution is to make it when it is no longer pushing out, set Mario's Y to that of the platform. Might not work for you depending on how you have your game set up, but that method has solved a number of problems for me in the past.

  • Link to .capx file (required!):

    dropbox.com/s/xpp3lfws3ps890f/bugging%20out.capx

    Steps to reproduce:

    1. Load layout 'Level 1'

    Observed result:

    Bullets spawned will always attach to the angle of the turret, even up to 0.019 seconds after being fired. This means you can't set the angle of the bullet 'on created', as it will always just revert to the turret angle.

    The turret waits 0.016 seconds to change angles which is the lowest amount I could get to where it will still occasionally change the angles. So you will see some flying off now and then, but the bulk of them heading directly straight. Remove the wait timer to see them all go straight or set it to 0.02 or higher to see them consistently change angles after that time.

    Also the 'on created' angle changing works fine on other objects, until they move. You can see this by controlling sprite6 using the arrow keys. The will spray off in all direction, until you hold up/left/down, but strangely it will work normal when facing right.

    Lastly, if you use 'system > create object' instead of spawning the object, on-created angle adjustments work.

    Expected result:

    All shots fire with randomised accuracy.

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Internet Explorer: yes

    Operating system & service pack:

    Windows 8 and don't know

    Construct 2 version:

    130

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • ramones - Thanks for that! I don't know why I never thought to try it that way. I guess I should report it, I have come across other problems with angle setting in pathfinding behaviour too.

  • I have my little tank game going gang-busters, but all of a sudden I have run into a problem! When the turret 'on shoot' spawns a bullet, the 'on bullet created > set angle X' no longer works! It will always just set the bullet to the same angle as the turret.

    This was not always the case, I remember when I started this game that they would take into account accuracy variations when shot with turret behaviour, and if you say 'on bullet created > wait 0.1, set angle to X' it will work. The lowest wait period I could get it to work for every shot was 0.02, and it would work for some shots all the way down to 0.016.

    Does anyway know exactly why this is? Or how to solves the problem? I have been stuck on it for a few hours now, which really is too long for something this simple :(

    Also I noticed that if non-turret behaviour objects are firing shots, it will work as intended until they move (either with pathfinding or 8-dir behaviours).

    Capx: dropbox.com/s/xpp3lfws3ps890f/bugging%20out.capx

    And if anyone happens to know in which version that problem started I would like to know, it would be worth me stripping back to it :)