99Instances2Go's Forum Posts

  • Conclusion: set timer behavior on the family, dont use 'for each'.

    edit: I understand what you try to do, and above suggestion is wrong. Deeply sorry.

    You have a bunch of differend sprites in the family, and you want only the instances of a certain sprite (member of the family) to move. I got that when i added more sprites to the family.

    At this moment, i dont know how to solve this, without a bunch of coding. Thinking.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Tokenat is used as follow:

    tokenat(string, index, separator)

    Return the Nth token from the string by separator.

    For example, tokenat("apples|oranges|bananas", 1, "|") returns oranges.

    So i suppose you store on the position (1,GoldUp,0) in the array a string like "50,gold,"

    Now tokenat(Array.At(1,GoldUp,0),0,",") will return the string "50"

    If it is not string or the string does not contain a "," then the tokenat is totaly useless. So i assume that is what you do.

    Tot make calculations with the string "50", we need to convert it to a number. Int() is the way to do that.

    So ... int("50") returns 50

    or in general it is int(tokenat(Array.At(1,GoldUp,0),0,","))

    But, you make it yourself very very very difficult.

    If GoldUP = goldproduction/tick then the array needs as many positions on the Y-axis as the maxium ever producable gold.

    Again (1,GoldUp,0) means no more then a position in the array. Position 1 on the x-axis, position GoldUp (wich can be zero but also 9999999999999999999)on the Y-axis, 0 on the Z-axis.

    On that postion you can store a value. But those values you will never ever find back. Because GoldUp keeps gooing and gooing. All youre values are from one second to the other second on another place in the array.

    It is ofcourse up to you to find a way to make that work. And maybe one day, when you have this working you can explain this to me again. (if i am still here)

    In the mean time, i suggest to look at my suggestion again. Or take some Array tutorials if you dont beleive me, all fine for me.

    Example ... GOLDMINE lvl 1, for 150 gold, 150 lumber ... and lets do it as you wish with a 3D array

    Make a global variable with the name 'GoldMine' = 1

    Make a global variable with the name 'Gold' = 1

    Make a global variable with the name 'Lumber' = 2

    I assume you have a variable 'level'.

    Now store the values in the array.

    Array > Set at XYZ(Goldmine,level,Gold) to 150

    Array > Set at XYZ(Goldmine,level,Lumber) to 150

    Retreive the values from the array.

    BuildCostInGold (for a Goldmine) = Array.at(Goldmine,level,Gold)

    BuildCostInLumber (for a Goldmine) = Array.at(Goldmine,level,Lumber)

    (and ofcourse, if GoldUP > BuildCostInGold, build the thing, substract BuildCostInGold from GoldUP)

    Okay now, lets do another building.

    Make a global variable with the name ''RandDunit" = 2

    Now store the values in the array.

    Array > Set at XYZ(RandDunit,level,Gold) to 400

    Array > Set at XYZ(RandDunit,level,Lumber) to 300

    And so on ..............

    As you see, the value of 'level' > you change. Meaning the values for different levels are stored on a different place in the array. And they can always be found back.

  • The sine behavior moves an object arround its initial state. There are 2 offsets where it is on exactly its intitial state. Since you dont want it to jump.

    Zero & Period/2

  • Understood, and that is difficult. Wel for me it is. I come back to this.

  • No can do, because that also implicates that you will not/can not download the required plugin LiteTween.

    How did Construct 2 arrive on your computer ?

  • Yeah.

    x= random(object(0).x,object(1).x) <--------------- translated

    object(nth).expression

    Where nth is the IID in a SOL. No SOL, ...NO meanigfull IID. No pickevent no SOL

    Now answhering again the 'here' in your question:

    Some pick condition.

    x= random(object(0).x,object(1).x)

    Asuming the pickconditon only puts 2 objects in the Selected Objects List

    Or did you post that image just to confuse poeple ?

  • Just as in real live, you need a ground.

    Set propertie 'Immovable' in the physics behavior of the green one to 'yes'.

    Or let the green one rest on a ground sprite with propertie 'Immovable' set to 'yes'.

  • Does this meets the needs ?

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

  • This is true. If you set an object as obstacle, it can not see to a point into that object.

    If you set an object as obstacle, you can not find a path to a point into its collission polygones too.

    Remains the question, why solids ? Is it needed ?

    I try to post you a kind of solution later today, with them all beeing solids.

  • Is the board a tilemap ?

  • In the same event. (no subs)

    Condition: sprite > drag&drop > On drop

    Condition: Sprite > is animation

    Condition: order = 1

    + your actions

    ?

  • Tokenat returns a string. Cant substract/add from/to a string. Got to translate the string to a number first. With int().

    No sure why you use a string for this in the array. And not sure why it has to be 3D.

    For me, it is easyer to store numbers in the array. Like.

    Store an ID on the X-axis that pairs with the house or the soldiier. So you know wich place on the X-axis is witch house or soldier.

    Now, if we write the positions in the array as (a,b) .... (yes just a 2D array) ...

    Then all values on the X-axis lay on positions .... (a = some ID, b = zero.)

    Now 'b' represents a whole big world we can use.

    Just note the 'b' positions down.

    Lets say

    position (ID,1) = price

    position (ID,2) = buildtime

    position (ID,3) = range

    position (ID,4) = color

    So storing the the range for soldier number 15 .... is easy as ...

    Array > Set at XY(15,3) to Range

    Retreiving the color for soldier number 12 ...

    color = Array.at(12,4)

    Hope this helps you.

  • Allow me to explain it this way.

    CoolBlue dileverd us a MathTeacher. The manual says we have 2 actions and 1 condition.

    Action 1 = Ask the dude to solve some mathproblem. ('Ask')

    Action 2 = Tell us the solution. ('Tell')

    Condition = On the moment that he knows the solution. ('On known')

    Manual also states that he takes some time to find the solution.

    So what we do ?

    We start with the action 'Ask'

    Then we make a top-level condition

    'On known' paired with the action 'Tell'.

    Now we do other stuff, like watching tv, and change some pampers, and wait till the dude is ready.

    All this time we make sure that we and no one else feeds the dude a new mathproblem, got to wait till he is ready. Else he will go crazy. And we lose the warranty.

    When the dude is ready, the 'On known' triggers, and the dude tells us the solution.

    What did you do ?

    You start with 'Ask' followed by 'Tell', under a trigger !

    But the dude is not ready yet, so he cant tell yet.

    So when he's ready he's holding his breath, eager to tell. But he cant, the actiont to 'Tell' is caged under that trigger.

    So the next time you use 'Ask' followed by 'Tell' that fast, the pure dude is stuck on what to do.

  • Did you really made a top level condtion (as explained in every tutorial) ...

    Sprite > pathfinding> 'on path found'

    Followed by the action Sprite > pathfinding> move along path

    ?

    As you can see in the tutorial on event 2 :