Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Dance Script (https://forums.graalonline.com/forums/showthread.php?t=17451)

Onyx_Brasil 11-21-2001 02:31 AM

Dance Script
 
i have a dance script, i want to do this:
when player enter in the level, only A button will appear
and when u press A u start to dance and when u stop pressing, u stop,,, how can i do it?

LiquidIce00 11-21-2001 04:39 AM

just use disableweapons;
then just do a keydown for the A button

royce 11-21-2001 04:43 AM

yah and for the dance script you would do a timeout with random sprites going on right? and random positions? i am just wondering

Faheria_GP2 11-21-2001 06:15 AM

sigh, i have given up hope of forcing the population to learn to do it themselves, here you go:

if (playerenters) {
timeout=.05;
disableweapons;
}
if (timeout) {
if (keydown(6)) playersprite=int(random(0,40));
timeout=.05;
}

royce 11-21-2001 09:53 AM

Quote:

Originally posted by Faheria_GP2
sigh, i have given up hope of forcing the population to learn to do it themselves, here you go:

if (playerenters) {
timeout=.05;
disableweapons;
}
if (timeout) {
if (keydown(6)) playersprite=int(random(0,40));
timeout=.05;
}

thats xactly what i had in mind! i am not going to use it i just wanted to know if i did it right...

Falcor 11-21-2001 09:57 AM

Randomsprites = ghay

royce 11-21-2001 01:05 PM

Quote:

Originally posted by Falcor
Randomsprites = ghay

Saga2001 11-21-2001 02:48 PM

True Dat!
 
Quote:

Originally posted by royce

T3CK 11-21-2001 11:46 PM

Um, if I were you, I'd change the (0,40) to (0,39) because no one wants to see thierself dead every .1 seconds.

T3CK 11-21-2001 11:48 PM

Oh, yes, and try putting that in a for loop to make it where when the player is in a certain area he will dance. just using a button isn't..natural. for(playerx<15;playery>10;playerx>10&&playery<5){ code here;}

Faheria_GP2 11-22-2001 01:03 AM

not a very bright one are you?

with random(0,40) the highest possible number is

39.99999999999999999999999999999999999999999999

which int() will cut off to 39, so technically, you would only see sprites 0-39.

royce 11-22-2001 01:08 AM

then you would be swimming too and that is the ****ed thing...

entravial 11-22-2001 03:34 AM

~AlphaFlame~

... set an array of the sprites you do want, then do a random for the arrayed sprite to show...

this.sprites={1,2,3,4,5,9,14,20};
this.show=int(random(0,arraylen(this.sprites)));
playersprite=this.sprites[this.show];

*passes out the dunce caps*

Falcor 11-22-2001 03:59 AM

even simpler
NPC Code:

this.sprites={1,2,3,4,5,9,14,20};
playersprite=this.sprites[intrandom(0,arraylen(this.sprites)+.4))];


*hands ~Alpha Flame~ a dunce team baseball cap.*

Falcor 11-22-2001 04:10 AM

AND even simpler yet
 
setani dance,;

(for the slow ones, that means make a gani and forget about the sprites, THEY ARE OBSOLETE)

TDO2000 11-22-2001 04:16 AM

Quote:

Originally posted by T3CK
Oh, yes, and try putting that in a for loop to make it where when the player is in a certain area he will dance. just using a button isn't..natural. for(playerx<15;playery>10;playerx>10&&playery<5){ code here;}
um... is it natural to dance if u walk over a special area? I do not have to dance if I walk over a dancefloor only if I want to... so it's more natural to dance if u press the a-key...


All times are GMT +2. The time now is 07:44 AM.

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