Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-15-2004, 04:41 PM
sparkers sparkers is offline
Yojumisto Online
sparkers's Avatar
Join Date: Jun 2004
Location: Why does anyone care about that?
Posts: 111
sparkers is on a distinguished road
Send a message via AIM to sparkers
NPC Code:

//#CLIENTSIDE


if (weaponfired) {
disabledefmovement
setani ocarina1,;
timeout=.05;
}

if (timeout) {disabledefmovement;
if (keydown(0)&&!keydown(5)) {setani ocarina-play1,;sleep .1;}
if (keydown(1)&&!keydown(5)) {setani ocarina-play2,;sleep .1;}
if (keydown(2)&&!keydown(5)) {setani ocarina-play3,;sleep .1;}
if (keydown(3)&&!keydown(5)) {setani ocarina-play4,;sleep .1;}
if (keydown(0)&&keydown(5)) {setani ocarina-play5,;sleep .1;}
if (keydown(1)&&keydown(5)) {setani ocarina-play6,;sleep .1;}
if (keydown(2)&&keydown(5)) {setani ocarina-play7,;sleep .1;}
if (keydown(3)&&keydown(5)) {setani ocarina-play8,;sleep .1;}

if (keydown(6)) {enabledefmovement;setani idle,;timeout=0}
if (!keydown(6)) {timeout=.05;}
}

Reply With Quote
  #2  
Old 08-15-2004, 06:25 PM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
It would totally help if you put a semicolon after disabledefmovement whenever you are using it. Beyond that, freezeplayer while it is playing the note is just fine.

Next, you need to work on your code structure. Do you notice that you are checking if S is down several times? Nest your flag checks, man, and use else when appropriate.

Finally, the board's code tags are pretty useless if you don't even style your code.

As a suggestion: why not use a while loop to ensure that a is held down instead of a timeout loop?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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