dop2000's Forum Posts

  • Array.width means the number of elements (or columns) on its X axis. In your case it's the number of items, +1 for the column with labels.

    I meant you should give your animations in the Items sprite the same names as you have in the array - "Spring_Helmet" animation, "Rock_Helmet" animation etc. It will make everything much easier.

    .

    You need to experiment, try other people's projects and tutorials, change different things, see what happens etc. This is the only way to learn in programming.

  • kriand beat me with the answer, but since I've already typed it I'll post it anyway :)

    In the array editor columns are X axis and rows are Y axis.

    For example, to get "Jump" property of Spring_Helmet, you can use Array.At(1, 4)

    The "FULL NAME" row from your table can be a unique identifier/code of each item. You can use the same code as animation name.

    So to pick a random item from the array you can do this:

    Set local variable randomItem to int(random(1, Array.width))
    ItemSprite set animation to Array.At(randomItem, 1)
    if Array.At(randomItem, 3)>0 : Set P1_Speed to Array.At(randomItem, 3)
    if Array.At(randomItem, 4)>0 : Set P1_Jump to Array.At(randomItem, 4)
    etc.
    

    Or you can create a bunch of functions to retrieve different stats from the array, as I did in the example I gave you in one of your previous posts.

    .

    PS: you should not use the first column of your array for labels. something like that is in better hands separately.

    Why not? He just needs to remember that X=0 is reserved for stats names.

    Having this column makes it easier to edit data in the Array Editor. Also it allows to create a universal function "GetItemStat", that will return any stat for any item, say Function.Call("GetItemStat", "short_sword", "damage")

  • Tom, Redirection still doesn't work for many old posts. If you try clicking links from FAQ, about 30-40% of them won't open.

    Also many external links completely disappeared from posts and comments. For example, half of the comments in this extremely useful post with audio resources now look like this:

  • Non-static local variables reset to their default value on every tick. So it's not possible to monitor them in Debug mode. You can only see static local variables.

    Use Browser-Log in events to output the contents of local variables to browser console.

  • You do not have permission to view this post

  • It's not recommended to use Physics together with other non-physics behaviors, but it's possible if you do it with caution.

    If you are using Platform or similar behavior to move an object, make sure that Physics behavior on this object is disabled. And when Physics is enabled, disable Platform. Don't move objects with enabled Physics using non-physics methods or by changing their position directly (like "Set X", "Move at angle").

    .

    Pathfinding plugin doesn't work well in platformer games, it's better suited for top-down view. Making enemy AI in platformer can be a tricky task, you can search the forum for some examples, try these links:

    construct.net/forum/construct-2/how-do-i-18/-how-do-i-frequently-asked-que-41236

    scirra.com/store/royalty-free-game-templates/super-platformer-ai-2462

  • See how the "On Turret2 shoot" event has a little green arrow on it? This means this is a triggered event. Try not to put triggered events nested under some other events, they should always be at the top-level!

    So try changing your code to this:

    Cannon1 On Turret shoot
     Cannon1 has LOS to Cyborgs -> Cannon1 spawn CannonFire
    

    The cannon will follow cyborgs, but only fire at them when they are in sight.

    .

    If you want your cannons to ignore targets that are behind obstacles, this becomes more complicated. In this case you should remove "Add target" action and use "Acquire target" instead. "Acquire target" assigns a specific instance of the enemy object to the turret.

    So your code could be something like this:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Maybe this has nothing to do with Construct. Open the Task Manager, Performance tab, see if there are any sudden spikes in CPU utilization.

  • Yeah, this code makes no sense, but it's working as it's supposed to.

    Pigs (Pig2 sprites) are moving in arcs because pathfinding is clashing with bullet behavior. If you disable Bullet, Pig2 sprites will move straight to the first instance of Family2. (Since there are multiple Family2 instances, an instance with the lowest UID is used as pathfinging target in event #7).

  • After you upload it, use "img" tag:

    [img=4172]

    Here is your image:

  • I think you should use TileMap.

    See this example, it's the same principle:

    dropbox.com/s/8zap7yuhwdb0pcb/Farming_TileSet.capx

    dropbox.com/s/r1em8npglbdsoeg/Tilemap_Bitwise.png

  • Not unless you have other events or behaviors preventing this.

    Why don't you just share the capx? We'll be able to tell you how to fix it straight away.

  • nicmic

    Well, like I said - check turret properties, compare them with the template. If this doesn't help, please share your capx.

  • So what's wrong - does it turn? Does it fire?

    Check turret properties - rate of fire, initial state, range etc.

    Open the default template for turret (File-New in Construct and type Turret) and compare settings with your project.

  • Are these sprites? I suggest using TileMap object.