Vallar's Recent Forum Activity

  • Probably 1 because 2 means you load all the graphics in one object which is bad for image memory usage. To store the loot though like in an inventory I would use an array.

    I didn't think of that, thank you very much for the heads up on this!

    If I were given a case like this, I would separate the card objects as icon from the real objects themselves (weapons, potions, armor, etc.). For card objects, I will just create one sprite with icon images for all the real objects. I prefer playing with JSON for data processing which contains all the attributes of the real objects that are used as references for game logic (Data Driven).

    I am familiar a bit with Data Driven Design. The question here is, how do you link the graphical object with the specific section of JSON that relates to it? You'll need some reference somewhere from/to either. Or is that what the animation name to ID for? So you'll have say "Sword of Darkness +3" in the JSON with "id" : 4 and then name the animation to "4" and reference the JSON data from there?

    If that is the case, how do you make sure that if for any reason you change a reference you update the corresponding ones?

  • Are you sure the origin of the two animations is the same?

  • Try Construct 3

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

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

    I am working on a prototype of an idea where items in the game act as cards. Imagine a regular RPG (for the sake of explanation) where each sword, bow, staff, armor, potion, etc... is just a card similar to card games.

    Now the conundrum I am encountering is how to effectively handle loot without too much hassle (if that is even possible).

    Right now, I am thinking of two ways:

    1- Each item is a separate sprite that belongs to a type family. So MeleeWeapons family in C3 would contain swords and daggers for example while RangedWeapons would contain bows and crossbows. I'd manually apply a sprite appropriate for the item and add family variables such as name, damage, range, durability and skill.

    This would require that when, say, I loot a chest, I would have to generate a random number from 0 to how many types of items I have in the game. Each type has a number ID and that random number decides the family I'll create an item from. Then another random number from 0 to max family member size to choose which item in the family to specifically create for the player.

    2- I create a XML/JSON file with all the items. I load up the JSON/XML file at the start. I create a single sprite called "LootItem" for example that spawns when the player loots the chest from the first example. Then at that moment, I randomly pick an ID from the XML/JSON file instead of the above method. The issue here will be that I need a specific PNG for each item and to my knowledge, I can't reference "X.png" in the JSON to load it in a sprite, I'd have to apply it as an animation or frame and know these animation names/frame number by heart to reference in the code. Not to mention the sprite will need to cater to every possible item type's setup. A weapon may have damage and range but a potion won't need those things for example so it might get confusing as the game gets more complex.

    To me, the first solution is more work generally speaking than the second but it is far easier to maintain. If an item changes I just change the specific sprite for it. The ID ranges would require me to remember to change if let's say a family of items became 5 instead of 6.

    The second method seems to save time at first but the issue with loading the art file would make it a complete mess if I decide to use "X.png" for weaponA instead of WeaponB or if any of the IDs changed for any reason. Not to mention the whole mess from dealing with different types of items that do different things, if not for anything, then when I display a tooltip so I don't display "damage: 5" for an HP potion. I am also not a fan of how you extract information from JSON/XML it just feels off in the events sheet.

    What do you folks think? Any feedback/ideas/suggestions are welcome.

    Note I don't want to jump into coding for this setup.

  • > It is slow because I am stepping through the debug window to make it easy to see what is going on.

    And? You should be able to see in the debug window why the Player sprite is moving - either in Bullet or 8direction tabs it will have non-zero speed.

    Apparently having speed or not doesn't affect this. Bullet behavior is disabled and has speed of 900. 8DirectionMovement has no speed but is enabled.

    If I set Bullet speed to 0, it doesn't affect the issue. The issue is nullified ONLY when I disable 8DirectionMovement. Moreover, I am not pressing any buttons whatsoever and the speed on 8DirectionMovement is 0.

    The only clue I have is that the Y of the player is incrementing and thus causing this movement. But I can't see any events in the sheet that increments that value only reads it.

  • Hello everyone,

    I am working on a little prototype with a sprite that has both the Bullet and the 8DirectionMovement behavior.

    For the life of me I can't find the reason why when I enable 8DirectionMovement on the player object it shoots up.

    I tried recreating the same object with the same behaviors and the new one doesn't have the same issue. My events also don't betray any sort of logic that would make this happen.

    Here are my setup and events:

    https://i.imgur.com/e0mWPZH.png[/img]

    https://i.imgur.com/NnEPMTl.png[/img]

    When I hit play I get this:

    https://i.imgur.com/SMwi4Fw.gif[/img]

    It is slow because I am stepping through the debug window to make it easy to see what is going on.

    Any idea what is happening?

  • You do not have permission to view this post

  • I see what do you mean. Thank you very much, I'll recode it using state machines with LOS :)

  • Hi all,

    I am trying to create an enemy type that when it reaches the range it can attack a player from, it dashes into the player.

    I tried to do this with LoS instead of the distance expression I am using below but I get the same exact stutter result.

    First, here is my "code":

    i.imgur.com/S8EODEd.png

    This is the result:

    i.imgur.com/GNm2oNG.gif

    I don't know why the enemy (purple) moves in "steps" towards the player. I tried to chang the speed (currently it is set to 800 as you can see from the text box) while that helped, that "steps" feeling is there but it slightly less noticeable.

    On a side note, the enemy has a Custom Movement behavior enabled on it but I only use it to stop enemy sprites from overlapping.

    Any ideas what is going on here and what I can do to fix this?

    Tagged:

  • I think you may be using by mistake the:

    Sprite "On Collision with another object"

    instead of:

    MoveTo "On Hit Solid"

    Oh, I see. Now I realize what this means. I completely misunderstood the documentation. Thanks for clarifying.

  • It looks like the moveto behavior's stop on solids property doesn't actually let the objects collide or overlap, it stops before they touch at all.

    You can use the stop moveto action on collision to stop instead of the stop on solids property if you want collision based events to fire.

    Just tried this out and you're right, thank you very much. This makes the documentation misleading -- super misleading because it says the opposite:

    Stop on solids

    If enabled, movement will stop if the object collides with something with the Solid behavior, and trigger On hit solid. If disabled solids are ignored.

    Someone needs to fix the documentation and makes sure quirks like that are mentioned in the tooltips.

  • Is your text box large enough to contain the word? If the word doesn't fit, it doesn't get displayed at all instead of being cropped.

    Yes, it is 6x the size of the word.

  • Hi everyone,

    I've got two sprites. Both of them are simply created through the fill color in C3 and their collision shape is set to bounding box.

    I have an event sheet that handles collision and I made sure it is included in the main one.

    The first sprite has a MoveTo behavior with stop on solid true. The second sprite has a solid behavior with a tag. There is NO event to exclude or include the tag as that setup isn't used for anything just yet.

    Collisions on both objects are enabled even on runtime (checked with Debug mode).

    I setup my event as such:

    - Sprite1 OnCollisionWith Sprite2 > DebugText Append "Collision!"

    Now when I run the layout Sprite1 moves towards the target I set to it. It encounters Sprite2 and stops. So far so good, the problem is the text box doesn't change and remains empty. I can see Sprite1 stuck to Sprite2. I can see it stopped moving, yet the collision event doesn't run, any idea why?

    I tried to change this to Overlapping instead of collision and it didn't work still.

    Tagged:

Vallar's avatar

Vallar

Member since 24 Mar, 2014

None one is following Vallar yet!

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

14/44
How to earn trophies