Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   What should be added to the commands... (https://forums.graalonline.com/forums/showthread.php?t=26892)

Goboom 04-03-2002 10:23 AM

What should be added to the commands...
 
a good command that could be added would be....
endfunction <functionname>;
that would hel big time so you wouldnt have to end a function by using scripts inside of it...dont you guys think?

Python523 04-03-2002 10:33 AM

a function ends automatically once the script inside it is over

Goboom 04-03-2002 12:36 PM

Quote:

Originally posted by Python523
a function ends automatically once the script inside it is over
i mean for when its in a timeout....:rolleyes: should have been more clear

zallus-k 04-03-2002 12:52 PM

.
 
Give an example of your command in usage, pertaining to how you failed to create this function before having this command.

Python523 04-03-2002 10:05 PM

Quote:

Originally posted by Goboom

i mean for when its in a timeout....:rolleyes: should have been more clear

easy to get around it, just set a var and increase it by one everytime time the function is called, increase it by one and when the function is greater than a certain number, make it so it wont call it

Goboom 04-03-2002 10:34 PM

Quote:

Originally posted by Python523

easy to get around it, just set a var and increase it by one everytime time the function is called, increase it by one and when the function is greater than a certain number, make it so it wont call it

ya i knew bout that....but it would be alot easyer if i had somthing like...
NPC Code:

if (playerenters||timeout){
timeout=0.05;
ShownameGoboom();}
if (playertouchsme){
endfunction ShownameGoboom; ShownameCoolio();}
function ShownameGoboom(){
message Goboom;}
function ShownameCoolio(){
message Coolio;}


screen_name 04-04-2002 05:17 AM

just have a variable keep track of what to show

NPC Code:

// NPC made by screen_name

if (playerenters||timeout) {
if (this.track==0) {
ShowName_Goboom();
} elseif (this.track==1) {
ShowName_screen_name();
}
timeout=.1;
}

if (playertouchsme) {
this.track=abs(this.track-1);
}

function ShowName_Goboom() {
message Hola Goboom!;
}

function ShowName_screen_name() {
message Hola screen_name!;
}


Kadar 04-04-2002 10:40 AM

hidesparrating <number>;
disablepause <number>;

Number is where the number you want the spar rating hidden, or the pause disabled k?
so..

disablepause 2;

That would disable the player from using the pause button for 2 seconds..

Lets say i wanted the pause button to never work?

if (playerenters || timeout){
disablepause 0.05;
timeout = 0.05;
}

Goboom 04-04-2002 10:53 AM

Quote:

Originally posted by screen_name
just have a variable keep track of what to show

NPC Code:

// NPC made by screen_name

if (playerenters||timeout) {
if (this.track==0) {
ShowName_Goboom();
} elseif (this.track==1) {
ShowName_screen_name();
}
timeout=.1;
}

if (playertouchsme) {
this.track=abs(this.track-1);
}

function ShowName_Goboom() {
message Hola Goboom!;
}

function ShowName_screen_name() {
message Hola screen_name!;
}


yes i know how you could do that...but my way is just shorter and easyer :D

Saga2001 04-04-2002 10:59 AM

Ummmmm...
There are 2 things that you can use...
Break; or Return;
they both end the function.
return is probably what you are looking for...

joseyisleet 04-04-2002 12:07 PM

-=Josey=-
A command that I would love to have added would be something like:

NPC Code:
if (created){
setimg door.png;
flipimg door.png,flipradius;
}


Maybe it's just me, because, I'm lazy. But, I'm sure I'm not the only one who hates having to open a graphics program and flip an image.

Goboom 04-04-2002 01:05 PM

Quote:

Originally posted by joseyisleet
-=Josey=-
A command that I would love to have added would be something like:

NPC Code:
if (created){
setimg door.png;
flipimg door.png,flipradius;
}


Maybe it's just me, because, I'm lazy. But, I'm sure I'm not the only one who hates having to open a graphics program and flip an image.

stefan said something about adding a command...called rotate...

AlexH 04-04-2002 01:13 PM

doesnt break do that then it continues with the script after the function

Goboom 04-04-2002 01:33 PM

you guys dont get what im getting at...

joseyisleet 04-04-2002 03:22 PM

Quote:

Originally posted by Goboom

stefan said something about adding a command...called rotate...

-=Josey=-
Oh, I haven't been home for the last two weeks. I was locked up. Now I'm out on bail and will be going back soon. :\

screen_name 04-04-2002 08:55 PM

i understand what he wants

:D

Spanko 04-04-2002 10:28 PM

Quote:

Originally posted by AlexH
doesnt break do that then it continues with the script after the function
It's return, but apart from that you're completely right.

Goboom 04-04-2002 11:23 PM

i know about all these commands (break,continue,and return) but just dont want to use them....i like mine....:D


All times are GMT +2. The time now is 09:05 PM.

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