Give me a Pixel's Recent Forum Activity

  • Thank you both. I will try those ideas out and see what I get.

  • I'll try that. Thanks

    EDIT: I'm not exactly certain what you mean. The guard has to check if he can move before he moves. Could you please upload a modified version of the file I provided or some screenshots?

    Thanks again,

    Give me a Pixel

  • Hello again,

    I was trying to duplicate a game called Tiny Heist (https://www.coolmathgames.com/0-tiny-heist), but I'm having some issues with the guard AI. I have the basic movement down, but they don't work right in the corners. If they are overlapping a wall/door in front of them, they are only suppose to be able move the clear way. For some reason, they are apparently being able to turn any direction. Can someone figure out what is wrong with this? I have uploaded a basic example. In the example, hold Z to trigger the movement. dropbox.com/s/5t0i6fp8v66wsuv/Guard%20AI.c3p

    Thanks,

    Give me a Pixel

    Tagged:

  • I'll check it out. Thanks!

  • Hmmm. I'm sorry, but that doesn't make much sense. Could you please make a small demo project for me? Thanks.

  • After giving it some though, I am going to switch the inventory to your way, WackyToaster. I checked out arrays and it will be much simpler to just store the quantity and the array reference in the inventory slot. This will also be useful for chests, as I will probably do them the same way. Do you have any suggestions on how I will be able to get out of giving the chests instance variables? From how I interpret your last post, you are saying to have a separate array for each chest? That would work, except you will be able to place chests, and you could have hundreds of chests. Any other ideas? Thanks.

  • I tried to make a spear like Terraria but I need some help. I made it and it works perfectly, except it won't stay with the player. Here is the code:

    + Inv_Box: Item_Type = "Spear"

    ----+ (no conditions)

    -----> Player_Parts: Set Swinging to True

    -----> Player_Arm: Set animation to Dictionary.Get("Armor") & "_Swing" (play from beginning)

    -----> Player_Arm: Set animation speed to 0

    ----+ (no conditions)

    -----> System: Create object Player_Weapon on layer "Objects" at (Player_Arm.ImagePointX("Weapon"), Player_Arm.ImagePointY("Weapon"))

    -----> Player_Weapon: Set Type to "Spear"

    -----> Player_Weapon: Set angle toward (Mouse.X, Mouse.Y)

    -----> Player_Weapon: Move behind Player_Arm

    -----> Player_Weapon: Set animation to Inv_Box.AnimationName (play from beginning)

    -----> Player_Weapon: Set animation frame to Inv_Box.AnimationFrame

    -----> Player_Weapon: Set Damage to Dictionary.Get("Damage") + int(random(-3, 3))

    -----> Player_Weapon: Set KnockBack to Inv_Box.KnockBack

    -----> Player_Weapon: Set Speed to Inv_Box.Speed

    -----> Player_Weapon: Start Timer "Thrust" for ((25 - Self.Speed) ÷ 10) ÷ 3.5 (Once)

    --------+ (no conditions)

    ---------> System: Wait for previous actions to complete

    ------------+ Player_Weapon: Is between 270 and 295 degrees

    -------------> Player_Weapon: Set angle to Self.Angle + 45 degrees

    -------------> Player_Arm: Set animation frame to 0

    -------------> Player_Parts: Set Not mirrored

    ------------+ System: Else

    ------------+ Player_Weapon: Is between 295 and 345 degrees

    -------------> Player_Weapon: Set angle to Self.Angle + 45 degrees

    -------------> Player_Arm: Set animation frame to 1

    -------------> Player_Parts: Set Not mirrored

    ------------+ System: Else

    ------------+ Player_Weapon: Is between 345 and 65 degrees

    -------------> Player_Weapon: Set angle to Self.Angle + 45 degrees

    -------------> Player_Arm: Set animation frame to 2

    -------------> Player_Parts: Set Not mirrored

    ------------+ System: Else

    ------------+ Player_Weapon: Is between 65 and 90 degrees

    -------------> Player_Weapon: Set angle to Self.Angle + 45 degrees

    -------------> Player_Arm: Set animation frame to 3

    -------------> Player_Parts: Set Not mirrored

    ------------+ System: Else

    ------------+ Player_Weapon: Is between 250 and 270 degrees

    -------------> Player_Weapon: Set angle to Self.Angle - 45 degrees

    -------------> Player_Arm: Set animation frame to 0

    -------------> Player_Parts: Set Mirrored

    -------------> Player_Weapon: Set Flipped

    ------------+ System: Else

    ------------+ Player_Weapon: Is between 200 and 250 degrees

    -------------> Player_Weapon: Set angle to Self.Angle - 45 degrees

    -------------> Player_Arm: Set animation frame to 1

    -------------> Player_Parts: Set Mirrored

    -------------> Player_Weapon: Set Flipped

    ------------+ System: Else

    ------------+ Player_Weapon: Is between 115 and 200 degrees

    -------------> Player_Weapon: Set angle to Self.Angle - 45 degrees

    -------------> Player_Arm: Set animation frame to 2

    -------------> Player_Parts: Set Mirrored

    -------------> Player_Weapon: Set Flipped

    ------------+ System: Else

    ------------+ Player_Weapon: Is between 90 and 115 degrees

    -------------> Player_Weapon: Set angle to Self.Angle - 45 degrees

    -------------> Player_Arm: Set animation frame to 3

    -------------> Player_Parts: Set Mirrored

    -------------> Player_Weapon: Set Flipped

    The last part is just to make the arm line up with the angle of the spear (https://www.construct.net/en/forum/construct-3/how-do-i-8/shooting-problems-146513?kws=)

    I need it to stay at the player's image point "Weapon." The problem is that I can't use 'every tick -> set position to. . ., or the pin behavior because the spear actually moves. I don't want to do animations. Any suggestions on how to make the spear stay with the player? It needs to set position to his image point, but also the offset of the movement and angle of the spear.

    Thanks,

    Give me a Pixel

  • I thought arrays might be the answer. The only problem is I have almost no experience with them.

    So your saying use one array to store the data of a chest (One array per chest), and one main array to store the chest's IDs? What if I have a lot of chests? I still am a little fuzzy on this. Could you possibly make an example?

    Much thanks,

    Give me a Pixel

    EDIT:

    Yes, I now understand what you mean. I will have an array full of each item with all of it's stats. Then I would only need an instance variable or array for each slot and it's quantity (I have 40 slots so the chest would need 80 instance variables). When you open the chest, If a slot's corresponding variable is not empty, it would retrieve all the data for that item from the array and load it into that chest slot.

    This is a good idea (I can't think of a better one yet), but that will be very tedious to fill in the array. There are almost 200 items! Another thing is that this would work for the player's inventory as well.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Anybody have any ideas how they did the chests? There are fifty slots per chest. Each slot has many variables, e.g. strength, speed, knockback, etc. Instance variables would not work very well because there would have to be many hundreds of them. How would be the best way to store the data, especially if there are many chests? Ideas are appreciated.

    Thanks,

    Give me a Pixel

  • I will give that a try. Thank you!

  • Hello again,

    I was wondering if it would be possible to create real-time upgrades. For example you can click the upgrade button, the game waits however long (i.e. 1 day), and then the item gets upgraded. The twist is that you will have to be able to shut your device down/ close the tab, and then when you re-open it, it will take however much time has passed. Also, would it be possible to add some coins to a mine every so often, and then when you click/ touch the mine you get that amount? Again, it must be in real time. Would the best way be to read the device's date and time, and then when you log on it compares the date and time from when you started and the current time and date to see how much time has passed. Thanks.

  • Glad you figured it out.

Give me a Pixel's avatar

Give me a Pixel

Member since 2 Mar, 2018

Twitter
Give me a Pixel has 34 followers

Trophy Case

  • 6-Year Club
  • Entrepreneur Sold something in the asset store
  • Forum Contributor Made 100 posts in the forums
  • x11
    Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

17/44
How to earn trophies