September 21st, 2011

ALPACA Help Open Thread

Hi everyone, I’m going to leave this post up as an open thread for any questions, comments or issues you have using ALPACA. I can’t always answer questions immediately but I’ll do my best to respond promptly. Have at it!

55 comments to ALPACA Help Open Thread

  • Kate

    Thanks!!!! All works great now, I have made some actions with spokeDialog in Puzzle class and connected them to speechlines.js file – they are working perfectly. You were right about “still” animations. I didn’t put them to default frame.”Talk” frame of character, works as well :)

    The only thing that I have still problem with, is changing the playerScale or walkRate –
    I asked you about this under different tutorial, but maybe I will stick to this one, as it is the “main help centre” now. So I just want to change playerScale and walkRate on different bacgrounds.As you said, I changed in Engine, playerScale and walkRate from private to public static, and added to cases in newBackground function e.g Engine.playerScale=0.1; or Engine.playerScale=0.5; . I don’t get any compiler errors or output, but this is just not working (player doesn’t change its scale).
    I wonder if the problem is not with config data in Engine -> most of this stuff is
    set to private, and as “playerScale = configData.playerScale;”, maybe this makes it unable to change the playerScale from the Puzzle class level? But there is too many “config” information in Engine, so I don’t know which should be set to public then.

  • Kate

    Ok, I did something, and playerScale started to change! but it changes almost randomly, and not on this background, where is should be changed. I did the same experiment on sample project as well, and there is the same problem :(

  • Quinn

    @Kate – Can you post some code from your Puzzle class so I can see what might be going on?

  • Quinn

    @Kate – I see what the problem is with your playerScale; whenever a new background is created, it calls the newBackground method AFTER it’s already placed all the items and the characters, so it doesn’t use the playerScale value until the NEXT time it creates a background. Your character was being set to the scale for the room they just left, instead of the one where they just arrived. Here’s how to work around this: create a new method in the Puzzle class:

    public function setPlayerScale(thisBack:String):Number{
    switch (thisBack){
    case "mapa":
    return 0.1;
    break;
    case "room":
    return 0.4;
    break; // Repeat for the rest of the rooms
    default:
    return 1.0; // Or whatever the default is
    }
    }

    Now in the Engine class you’ll need to change the createBackground method. Around line 136 you’ll see the code
    player = new Player(stage, walkRate, targetBuffer);
    Right under this, before the code that sets the player’s scale, add a method call to the new method we just added in Puzzle, like so:
    if(toolbar) playerScale = puzzle.setPlayerScale(thisBack);
    (You have to check to see if the toolbar has been created yet, because the toolbar is what first creates an instance of the Puzzle class, more clumsy code on my part).
    That should fix your issue, I hope!

  • Kate

    I see it now, the problem was in changing backgrounds indeed.
    But your solution works! Now, it’s very easy to change playerScale in various backgrounds. Thanks a lot! :) )

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>