moebios's Recent Forum Activity

  • Thanks, dop2000! I was trying with a variable, and I thought it would be more efficient the way you did it. I also added the scatter value to create the possibility of making weapons with imprecise bullets. I'm thinking about whether I can use the same code to make bullets like a shotgun.

    + System: For "shotCluster" from 1 to dictionary_playerWeaponsAttributes.Get("shotCluster")
    -> System: Wait (loopindex-1)×0.1 seconds
    ----+ System: For "multiShot" from 1 to dictionary_playerWeaponsAttributes.Get("multiShot")
    -----> System: Create object dictionary_playerWeaponsAttributes.Get("bulletName") on layer weapon.LayerName at (weapon.X, weapon.Y), create hierarchy: True, template: ""
    --------+ System: Pick last created playerBullets
    ---------> playerBullets: Set Bullet angle of motion to weapon.Angle + loopindex("multiShot")×4 + random(-dictionary_playerWeaponsAttributes.Get("scatter"),dictionary_playerWeaponsAttributes.Get("scatter")) degrees
    ---------> playerBullets: Set Bullet speed to dictionary_playerWeaponsAttributes.Get("projetileSpeed")
    ---------> playerBullets: Set FINALDAMAGE to Functions.calculateBulletDamage ( dictionary_playerWeaponsAttributes.Get("damageType"), dictionary_playerWeaponsAttributes.Get("baseDamage"), dictionary_playerWeaponsAttributes.Get("projectileWeaponDamageMutiplier"), dictionary_playerWeaponsAttributes.Get("laserWeaponDamageMultiplier"), dictionary_playerWeaponsAttributes.Get("blasterWeaponDamageMultiplier"), dictionary_playerWeaponsAttributes.Get("projectileExplosiveWeaponDamageMutiplier") )
    ---------> playerBullets: Set bulletDistanceTravel to dictionary_playerWeaponsAttributes.Get("bulletDistanceTravel")
    ---------> playerBullets: Set piercingEnergy to dictionary_playerWeaponsAttributes.Get("piercing")
    ---------> playerBullets: Set explosionSize to dictionary_playerWeaponsAttributes.Get("explosionSize")
    
  • Hey everyone, how’s it going?

    I’m making a game using turret behaviors, and I have a question I’d like your input on. When a turret is able to shoot (“on turret shoot”), I want to set up a system where each shot can create a specific number of bullets. To be clear, I'm not referring to the number of shots, but rather the number of bullets created per shot.

    Currently, I’m using a loop to create bullets based on the number of shots the turret has. For example:

    On turret shoot
    ->for 1 to numberOfShots
    -->create bullet object
    

    But I’d also like to configure a specific number of bullets per shot. Here are a couple of examples of what I'm aiming for:

    Turret A has 2 shots, and each shot creates 1 bullet:

    (turret)
    (shot) (shot)
    

    Turret B has 1 shot, and each shot creates 2 bullets:

    (turret)
    (shot)
    (shot)

    Let me know if this makes sense, and if you have any ideas on how to implement it!

    Tagged:

  • You can use a timer.

    If the timer "slower" is running:

    Set object.bullet.speed = object.speed / 3 (considering that the object has a variable to store its speed).

    On timer "slower" (when the timer finishes):

    Set object.bullet.speed = object.speed.

  • Thank you! The overlap issue is now resolved, and I didn't even notice it before.

    My problem now is making the function return 'can't place' when the grid area doesn't fit the itemL. For example, when clicking on the last slots or the sides, where the L shape wouldn't fit.

    | Global number numColumns‎ = 4
    | Global number numLines‎ = 4
    
    + System: On start of layout
    // item L
    -> itemL: Set value at (0, 0) to 1
    -> itemL: Set value at (1, 0) to 1
    -> itemL: Set value at (1, 1) to 1
    // -
    // debug
    -> arrayInventoryGrid: Set value at (0, 0) to 1
    
    * On function 'canPlaceItem'
    * Parameter 'startX' (Number)
    * Parameter 'startY' (Number)
     | Local boolean canPlace‎ = true
    ----+ itemL: For each XY element
    --------+ System: itemL.At(itemL.CurX,itemL.CurY) = 1
    ------------+ System: startX + itemL.CurX < numColumns
    ------------+ System: startY + itemL.CurY < numLines
    ------------+ System: startX + itemL.CurX ≥ 0
    ------------+ System: startY + itemL.CurY ≥ 0
    ------------+ System: arrayInventoryGrid.At(startX + itemL.CurX, startY + itemL.CurY) ≠ 0
    -------------> System: Set canPlace to False
    -------------> System: Stop loop
    
    ----+ System: Is canPlace
    -----> debug: Set text to "can place"
    
    ----+ System: Else
    -----> debug: Set text to "can't place"
    
    + Mouse: On Left button Clicked on slotInventory
    -> Functions: Call canPlaceItem (startX: slotInventory.id % numColumns, startY: floor(slotInventory.id ÷ numColumns))
    

    I'm open to suggestions, as I'm finding this logic quite complicated =(

  • I am trying to develop a grid inventory system where items can occupy multiple slots and have various shapes (such as L, T, and I).

    Currently, I am attempting to implement a function called canPlaceItem, which checks if an item can be placed at a specific position in the grid. The function should:

    • Receive the coordinates (startX, startY) of where the item is being placed.
    • Check if the corresponding cells in the grid (arrayInventoryGrid) are occupied (i.e., not empty).

    * System: On start of layout -> itemL: Set value at (0, 0) to 1 -> itemL: Set value at (1, 0) to 1 -> itemL: Set value at (1, 1) to 1 -> arrayInventoryGrid: Set value at (0, 0) to 1

    * On function 'canPlaceItem' * Parameter 'startX' (Number) * Parameter 'startY' (Number) ----+ itemL: For each XY element --------+ System: itemL.At(itemL.CurX,itemL.CurY) = 1 --------+ System: arrayInventoryGrid.At(startX + itemL.CurX, startY + itemL.CurY) = 0 ---------> debug: Set text to 0 --------+ System: Else ---------> debug: Set text to 1

    + Mouse: On Left button Clicked on slotInventory -> Functions: Call canPlaceItem (startX: slotInventory.id % numColunas, startY: floor(slotInventory.id ÷ numColunas))

    The canPlaceItem function always returns that the slot is free, even when I click on a slot that is occupied. Debugging the value of arrayInventoryGrid, I notice that it is not returning the expected value (0 for free slots and a non-zero value for occupied slots).

    Can anyone help me understand why the check for occupied slots is not working correctly? Any suggestions on how to improve this logic or additional debugging steps I could add to identify the problem?

    here is the c3p file: drive.google.com/file/d/12WkZ9h_QeEKsr2BtISrKjGmkV8_jO2DY/view

  • Thanks, guys! I’ll test both solutions. After years using Construct 3, I didn’t know it was possible to do something like this. Thanks so much for your help!

  • Wow, this is amazing! I don't have much experience with the drawing canvas, but your explanation really helps. I'll experiment with the dissolve part first, and then try to incorporate the fire effect as you suggested.

    Thank you so much for your help

  • Hey everyone, is it possible to create this dissolve with burn edge effect in Construct 3? I have no idea how to achieve it. Any suggestions? Here’s the effect I’m referring to: godotshaders.com/shader/2d-dissolve-with-burn-edge

    Tagged:

  • You do not have permission to view this post

  • Hey folks,

    I'm doing a "spawn" to create objects from time to time.

    The spawn has 3 variables:

    boolean active

    number everySecond

    string spawnObject

    The logic is as follows:

    Every X seconds, if the 'active' is true, it should run a timer with the value of 'everySecond' and then create an object using 'spawnObject'.

    Everything works beautifully with just one spawn object, but when I add more than one, only the first instance works.

    Any ideas?

    Here's the link to the capx if anyone wants to dig into it: drive.google.com/file/d/1V-0djX_NQwwaXyt6eEGX65y75rTwidJI/view

  • i want to be able to make my rpg game be able to collect items and when they are all collected, the objective changes text.

    how would this work?

    i dont think there is a way to make a system such as

    when "apple and 5 other items" are destroyed, change textbox text

    please help

    If you want to change a text when ALL apples are destroyed, you can check if the total number of apples is equal to 0.

    System > Compare two values

    First value: apple.count

    Comparison: Equal to

    Second value: 0

    Text > Set text to "yeee"

    Or, if you're using a family, change "apple" to "familyName.count"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Usually, I do it by creating a tiled background and setting its width to * Hp.

    I've made an example for you:

    drive.google.com/file/d/1IBblPB0GdDjIm5nHC7mkUvs4uaToFGoT/view

    I hope it helps =D

moebios's avatar

moebios

Member since 19 Jan, 2013

None one is following moebios yet!

Connect with moebios

Trophy Case

  • 11-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

15/44
How to earn trophies