Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Your questions... (https://forums.graalonline.com/forums/showthread.php?t=32825)

screen_name 07-03-2002 10:44 AM

Your questions...
 
please post your basic/advanced questions here that are NPC related, please do not make a thread for every little problem



btw, i have started this topic because i agree with python about all the topics

Artificial_Sweetener 07-03-2002 02:15 PM

Hmm.. this is odd,
I'm reading rabid's StringVariable tutorial and I came to a point where it tells you about setting a string variable and I'm having a problem.
NPC Code:

if (playerchats) {
setstring welcomemessage,#c;
}



Everytime I try this it deletes the Flag 'welcomemessage=hello' instead of changing it.. Any Idea why? :(

[edit]
Also I was wondering about the old guard guy in dustari.. What did they use to make it follow the player? I thought followplayer didn't work 0.0?
[/edit]

nyghtGT 07-03-2002 04:03 PM

Quote:

Originally posted by Artificial_Sweetener

[edit]
Also I was wondering about the old guard guy in dustari.. What did they use to make it follow the player? I thought followplayer didn't work 0.0?
[/edit]

probably just made it so the npcs x and y changed accordingly to the players x and y...

screen_name 07-03-2002 09:15 PM

well, it depends on when you call the setstring command


if you do
NPC Code:

if (playerchats) {
setstring welcomemessage,#c;
}



but if you have it running in a loop, then its doubtful that the player will have chat text on ever loop execution

and if it is ran in a loop execution, you could do

NPC Code:

if (timeout) {
if (!strequals(#c,)) {
setstring welcomemessage,#c;
}
}


Artificial_Sweetener 07-04-2002 05:31 AM

:: reads all of Rabid's tutorials ::

Geez I need more... I read and learned everything in Rabid's tutorials in 15 minutes..

Do you know where I could find some more? Most of the tutorials on the graal2001 site have a broken link to the download location..

Plz.. :(

screen_name 07-04-2002 11:12 AM

i'll help you learn, contact me:

aim: LoganTwlv
msn: [email protected]

Python523 07-04-2002 11:13 AM

rabid didnt make em, stefan did ^.^ they were in the uploads folder of the FTP, he just made em public

Artificial_Sweetener 07-04-2002 12:30 PM

Quote:

Originally posted by Python523
rabid didnt make em, stefan did ^.^ they were in the uploads folder of the FTP, he just made em public
Oh heh -.-

Artificial_Sweetener 07-08-2002 01:03 PM

Hey one of you mods... sticky this. it would help ease off the mass of question threads =]

CheeToS2 07-08-2002 07:18 PM

K.. I see ":" in some scripts.. what is it for?
same with "?"

and with the "in" thing.. I see some stuff after that is contained in "< #,#,#,#>"

wouldn't it be { } instead.. since its an array? or something?
*super confused*

Bhala 07-08-2002 09:42 PM

? and : are used together as a simple if else statment mostly used for seting vars

this.hat = (myvar<1 ? 1 : 2);

that is the same as doing this:

if(myvar<1){
this.hat=1;
}else{
this.hat=2;
}

CheeToS2 07-09-2002 12:33 AM

Quote:

Originally posted by Bhala
? and : are used together as a simple if else statment mostly used for seting vars

this.hat = (myvar<1 ? 1 : 2);

that is the same as doing this:

if(myvar<1){
this.hat=1;
}else{
this.hat=2;
}

<3 to you

Bhala 07-10-2002 12:48 PM

i know about in's too but i dont rembemer about the <> part but here is what i know...

var in |20,200|

is the same as:

var>20 && var<200

also you can do:
var=1;
this.array={1,23,4,5,3,0};
var in this.array

that would be true


All times are GMT +2. The time now is 03:08 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.