Lncredible's Recent Forum Activity

  • Hi,

    Perhaps you have an imagepoint issue on your sprite animation. Check which Imagepoint you are spawning your shoulder pads onto just before the "PIN", then check the sprite to see if the imagepoint is where you expect it to be. If most of the pieces of armour are working it sounds like the shoulder-pads are simply misaligned when you pin them.

  • I can get my 50-60 FPS back by simply deleting the tilemaps *

  • Hi all,

    As placeholders I was using Tiled Backgrounds to design the "floors" of my top-down shooter. I have recently re-designed my "floors" using a tilemap object (400px by 320px sliced into 16x16) with no Behaviours. This first tilemap covers the ENTIRE layout as it is functioning as a replacement for the tiled backgrounds. I also have a second tilemap of the same resolution and slice (16x16) on top of the other tilemap, used for detailing (placing items in rooms, for example).

    Now whenever I load my game on Android I've lost about 20FPS. I've tried various troubleshooting guides / best practices with Tilemaps from the forums / help pages, but to no avail.

    My only option seems to be re-creating 5-10 backgrounds, and having many individual sprites, to cover having some basic detail to my levels. Surely it isn't meant to be this way?

  • Hi there,

    I'll try to put this as simply - I am having some issues with Pathfinding, namely, the Complete Regeneration of the Pathfinding map.

    My game - the facts:

    • I have a game with TWO maps, each one is an individual Layout.
    • Both maps are constructed using various "Solid" objects to form a Maze.
    • Map ONE and map TWO have different mazes.
    • All pathfinding is done by DEFAULT to only use SOLID objects as a barriers.

    Here is the sequence of events with the issue in BOLD:

    • Main Menu - Click "Map 1"

    Map 1

    • On Start of Layout -> Regenerate pathfinding map
    • All objects can pathfind around using the expected behaviour, not colliding with any of the solid objects or overlapping them.
    • End of "Map 1" -> Go to Layout "Map 2"

    Map 2

    • On Start of Layout -> Regenerate entire pathfinding map.
    • Objects now proceed to use the pathfinding map from "Map 1"!!! I.e. walking through all the solid objects as if nothing had changed.

    How can I fix this issue?

  • I guess I'll have to manually put in the space adjustments and use the old Spritefont plugin...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi,

    Although it may not have all the answers it should help you on the way - there is an "Autorunner" tutorial included with Construct 2. You can access it by starting up Construct 2 (without opening your project) and look through the Tutorial section.

  • Hi there,

    I am not quite sure what you mean, and I don't know what Behaviour you are using (Bullet?), but perhaps you could try the following action:

    Event - Plane hits edge of layout

    -- Action - PLANE: Set Mirrored

    -- Action - PLANE:BULLET: Set Bullet angle of motion 0, or 180, depending on which direction you want it to go next.

    If the plane is only travelling Left or Right then he can be Mirrored. You might need to disable "Set Angle" on the Object under the Bullet behaviour settings otherwise it will always set the animation to the angle of motion. If you aren't using the Bullet behaviour then Mirroring should work fine without any other adjustments.

  • Hi there,

    I have been changing my fonts from the built-in Spritefont plugin to Spritefont+ (https://spritefontplus.codeplex.com/) so that I can quickly set character widths using JSON.

    In the property of the Spritefont+ objects you can CLEARLY set text alignment, but my issue is that I want to do this with an event-action. I.e:

    Start of layout

    • Spawn Spritefont+ object at x,y
    • Set Spritefont+ object horizontal alignment to RIGHT

    But the actions don't seem to exist. Has anyone else had this issue?

  • Hmm, normally I would expect the row to come first, then the column. This would also enable you to work with "For each X" instead of "For each XY".

    A faster solution without a loop would be:

    Player carries an instance variable of where is saved in the array. (if elements will be removed from the array at some point, you need to update the positions in those cases, though)

    then you could: "Levelup" (Parameters: player.arrayposition, parameter_num, value_to_add)

    on "LevelUp":

    set array at (player.arrayposition, parameter_num) to array.at(player.arrayposition, parameter_num) + value_to_add

    Obviously you need to switch x and y, if you want to use x for columns and y for rows.

    Thanks for your help. I will take note of this and try to adjust my code.

    I found out what the issue was with my particular example - I was using a plugin "CSVtoArray" to import my data and it converts every single entry in the Array to "Text" so even numbers are not classed as "Number". I re-worked my code above so that my local variable was a text object (for searching the array) and now it works.

  • Hi all,

    I store all my "player data" in an array called Player.Array. When a value changes I want to be able to write data back into my Array, editing fields such as "Strength" or "Agility" immediately when a player levels up, for example. The benefit of this is that when the instance is destroyed he won't lose his stats.

    Player.Array:

    ID,NAME,CLASS,STR,AGI,INT

    0,Dingle,Mage,3,5,9

    1,Muscle,Warrior,9,6,1

    2,Flight,Druid,6,6,3

    3,Joseph,Bard,5,5,7

    4,Stars,Druid,5,4,6

    Here is my current method (not working) for editing data.

    Scenario: "Flight" levels up and chooses a point in Intelligence. I need to search the Array for his ID number (2) and then Add 1 to his Intelligence column.

    On Function "LevelUp" (param(0)) ## Function is called with the UID of the character who levelled up.
    Local number Array_Looper = 0 ## To loop through the Array incrementally.
    Local number Player_Finder = 0 ## To grab the UID from the instance to look up in the Array.
    
    [ul]
    	[li]Set Array_Looper to 0[/li]
    	[li]Set Player_Finder to 0[/li]
    [/ul]
    Pick instance of Player with UID Function.Param(0) - Set Player_Finder to Player.Player_ID ## An Instance variable that stores ID from Array on the instance when it is spawned into the game.
    
    For each XY element in Player.Array:
    If Player.Array Value at (0,Array_Looper) = Player_Finder - Set value at (5,Array_Looper) to Player.Array.At(5,Array_Looper)+1)
    
    [ul]
    	[li]Add 1 to Array_Looper[/code:22ce4qg8][/li]
    [/ul]
    So I have done a few tests and not come up with much. The annoying thing is that this code works elsewhere in the same project. I more or less mirrored it and changed the details, but I guess that's where inconsistency sneaks in.
    
    Any help would be much appreciated. I'll try any suggestions in a new project tomorrow just to get away from a very busy load of code and try some ideas out on a blank canvas...
  • Hi all,

    I am trying to find the best of way of handling combat in a tank-based game where most of the combatants are NPC AI who drive about shooting one another using the pathfinding module and line of sight.

    I have come up against a problem handling the fact that both objects have "LINE OF SIGHT". Let's call them Team1 (red tanks) and Team2 (blue tanks). What I have been so far is this:

    Team1 is within line of sight of Team2

    Pick Instance 0 of Team1

    Set Team1.InCombat = 1

    Pick Instance 0 of Team2

    Set Team2.InCombat = 1

    .........

    Team2 is within line of sight of Team1

    Pick Instance 0 of Team1

    Set Team1.InCombat = 2

    Pick Instance 0 of Team2

    Set Team2.InCombat = 2

    .......

    As you can see I am trying to identify which set of code to run based on whether Team1 saw Team2 first, or Team2 saw Team1 first. Is this how I should be handling it?

    Things get more complicated from here. Basically I want to be able to have multiple tanks in combat with each other at the same time using the same mechanics as above, but I'll summarise my intent:

    1) Tanks enter combat by driving around until they come within line of sight of eachother.

    2) Regardless of who saw who first, the two tanks enter combat with eachother until it is resolved.

    3) First step of combat is to turn and face one another

    4) Only when they pointing directly at each other can they start firing (this can mean that one tank can start firing before the other as it reaches angle(x,y,x1,y1) (or indeed [angle(x,y,x1,y1) -180]) first.

    5) When one tank is destroyed the order needs to be given to the victorious tank (or tanks) to continue pathfinding. I am having most trouble here when multiple tanks are engaged in a fight with only one example of a tank.

    Most of my mockups end with two or more tanks entering combat with one. When combat is resolved (let's say Team1 won) the victorious Team1.instance1 deals with its own pathfinding and drives off, leaving Team1.instance2 sitting there because I have failed to keep track of the UIDs of who was in a battle.

    Can someone explain the best method of handling multiple instances like this? I want 2on1 or even 3on1 battles to be a possibility, but I can't believe that the best way to do this is to keep copy pasting my code and putting in "Pick instance 0" "pick instance 1" "pick instance 2". How would you even go about handling 50-100 instances individually?

    Thanks for your help.

    Lncredible

  • Actually, using the dictionary object would be perfect for this..

    Oh my.. There's a dictionary object?... I think I have been "thinking around the problem" and overlooked something major...

Lncredible's avatar

Lncredible

Member since 10 Sep, 2014

None one is following Lncredible yet!

Connect with Lncredible

Trophy Case

  • 10-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

12/44
How to earn trophies