RPG Style Text

You must understand the Game Editor concepts, before post here.

RPG Style Text

Postby sillydraco » Tue Jul 07, 2009 6:22 am

Alright, this is as far as i got before i just threw up paws in the air :3

i have some wire frame actors, two to show who is talking (left and right) and two to put the text box (left and right). i have a wire frame around the NPC who is talking to you, when you bump into that frame it stops the player, halts all events for the player that collided with it, and creates the text box, the text itself, and the proper icon. it then sets the text to what he says at first. i then set the text box with a couple of events, if you press "f" it will destroy itself, taking the icon and text with it, and reallows events for both players.

and thats where i stopped, due to cardiovascular asplosions...in my brain. what i want to do now is have a keydown event for "->" (right c-pad) to put up another line of text (actor "texty") and when there is no more text it destroys the text box or just doesnt do anything (imagines people smashing their -> key and wondering why no more text comes up x3) how would i do this? would it be a variable, counting how many times ive hit the -> key? or is it something even more complicated? and yes, i do realise im prolly doin it the hard way, but that seems to be my signiture style xD anyhoo, here is my demo, as well as a source file.

NOTE: character starts at the end of the level so you dont have to go through everything x3 i put the energy powerup next to you so you can kill the bats if they bother you.
Time for sleepy, dream of new things...new life, new reality, new wings.
Image
User avatar
sillydraco
 
Posts: 71
Joined: Fri Apr 03, 2009 7:54 am
Score: 3 Give a positive score

Re: RPG Style Text

Postby sillydraco » Tue Jul 07, 2009 7:18 pm

UPDATE

i have tried a few different codes, but they dont seem to work very well :/

i have a button down "->" on the frame actor around the NPC that is talking, if texty exists and i hit the keydown, it makes "talk" (my variable) = 1.

Code: Select all
if(ActorCount("texty")>0)
{
if(talk == 0)
{
    {
        talk == 1;
    }
}}


else
{
 if(talk == 1) {
     strcpy(texty.text, "Oh! I almost forgot!");
        talk == 2;}
else
{
 if(talk == 2) {
    strcpy(texty.text, "Tell your brother");
    talk == 3;}

else
{
 if(talk == 3) {
    strcpy(texty.text, "that I have something for him!"); }


else
{
 if(talk == 4) {
    strcpy(texty.text, "And um...by the way..."); }

else
{
 if(talk == 5) {
    strcpy(texty.text, "do you happen to know");}


else
{
 if(talk == 6) {
    strcpy(texty.text, "the way out of here?");}


else
{
 if(talk == 7) {
    strcpy(texty.text, "This place is full of monsters!"); }
}
}
}
}
}
}
}
Time for sleepy, dream of new things...new life, new reality, new wings.
Image
User avatar
sillydraco
 
Posts: 71
Joined: Fri Apr 03, 2009 7:54 am
Score: 3 Give a positive score

Re: RPG Style Text

Postby Hblade » Tue Jul 07, 2009 9:11 pm

Not bad at all :D I see your pretty god at sprites :/ Mind makign some :D
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: RPG Style Text

Postby sillydraco » Wed Jul 08, 2009 4:11 am

well...not bad until you get to where im stuck at :3

and sure i can make sprites if you want, i was thinking about releasing a sprite pack with land and trees and stuff.
Time for sleepy, dream of new things...new life, new reality, new wings.
Image
User avatar
sillydraco
 
Posts: 71
Joined: Fri Apr 03, 2009 7:54 am
Score: 3 Give a positive score

Re: RPG Style Text

Postby sillydraco » Thu Jul 09, 2009 6:37 pm

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?
Time for sleepy, dream of new things...new life, new reality, new wings.
Image
User avatar
sillydraco
 
Posts: 71
Joined: Fri Apr 03, 2009 7:54 am
Score: 3 Give a positive score

Re: RPG Style Text

Postby skydereign » Thu Jul 09, 2009 10:03 pm

It sounds like your variable recognition is off. I would need to see the ged to find the problem. One thing to change is the CreateActor that sets talk to 1. It should be
Code: Select all
talk=1;

Two equals, ==, is a comparison, like in your if statements. If you want to set talk, then one equal sign. You seem to set talk to 1 a lot, is talk being used to determine which text, or when text should be set? This can be confusing to explain, unless I have the most recent form of the ged. What do you mean by paragraphs? You can have new lines and other, a new line would be shown as \n within the text.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: RPG Style Text

Postby sillydraco » Fri Jul 10, 2009 8:18 am

oooh, yay! and here is the new demo. ive got it set! it works perfectly!
Attachments
screeny.jpg
SnF.zip
(2.32 MiB) Downloaded 215 times
Time for sleepy, dream of new things...new life, new reality, new wings.
Image
User avatar
sillydraco
 
Posts: 71
Joined: Fri Apr 03, 2009 7:54 am
Score: 3 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest

cron