So I am a newb at flash and you guys seem reasonably nice (compared to some other places)
So I was wandering if you were willing to help. I appreciate the help of anyone but to the experienced programmers - please don't laugh if my code looks stupid.
In a point and click game what is the best way to speak to characters? I have thought about adding another frame in the character and a bunch of movie clip buttons but I don't really like this idea.
Then maybe just a uniform dialogue movie clip (a blank square) that attaches to the scene when you click a character and fills up with dialogue. Then it unloads once you are done. This method seems like it could get messy when coding. I was thinking maybe an array to store dialogues of the different characters, another array to store the unique button labels (like hello) for each character. But maybe its over complicated?
I think the first method is just better because it's the simple solution, but something tells me that both these ideas are bad.
Kind of hard to get a picture of what you need -- got any screenshots?
A point and click game could be a few things. Is it a static screen with things to click on like Myst? Or is it more like Monkey Island where you click and your character moves?
I think both solutions sound okay. Do what is easy and easy to maintain (and doesn't hurt performance).
Insert a new layer labeled dialogue. Create the talking bubble or square, create 2 if you have another person talking.
Then click on the keyframe and highlight it, modify>convert to symbol.
Converting the keyframe to a symbol (and don't forget to name the instance) instead of the object itself makes it a separate video to play within the main (root) timeline.
Then you can keep control of the conversation by adding an additional layer on the newly created symbol and giving a label name like "hello" and "bye" ... dialogueBox.gotoAndStop("hello" dialogueBox.gotoAndStop("bye" ...
there may be a better way to do this but this one works for me
What I prefer most, is a class injecting a semi transparent frame on top of the display list, holding the text you want. You can have properties about the alpha amount, the font to be used, the window size of the frame etc. Now, whenever you need the dialogue displayed you just call the show method of the class, passing the resource id (if you have all the dialogs in an XML) or the text itself.
@ boppins - just a black box on the screen with the same 3 dialogue buttons (which change labels depending on who you click) @weirdlike - that seems closer to my first solution @strouthas - i know nothing about classes
var format:TextFormat = new TextFormat(); var myFont:Font = new Arial (); format.font = myFont.fontName; message_txt.defaultTextFormat = format; message_txt.text = "You awake from sleeping...";
Also.. Whenever I pick up an object it unloads the movie clip (that was the object) When I go back to the original scene that object comes back.
To counter this I decided to have all my scenes on one frame, and move the whole scene by about 500px when I click an arrow to go somewhere else. I realized that this could hurt performance?
Do you think when I pick an object, I can push values into an array. Depending on what values the array contains, it removes the object from the scene, and each time I go back to a frame it checks all the values and removes objects accordingly.
additional frames are kinda not good but you can try this
on the first frame add
var box:Boolean = true;
on the 2nd frame (or whichever) check if it is true
if (box) { trace("box true" //true function here } else { trace("box false" box.visible = false; //function here }
don't forget to add the trigger that makes it false so the box is hidden the second time around and the var is on the first frame so it only gets changed through actionscript
I suppose so, if you wanted one visible and the another invisible you would need a separate variable for it to work, you can also check to see if it is false so if you wanted one visible while the other is invisible and vise versa