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 12-06-2001, 08:11 AM
Poogle Poogle is offline
Registered User
Poogle's Avatar
Join Date: Jun 2001
Posts: 2,471
Poogle is on a distinguished road
Whats wrong with this

Whats wrong with this script?
if (playerenters) {
toweapons *SpaceWars;
}
if (isweapon) {
disabledefmovement;
disableweapons;
disableselectweapons;
timeout = 0.1;
}
if (timeout) {
if (keydown(1)&&onwall(playerx-0.5,playery)) {
playerx = playerx-0.5;
playerdir = 0;
}
if (keydown(3)&&onwall(playerx+0.5,playery)) {
playerx = playerx+0.5;
playerdir = 0;
}
if (keydown(4)) {
putexplosion 1,playerx,56;
sleep 0.1;
putexplosion 1,playerx,54;
sleep 0.1;
putexplosion 1,playerx,52;
sleep 0.1;
putexplosion 1,playerx,50;
sleep 0.1;
putexplosion 1,playerx,48;
sleep 0.1;
putexplosion 1,playerx,46;
sleep 0.1;
putexplosion 1,playerx,44;
sleep 0.1;
putexplosion 1,playerx,42;
sleep 0.1;
putexplosion 1,playerx,40;
sleep 0.1;
putexplosion 1,playerx,38;
timeout = 0.1;
}

}
Reply With Quote
  #2  
Old 12-06-2001, 08:18 AM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
What is the problem with it?
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
Reply With Quote
  #3  
Old 12-06-2001, 08:21 AM
T-Squad T-Squad is offline
Banned
T-Squad's Avatar
Join Date: Mar 2001
Location: United States of America
Posts: 1,733
T-Squad is on a distinguished road
AHAHAHAHAAHA

Thats how I used to script when I first started...yes, yes, it is a scary sight to see.
Reply With Quote
  #4  
Old 12-06-2001, 08:22 AM
Poogle Poogle is offline
Registered User
Poogle's Avatar
Join Date: Jun 2001
Posts: 2,471
Poogle is on a distinguished road
Quote:
Originally posted by BocoC
What is the problem with it?
the onwall doesnt work if goes over the tiles that block
Reply With Quote
  #5  
Old 12-06-2001, 10:51 AM
Faheria_GP2 Faheria_GP2 is offline
Banned
Faheria_GP2's Avatar
Join Date: Oct 2001
Posts: 1,177
Faheria_GP2 is on a distinguished road
Re: Whats wrong with this

Quote:
Originally posted by Poogle
Whats wrong with this script?
if (playerenters) {
toweapons *SpaceWars;
}
if (isweapon) {
disabledefmovement;
disableweapons;
disableselectweapons;
timeout = 0.1;
}
if (timeout) {
if (keydown(1)&&onwall(playerx-0.5,playery)) {
playerx = playerx-0.5;
playerdir = 0;
}
if (keydown(3)&&onwall(playerx+0.5,playery)) {
playerx = playerx+0.5;
playerdir = 0;
}
if (keydown(4)) {
putexplosion 1,playerx,56;
sleep 0.1;
putexplosion 1,playerx,54;
sleep 0.1;
putexplosion 1,playerx,52;
sleep 0.1;
putexplosion 1,playerx,50;
sleep 0.1;
putexplosion 1,playerx,48;
sleep 0.1;
putexplosion 1,playerx,46;
sleep 0.1;
putexplosion 1,playerx,44;
sleep 0.1;
putexplosion 1,playerx,42;
sleep 0.1;
putexplosion 1,playerx,40;
sleep 0.1;
putexplosion 1,playerx,38;
timeout = 0.1;
}

}
you've never heard of a for-loop in your life
Reply With Quote
  #6  
Old 12-06-2001, 11:59 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Re: Whats wrong with this

NPC Code:

if (playerenters) {
toweapons *SpaceWars;
timeout=.05;
}
while (timeout) {
disabledefmovement;
disableweapons;
disableselectweapons;
if (keydown(1)&&!onwall(playerx-0.5,playery)) {
playerx-=0.5;
playerdir=0;
}
if (keydown(3)&&!onwall(playerx+0.5,playery)) {
playerx+=0.5;
playerdir=0;
}
if (keydown(4)) {
this.mult=0;
}
if (this.mult<18) {
putexplosion 1,playerx,56-this.mult;
this.mult+=2;
}
sleep .05;
}



there ye go.
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it

Last edited by Saga2001; 12-06-2001 at 12:08 PM..
Reply With Quote
  #7  
Old 12-07-2001, 08:20 AM
aesquivel aesquivel is offline
Registered User
Join Date: Sep 2001
Location: Whitewright
Posts: 346
aesquivel is on a distinguished road
Send a message via AIM to aesquivel
Re: Re: Whats wrong with this

Quote:
Originally posted by Saga2001
NPC Code:

if (playerenters) {
toweapons *SpaceWars;
timeout=.05;
}
while (timeout) {
disabledefmovement;
disableweapons;
disableselectweapons;
if (keydown(1)&&!onwall(playerx-0.5,playery)) {
playerx-=0.5;
playerdir=0;
}
if (keydown(3)&&!onwall(playerx+0.5,playery)) {
playerx+=0.5;
playerdir=0;
}
if (keydown(4)) {
this.mult=0;
}
if (this.mult<18) {
putexplosion 1,playerx,56-this.mult;
this.mult+=2;
}
sleep .05;
}



there ye go.

lolz nice script
__________________
Reply With Quote
  #8  
Old 12-07-2001, 12:36 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Post :-D

thanks you are ownage
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #9  
Old 12-08-2001, 04:04 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
~AlphaFlame~

Hey hey, Poogle... you know, they have this really really l33t thing called "commands.rtf", right? And, like, it has really cool commands that can shorten your scripts! I mean, it's so amazing... I think you should read it a few million times.
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #10  
Old 12-08-2001, 05:49 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Quote:
Originally posted by entravial
~AlphaFlame~

Hey hey, Poogle... you know, they have this really really l33t thing called "commands.rtf", right? And, like, it has really cool commands that can shorten your scripts! I mean, it's so amazing... I think you should read it a few million times.
lol he should indeed, bah, i fixed his script and not even a thank you... :-/
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #11  
Old 12-08-2001, 05:57 AM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
timeout needs to be in the main loop
Reply With Quote
  #12  
Old 12-08-2001, 06:50 AM
kyle0654 kyle0654 is offline
-. .`
kyle0654's Avatar
Join Date: Mar 2001
Posts: 1,000
kyle0654 will become famous soon enough
Re: Re: Whats wrong with this

NPC Code:

if (playerenters) {
toweapons *SpaceWars;
}

if (created&&isweapon) {
disabledefmovement;
disableweapons;
disableselectweapons;
timeout=.05;
}

/* moved everything to the block above
this text, since it would just timeout on
the in-level script and not the weapon
script. */

if (timeout) {
if (keydown(1)&&!onwall(playerx-0.5,playery)) {
playerx-=0.5;
playerdir = 0;
}
if (keydown(3)&&!onwall(playerx+0.5,playery)) {
playerx+=0.5;
playerdir = 0;
}
if (keydown(4)) {
this.mult=0;
}
while (this.mult<18) {
putexplosion 1,playerx,56-this.mult;
this.mult+=2;
sleep .1;
}
timeout = .05;
}


Still kinda ugly, but easy to read. I still think you should have figured that out yourself by troubleshooting...the original problem was just a missing ! in front of the onwall() functions.
Reply With Quote
  #13  
Old 12-08-2001, 07:03 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
and uhm... when you get an npc weapon, the playerenters and create flags are sent to it so you could just do in the created area, the timeout loop =\
__________________

subliminal message: 1+1=3
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 02:00 PM.


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