-
anyone know why i cant get two talking NPCs in one room with this code??
onClipEvent (enterFrame) {
if (this.hitTest(_root.hero)) {
_root.talk.gotoAndStop(2);
_root.talk.message = "Hello. how are you today...etc!";}
else {
_root.talk.gotoAndStop(1);
}
}
i asked this earlier but no one ever found out so i'm asking again...
BTW: nice game jorosdaman
-
godly++;
is your message text box nested in frame 2 of the npc?
is your text box names message?
-
godly++;
BTW - thanks for the compliment.
-
no the text box is located in a different MC. that way i can use the text box over and over again. the message is the instance name of the dynamic text field
-
Gross Pecululatarian
At any time at least 1 NPC will revert to the else making the textbox goto the off frame. Take out the elses and put a timer on the talk box so that after say 1 sec of being changed, it turns off.
-
-
Gross Pecululatarian
Say all your MC's target an MC called talk and in it is a variable called text. To speak, they set _root.talk.text = "Blablabla";
Now, in talk put somthing like:
Code:
onClipEvent(enterFrame){
if(text != oldText){
// Timer Stuff
}
oldText = text;
}
-
that doesnt seem to work...
i cant get the timer to time out...although i just guessed on how to create the timer
im using this code for the timer: what's wrong with this??
Code:
onClipEvent(enterFrame){
if(message != oldMessage){
getTimer();
this.gotoAndStop(1);
}
oldMessage = message;
}
lol. i know, im pretty bad
- Teddy
[Edited by ZGOteddy on 04-03-2002 at 06:54 PM]
-
incredibulus-actionscriptum
another cool idea would be when the hero hits the npc dude you lock the hero in place by setting lock= false and then use arrowkeys to scroll the text and spacebar to unlock the hero
by the way did that fix i sent you worked for you ?
ciao
-
cool
that would be cool. yup it worked. i thought i sent a reply to you thanking you. the graphic changes that you made are cool. but theres one thing that i dont understand. the hit test with the non-walkable objects is really sharp now. you can walk really close to them. what did you change to do this??
anyone know how to fix that timer problem and or the NPC talking in two rooms problem??
-
incredibulus-actionscriptum
i sent you an email let me know if you get it
this is the swf
http://digilander.iol.it/magneto1/zeldawalk7.swf
its not perfect i changed some graphics hope you dont mind
i never happy with the graphics
cia
no preloader 94kb flash5
-
-
i still cant get the timer thing to work. i've been trying mutiple techniques and i have followed magnetos' gettimer thread but i can't figure it out. anymore suggestions on the gettimer problem and or two talking NPCs been displayed in the same room??
- Teddy
-
incredibulus-actionscriptum
check this out
http://digilander.iol.it/magneto1/timerhittest.swf
http://digilander.iol.it/magneto1/timerhittest.fla
the counter stops at 50 thats only to show you the time delay between the openning of the message window and its closing
i think a value of 5 should be all right ..
the code is fearly simple if you have any questions free feel to ask
i was trying to use a delay function using getTimer but
i see its not worth it
cia
-
Senior Member
Magnetos, your timing fails, when you open second text box, while first is still opened.
I dunno, if Im explaning it clearly
goto left guy>>text opens>>goto right guy>>text changes, same time left starts counting>>move to center>>text closes, when left counter gets to 50
I think it should stay opened until right counter gets to 50
-
wow. that was so simple. cool. thanks for the help. now what should we talk about in this discussion now??
-
godly++;
ok, need new topic? how about this one.
in the town of my game [ http://www.omninet.net.au/~timbooth/dreams.html ] i have several npc's, all walking around randomly. they dont stop or anything, just walk around tha town.
now, i havnt done this yet, because i havnt tried, and dont really know how, but i WANT to do this.
random responses.
i want my character to be able to walk up to an npc, and click on a talk button at the bottom of the stage. this will freeze npc movement
[ i can do this ]
then, i want the npc to randomly say one of 5 responses, either chosen from frames of a mc, or from global variables.
[ i can do this also ]
but, i then want to be able to type a response, and for the npc to respond to key words. ie;
npc : Welcome to Woody Hollow. I am your local Weapons Expert, trained in the art of Bow and Sword. How may I help you?
you: .............."Sword"..............
so, if you respond with an answer containing a key word, such as sword, help, bow, magic, armour, towns, yes, no...etc, it promps and npc response.
[ this i cant do ]
the character will then access the infomation wanted, ie, learn how to use a sword, where is the next town, where he can learn magic master etc, and end the conversation, again with a button, or type goodbye. (how to talk to npc's will be included in a readme for those retarded non-rpg player type ppl)
anyone got ANY help whatso-ever?
thanks fellas
-
incredibulus-actionscriptum
well tony its not real failure because the delay is set to 50 if you set the delay to 5
link will never reach the other guy before delay =0
and there is only 1 mc window which contains the textfield
its not perfect i know but it works
also as i said before it would be nice if link wouldn be able to move while talking and when finished press a key to
unlock it
i would avoid the use of the mouse completely
also the inventory system would be much nicer if looks more like the real zelda inventory you know.... push a key and the inventory slides down from the top
to ZGOteddy if you using the last fla that i sent you be warned there is a lot of garbage code in it i forgot to delete
like double hitTests
delete it
and one more thing i know you use flahmx so becarefull
the background mc instance name is "floor" which is also a
math function which flashmx recognize even without the use of Math.floor (you can see that floor is blue highlighted)
i am not sure but this may cause some problem later on ...
to jorosdaman ummm i am afraid i cant help there
what i suggest you is to make things much easier
if hero random sentence =3 then npc sentence= 3
just a tought
cia
-
thanks for the help. i just took the changes you made to the background mc and the code to the hero and adjusted the original. i also used some of your cool design changes. i agree with the random script thing. thats the easiest way of doing the random sayings.
-
godly++;
oh well.....
the thing is, i dont want it to be just a random response. all i want to know how to do, is to check if what the player types contains a certain word. is that possible? i know that you can check for a whole string, ive done that before, but what about one particular section of that string?
anyway, back to the drawing board.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|