What's different?

This forum is currently in read-only mode.
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • Here's a cap file and associated array data (In Layout1 file). There are two groups, Create Units From Array, and Create Units for Testing, which are not created from an array. One group (Create Units From Array) works correctly, while the other does not.

    The problem is this. The units belong to two teams, red and blue. The game works in rounds but in round one the Archer units (Princess Leia temporary graphics) can attack. If you click on the Archer unit, you see its radius highlighted in red, the units it can attack in blue, and the selected unit to attack in green. The unit should not be able to attack units on its own team.

    The problem is that if I create the units using the Create Units from Array group, for whatever reason this check fails and the unit can attack all units including those on its own team (see wher ethe blue boxes appear), even though all the relevant variables (Sprite.Value('OccupiedByPrevious'), Units.Value('Team'), Sprite.Value('ID') and Units.Value('Home')) seem to take the correct values as shown in the DebugText red text box. If I use the Create Units For Testing group everything works fine.

    Any idea what's going on? The function that draws the colored boxes is called Highlight Attack Targets.


  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ah figured this out finally, apparently the number was being saved as a string (used the 2d array utility to make the array, so either that has something to do with it or the fact that one row is strings makes the other be strings). In any case, int(ArrayValue) fixes it.

  • Yep, that utility only saves values as strings.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)