99Instances2Go's Recent Forum Activity

  • RobertMKD

    Are the objects on different layers ? Are you using a family ?

  • rexrainbow

    I never got the board plugins working. Always crashing on me. Even that example trows me this error ....

    Uncaught TypeError: this.GetBoard(...).xy2NeighborDir is not a function

    at behaviorProto.Instance.behinstProto.target2dir (Rex_GridMove_behavior.js:211)

    at behaviorProto.Instance.Acts.MoveToLXY (Rex_GridMove_behavior.js:701)

    at Action.run_object (eveng.js:1848)

    at EventBlock.run_actions_and_subevents (eveng.js:931)

    at EventBlock.run (eveng.js:888)

    at Runtime.executeSingleTrigger (preview.js:4949)

    at Runtime.triggerOnSheetForTypeName (preview.js:4868)

    at Runtime.triggerOnSheet (preview.js:4800)

    at Runtime.trigger (preview.js:4777)

    at pluginProto.Instance.instanceProto.onMouseDown (Mouse_plugin.js:127)

    at HTMLDocument.<anonymous> (Mouse_plugin.js:66)

    at HTMLDocument.dispatch (jquery-2.1.1.min.js:3)

    at HTMLDocument.r.handle (jquery-2.1.1.min.js:3)

  • One of many solutions.

    https://www.dropbox.com/s/94yqb9cccw2jo ... .capx?dl=0

    It is important to have only ONE 'for each' / object. Else you gonna hurt performance.

  • You do not have permission to view this post

  • 283 & 285

    You dont pick any EnemyShip in those 2 events. So they are un-referenced, which is the same as a 'pick all'.

    So, they all (each and every one) find a path every second (not that good for performance too) ...

    And, they all (each and every one ) stop when the condition is somehow true.

    System > Compare two values is only a logical condition, it has not 'pick' function.

    You need a 'for each enemy', but then you surely have to bundle 283 & 285 in one 'for each', else you gonna drop performance to turtle walk in the end.

  • Sure, you can use a conditional operator like

    player.perk="triforce" ? int((player.dexterity + 10))/5 : 0

    but it should be round( (player.dexterity + 10) /5 ) ?

  • LOL that BSOD !

  • Yesh, that is how it works. Now you know almost everything there is to know.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Using a globals as requested.

    https://www.dropbox.com/s/07fus6w961l81 ... .capx?dl=0

    But, as you see, you need an event for each global. The event sheet will get way to long. And at one point you get lost in all those events. Why not use a dictionary ?

    https://www.dropbox.com/s/zfbkqdzuvoj5q ... .capx?dl=0

  • You do not have permission to view this post

  • To save yourself from endless looping, just use a lookup table.

    In c2, the most easy lookup table is a dictionary.

    But, lets do it with the second best candidate: a 1D array.

    Using a 1D array, we can use .....

    The condition > Array > Contains value (value)

    The expression > Array.IndexOf( value )

    ..... to get an the index of a found value in return

    Both scan the whole array, and that is not what we need, so i made a 1D lookup table (event 22) with only the values that they are allowed to scan (the 2nd value in ArrayForSequencing)

    From there it is easy, as you see :

    https://www.dropbox.com/s/qpclzk430wxf3 ... .capx?dl=0

  • The first pick makes 'the picklist' where the subs start picking from.

    Loop

    Pick Hotkey with ID = loopindex <-------- the picklist contains now that one Hotkey

    Hotkey Assigned is not -1 <----- picks from previous picked list (containing the hotkey with ID=loopindex), if it exists the new picklist contains a hotkey with ID = loopindex and Assigned =not -1, if it dont exist the new picklist is empty an no matter the action that follow ... they have have no Hotkey to work with

    Lets assume Assigned = not -1, now the picklist contains 1 hotkey with ID = loopindex and Assigned =not -1

    now you set current to the loopindex

    Pick Hotkey with ID = current <------ since current = loopindex, that hotkey is in the previous picked list, it is an unneeded pick, but yeah it works

    Pick Hotkey with ID = current - 1 <-------- the previous picked list is not ever containing that hotkey, it contains only the hotkey with ID = current, since it dont exist in the previous picklist, the new picklist will always be empty and the condition untrue

    So, concluding, the pick hotkey with ID = current is totally not needed, it is picked already.

    To make the pick Hotkey with ID = current - 1 work you first need to make a new picklist that contains that Hotkey.

    Or use a 'pick all' before that condition, or use a function (a function always starts picking from scratch)

99Instances2Go's avatar

99Instances2Go

Member since 12 Feb, 2016

Twitter
99Instances2Go has 2 followers

Trophy Case

  • 8-Year Club
  • Email Verified

Progress

9/44
How to earn trophies