dop2000's Forum Posts

  • I would suggest using another behavior, but if you absolutely need Physics, you can set velocity instead of applying force.

    Is key down: Object set velocity X to 100

    Else : Object set velocity X to 0

  • You don't need to go through all values in the array. Say, if there are 100 objects and 5 lines, "For each XY" will process all 500 cells, you don't need that.

    You loop through records of objects, which are on X axis. And for each object you can grab values form the corresponding cells on Y axis.

    For example, if you need to get a value from the second line (Y=1):

    Array.At(loopindex, 1)

    or if you are using "For Each X":

    Array.At(Array.CurX, 1)

  • If there are only tree possible values, then a permutation table is an overkill. Here is a much easier solution:

    | Global number num‎ = 0
    
    + System: Every tick
    -> System: Set num to num=0 ? choose(1,2) : num=1 ? choose(0,2) : choose(0,1)
    -> Text: Append num & " "
    
  • It's difficult to understand that garbled code.

    I would suggest using "For Each X" loop, nor "XY".

    Or use the System For loop:

    System For "x" from 0 to array.width-1
    .. Create object Array.at(loopindex, 2)
    
  • First you push a value (zero for example), then change it to an object using "Set JSON" action. I also suggest storing the string in a variable, then you won't have to duplicate all quotation marks.

    local variable jString = {"instance_iid":9, ...}
    
    JSON Push back 0 to ".workstations"
    JSON Set ".workstations." & (JSON.ArraySize(".workstations")-1) to jString
    
    
  • only for the specific chat history?

    Yes, only for this chat.

    is it possible for anyone in the world to ask ChatGPT about Construct 3, and ChatGPT will remember its training?

    No.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What behavior are you using - Physics?

  • Don't use triggered events like On Tap or On Touch, they run only once.

    Use conditions like "Is touching object", which run continuously.

  • Z is another dimension, you probably don't need that here.

    Yes, you can store other data about each object at Y=2, 3, 4 etc.

  • Change array height to 2. Then you can store JSON string at Y=0 and object name at Y=1. Something like this:

    For each SpriteFam
    .. Array insert SpriteFam.AsJSON at index 0
    .. Array set value at X=0, Y=1 to SpriteFam.ObjectTypeName 
    

    To restore:

    Array For each X
    .. Create object by name: array.at(array.curX, 1)
    
    .... (sub-event)
    .... System Pick Last Created SpriteFam 
    ........SpriteFam set from JSON array.curValue
    
  • When you create a family instance, a random family member will be created. Even if you try to load its state from JSON after that, it won't change the object type.

    Do don't use "create family", you need to create the particular object. If you are using an array to store JSONs, you can save the object name in the same array. And then use "Create by name" action.

  • That's why everyone should use Debug Mode. You could've spotted this in 2 minutes.

  • If you disabled "Set angle" in bullet properties, you can use "Set angle of motion" action to direct it at enemy. For example:

    Bullet Set Angle of motion to angle(self.x, self.y, Enemy.x, Enemy.y)

    By the way, the link in your last comment doesn't work.

  • Here is a similar demo, maybe you could use it:

    howtoconstructdemos.com/floating-thumbstick-capx