UPDATE
i got a little bit of progress, and im very happy with it so far but there is one little glitch that i dont know how to fix. okay, so i have the "talk" variable. i have the wire actor around the npc actor (ethel, the blue-green dragon). NPC has no events, hes just there to look pretty :3
the wireframe around NPC has a few events. first off it has two Collision events, one for both players. they are essentially the same save for changing out the player actor's names (draco and jacree). it basically disables the keydown for either jacree or draco (depending on who bumped into the wireframe). it then brings up the icon of who is talking on either the left or right side of the screen, then the textbox, the text itself, changes the text to what Ethel says initially, and lastly sets "talk" to 1 if it is zero.
- Code: Select all
PhysicalResponse(MOVE_COLLIDE_ACTOR_ONLY, USE_CALCULATED_MASS, 1.000000, 1.000000, 0.000000, 0.000000);
EventDisable("Draco", EVENTKEYDOWN);
CreateActor("Icon", "Ethelicon", "IconR", "(none)", 0, 0, false);
CreateActor("TextBox", "Text1", "TextR", "(none)", 0, 0, false);
CreateActor("texty", "icon", "TextR", "(none)", -100, -10, true);
strcpy(texty.text, "Hey Draco, I think I am lost :3");
if(talk == 0);
{
talk == 1;
}
it also has a create actor event, so when it is created it sets the "talk" variable to 1.
- Code: Select all
talk == 1;
whew, this one is a bit longer! the last event on the wireframe is this one. first off, there is an if statement. if the actor count of text actor "texty" is greater than zero (so the code wont go off any other time), it sets off the if / else string. after that, it just says different things depending on what "talk" var =. with each value, starting from 1 - 3, it changes what Ethel says, progressing to 4. it also gives "talk" var +1 so the next time you hit "->" it will set off the next phrase. at 4, instead of giving "talk" +1, it makes it =1 so the talking can start over again.
- Code: Select all
if( ActorCount("texty") > 0);
{
if(talk == 0)
{
{
talk = talk +1;
}
}
else
{
if(talk == 1) {
strcpy(texty.text, "Oh! I almost forgot!");
talk = talk +1; }
else
{
if(talk == 2) {
strcpy(texty.text, "Tell your brother that ive got something for him!");
talk = talk +1; }
else
{
if(talk == 3) {
strcpy(texty.text, "This place is scary...");
talk = talk +1; }
else
{
if(talk == 4) {
strcpy(texty.text, "Do you know how to get home?");
talk = 1; }
}
}
}
}
}
now here is the problem, when you first collide with the wireframe, it brings up what Ethel initially says (i think i am lost) like the collision event does. but the "->" keydown event will not do anything. so you press "f" to exit the dialogue, and collide again and it will work perfectly. not sure why, hopefully ill figure it out soon and it shouldnt be too difficult. i suspect it has something to do with the Collision event :3 also, does anybody know how to create a paragraph instead of one really long line of text?