[Solved] How to call "System.CreateRelObjIP"?

This forum is currently in read-only mode.
From the Asset Store
Medeival & Viking War Horns Sounds / 22 Unique Calls / 2:40 minutes of audio
  • My goal is to replace "Create Object at Image Point" ex:

    -> System: Create object objB on layer 1 at (0, 0) from objA 's image point "point"[/code:2ymszz8n]
    to python script. 
    
    I try to call 
    [code:2ymszz8n]System.CreateRelObjIP(objB, 1, 0, 0, objA, "point")[/code:2ymszz8n]
    But get error message
    [quote:2ymszz8n]Type Error:CreateRelObjIP() takes exactly 6 arguments (7 given)
    
    
    How to pass parameters to System.CreateRelObjIP()?
    
    My construct version:Construct class 1.2
    
    Edit:
     "System.Create()" may not work, too.
    
    Edit:
    I try 
    [code:2ymszz8n]System.CreateByName("objB", 1, 0, 0)
    SOL.objB.SetPositionToObject(objA, "point")[/code:2ymszz8n]
    and doesn't work.
    
    Test cap is here.
    [url=http://dl.dropbox.com/u/5779181/create_rel_image_point.zip]http://dl.dropbox.com/u/5779181/create_ ... _point.zip[/url]
  • This syntax should work:

    System.CreateByName("objB", 1, 0, 0)

    SOL.objB.SetPositionToObject("objA", "point")

    Note: The quotes around objA.

    There might be a bug in the other function as the prototype shows it takes the # of arguments you are sending... maybe ROJO has an idea.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • But how to index objA[1], if there are many objA?

    System.CreateByName("objB", 1, 0, 0)
    SOL.objB.SetPositionToObject("objA[1]", "point")[/code:24de8rgx]
    It doesn't work.
    
    Thanks
  • I'll have to look into it but it seems that CreateRelObjIP is indeed missing a parameter.

    Try this to do exactly what CreateRelObjIP would do.

    System.Create("Sprite", 1, Sprite2[1].ImagePointX("point"), Sprite2[1].ImagePointY("point"))[/code:1aur1a40]
  • That's cool~ Thanks

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