shukshuk's Recent Forum Activity

  • It might take some time, but I'm planning to.

    BWT: Ashley suggested against all the object referencing we discussed here since it doesn't work in production.

    Instead I have to init each one of the actors using an action and keep a reference to it that way instead.

  • when you say object parameters do you mean instance variables? can you attach a code snippet to show what you mean?

    currently I was doing something like

    if (currObjType.name === "dialogbox") //

    // get an instance and do some manipulations on it

    //

    Thanks,

    Shuky

  • Ashley, any plans on removing the object name obfuscation as you mentioned here? this really gives a hard time when developing plugins.

    (Especially if you want to design complex UI interactions with specific sprite objects)

    It would also be nice to point it out in the sdk documentation under Object.Type.name for future generations,

    It was really frustrating to understand that I have a problem, only after deploying my game to a server staging env.

    (not to talk about needing to completely rewrite my code after that. |RANT| )

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks,

    I took your latest code and modified it a bit.

    Apparently you don't have to create new instances.

    You can just get the the existing instances of each one of your objects and manipulate them using:

    var objInsts = objType.instances [/code:1t1n3x7v]
    so I'm just taking the relevant object types and picking their instances.
    
    Thanks for all your help!
  • 509Dave16, I'm trying this, and it is a good direction with one problem.

    When I call the line:

    var objInst = this.runtime.createInstance(objTypeID, this.layer);[/code:1dw0g48t]
    lt tries to create a new instance of a singleton plugin (like keyboard for example) and throws an exception.
    
    I wanted to filter by the typeName, but apparently you are using your objInst for getting the type name. is there any other way to get the current instances typeNames? do you know any way around this?
  • Thanks, 509Dave16!

    I'll test it out and let you know.

  • Thanks for the reply

    I want to manage the dialogs externally.

    I'll try to elaborate some more:

    I have two actors, let's call them Joe and Jasper

    So I have a sprite of joe, with a sprite font named dialogbox-joe pinned to it, and a sprite of jasper with a sprite font named dialogbox-jasper

    When calling getNextDialogLine("joe","jasper", somestate) let's say its joe's turn to speak; this is what I want to do from within the plugin

    1) set dialogbox-jasper to be invisible

    2) set text for dialogbox-joe

    3) set dialogbox-joe to visible

    I don't mind changing my design, but I do want to keep the code contained in the plugin.

  • Hi, I'm currently trying to implement a dialog system for construct2 (we are building an adventure game).

    The idea is to have a spritefont object that hovers over the character's head with text that changes according to the game's current state and actors (we want to avoid code bloat in the eventsheet).

    I've already implemented a plugin that has a getNextDialogLine(actor_a, actor_b, state) function that's returning the next dialog line

    between two actors in the scene according to the game state.

    How do I bind this function to a Sprite Font element? should I write a behavior? can I access it throught the plugin? any clues will be welcomed

    Thanks,

    Josh

shukshuk's avatar

shukshuk

Member since 18 Apr, 2014

None one is following shukshuk yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies