Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
NPC Dialog Error #182574
02/07/08 17:10
02/07/08 17:10
Joined: Feb 2008
Posts: 27
Germany, Hessen
C
Crackdown90 Offline OP
Newbie
Crackdown90  Offline OP
Newbie
C

Joined: Feb 2008
Posts: 27
Germany, Hessen
Hi,
i cant find the error in this!



this is my start screen:

Code:
// don't forget to include npc1.wdl
// attach action npc1 to your non playing character

function npc_talks(); // function prototype

string npc1_str = "Yeah, a good day to you too";
string npc2_str = "No, I'm not interested in buying used 286 computers";
string npc3_str = "I can't talk to you - I have to clean my helmet";
string npc4_str = "I'm not talking to you from now on";
string npc5_str = "Hm hm hm...";

text npc_txt
{
layer = 22;
pos_x = 0;
pos_y = 0;
font = standard_font;
strings = 5; // 5 "lines" for this npc
string = null;
flags = d3d;
}

action npc1
{
clip_size = 0; // show all the triangles for all the models
while (1)
{
temp.x = player.x - my.x;
temp.y = player.y - my.y;
temp.z = 0;
vec_to_angle(my.pan, temp); // rotate towards the player

ent_cycle("stand",my.skill9);
my.skill9 += 1.5 * time;
if (my.skill9 >= 100) {my.skill9 = 0;} // play "stand" animation

my.skill10 = vec_dist(my.x, player.x);
if (my.skill10 < 200) // player comes closer than 200 quants to the npc
{
if (my.skill11 == 0)
{
my.skill11 = 1; // the npc says a single "line" (fake exclusive_global)
npc_talks();
}
}
else
{
my.skill11 = 0;
}
wait (1);
}
}


function npc_talks()
{
if (my.skill12 < 5) {my.skill12 += 1;} // strings from 0..4 = 5 strings are allowed

if (my.skill12 == 1) {npc_txt.string = npc1_str;}
if (my.skill12 == 2) {npc_txt.string = npc2_str;}
if (my.skill12 == 3) {npc_txt.string = npc3_str;}
if (my.skill12 == 4) {npc_txt.string = npc4_str;}
if (my.skill12 == 5) {npc_txt.string = npc5_str;}

npc_txt.visible = on;
waitt (48);
npc_txt.visible = off;
}



Its a tut from AUM!

Thanks


Deadly Awaking in the Outback Please Visit! Upcoming 08, a Flight in the death...
Re: NPC Dialog Error [Re: Crackdown90] #182575
02/07/08 17:31
02/07/08 17:31
Joined: Feb 2008
Posts: 337
V
Vadim647 Offline
Senior Member
Vadim647  Offline
Senior Member
V

Joined: Feb 2008
Posts: 337
1. Try using something other than standart font, it sometimes lags without any visible reason
2. Try changing 'string = null;' to 'string = "","","","","";'.


I switched to other account since marth 2010. Guess which.
Re: NPC Dialog Error [Re: Vadim647] #182576
02/07/08 17:33
02/07/08 17:33
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Did you define "standard_font" somewhere?

Re: NPC Dialog Error [Re: Xarthor] #182577
02/07/08 17:38
02/07/08 17:38
Joined: Feb 2008
Posts: 27
Germany, Hessen
C
Crackdown90 Offline OP
Newbie
Crackdown90  Offline OP
Newbie
C

Joined: Feb 2008
Posts: 27
Germany, Hessen
sry, im new, i dont know, what other font should i try?

thanks


Deadly Awaking in the Outback Please Visit! Upcoming 08, a Flight in the death...
Re: NPC Dialog Error [Re: Crackdown90] #182578
02/08/08 09:22
02/08/08 09:22
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
If you did not define the standard_font somewhere you can do so at the beginning of your script file:
Code:

font standard_font = "Arial",0,12;



Re: NPC Dialog Error [Re: Xarthor] #182579
02/08/08 22:16
02/08/08 22:16
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline
Serious User
PadMalcom  Offline
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
I'd recommend my DialogED, you won't have any problems implementing dialogs in your game Just see my signature.

Re: NPC Dialog Error [Re: PadMalcom] #182580
02/10/08 14:24
02/10/08 14:24
Joined: Feb 2008
Posts: 27
Germany, Hessen
C
Crackdown90 Offline OP
Newbie
Crackdown90  Offline OP
Newbie
C

Joined: Feb 2008
Posts: 27
Germany, Hessen
thanks


Deadly Awaking in the Outback Please Visit! Upcoming 08, a Flight in the death...

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1