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 02-06-2004, 01:56 AM
Gman4pwnu Gman4pwnu is offline
Banned
Join Date: Jan 2004
Posts: 434
Gman4pwnu is on a distinguished road
Send a message via AIM to Gman4pwnu
I made these staff blocks(They wont delete!)

I cant get rid of them, i used putnpc2, what is the serverside destroy command?

Last edited by Gman4pwnu; 02-06-2004 at 02:20 AM..
Reply With Quote
  #2  
Old 02-06-2004, 02:08 AM
Duwul Duwul is offline
Registered User
Join Date: Nov 2003
Posts: 105
Duwul is on a distinguished road
Re: I made these staff blocks

Quote:
Originally posted by Gman4pwnu
I cant get rid of them, i used putnpc2, what is the serverside destroy command?
You said it yourself..."destroy;"
__________________
-Ajira
Liek, omigosh.
<3 DoomsDay.
Reply With Quote
  #3  
Old 02-06-2004, 02:12 AM
Gman4pwnu Gman4pwnu is offline
Banned
Join Date: Jan 2004
Posts: 434
Gman4pwnu is on a distinguished road
Send a message via AIM to Gman4pwnu
Doesn't work, scripts:
(Just borrowing the era stuff temporarily, not to mention some era staff work on our server)
Staff Stick:
NPC Code:

//#CLIENTSIDE
if (weaponfired){
setani era_gani-superstick2,;
triggeraction playerx+1.5+vecx(playerdir)*2,playery+2+vecy(playe rdir)*2,stafftest,;
}


Staff Block Placer:
NPC Code:

if (actionserverside) {
putnpc2 playerx+.5,playery+.5,{join staffblock};
}
//#CLIENTSIDE

if (weaponfired){
triggeraction playerx+.5,playery+.5,serverside,Staff Blocks;
}




Staff Block Class:
NPC Code:

// NPC made by Josey Hunt
if (actionstafftest){
destroy;
}

//#CLIENTSIDE

if (playerenters) {
setimg era_staffblock.png;
block;
drawunderplayer;
}

if (created) {
setimg era_staffblock.png;
block;
drawunderplayer;
}

Reply With Quote
  #4  
Old 02-06-2004, 02:50 AM
Termina_Owner Termina_Owner is offline
Registered User
Join Date: Oct 2003
Posts: 175
Termina_Owner is on a distinguished road
Use RC and say:
/clearnpcs LEVEL


edit: staffblock NPC
NPC Code:

if (playerchats&&strequals(#a,Gman)){
if (strequals(#c,destroy)) destroy;
}



Like that, you won't need to "clearnpcs", but simply say "destroy" on player.

EDIT 2: I should read your question.

NPC Code:

if (created){
setshape 1,32,32;
}


^ That should be placed serverside. The triggeraction doesn't detect the trigger because the shape doesn't have a width/length. To fix that, you must put it. Common error.
__________________
- Rance Vicious
Reply With Quote
  #5  
Old 02-06-2004, 03:00 AM
Gman4pwnu Gman4pwnu is offline
Banned
Join Date: Jan 2004
Posts: 434
Gman4pwnu is on a distinguished road
Send a message via AIM to Gman4pwnu
That works, but how come it doesn't work when a trigger action is sent from the staff stick, i would really like to be able to remove only the ones i hit.
Reply With Quote
  #6  
Old 02-06-2004, 03:18 AM
Termina_Owner Termina_Owner is offline
Registered User
Join Date: Oct 2003
Posts: 175
Termina_Owner is on a distinguished road
Quote:
Originally posted by Termina_Owner

NPC Code:

if (created){
setshape 1,32,32;
}


^ That should be placed serverside. The triggeraction doesn't detect the trigger because the shape doesn't have a width/length. To fix that, you must put it. Common error.

Place that on the serverside of the class...
__________________
- Rance Vicious
Reply With Quote
  #7  
Old 02-06-2004, 03:26 AM
Duwul Duwul is offline
Registered User
Join Date: Nov 2003
Posts: 105
Duwul is on a distinguished road
You should combine it all into one npc..=/
Just make it so like pressing a different key sets the gani and also triggers the action. Better than having 2 different weapons.

You can also use

NPC Code:

with (npcs[testnpc(playerx+1.5+vecx(playerdir)*2,playery+2+ve cy(playerdir)*2)]){
destroy;
}

__________________
-Ajira
Liek, omigosh.
<3 DoomsDay.
Reply With Quote
  #8  
Old 02-06-2004, 03:46 AM
Riot Riot is offline
Delteria Management
Join Date: Nov 2003
Location: Seminole County, Florida
Posts: 280
Riot is on a distinguished road
Quote:
Originally posted by Duwul
You should combine it all into one npc..=/
Just make it so like pressing a different key sets the gani and also triggers the action. Better than having 2 different weapons.

You can also use

NPC Code:

with (npcs[testnpc(playerx+1.5+vecx(playerdir)*2,playery+2+ve cy(playerdir)*2)]){
destroy;
}

I'd prefer if you set a flag in the npc such as "this.isblock" then check for it so you don't remove NPCs that arent ment to be removed.
Reply With Quote
  #9  
Old 02-06-2004, 03:51 AM
Duwul Duwul is offline
Registered User
Join Date: Nov 2003
Posts: 105
Duwul is on a distinguished road
Quote:
Originally posted by Riot

I'd prefer if you set a flag in the npc such as "this.isblock" then check for it so you don't remove NPCs that arent ment to be removed.
Yes, that would be helpful. =P
I wasn't really thinking when I posted it, just a general idea of how to destroy it.
__________________
-Ajira
Liek, omigosh.
<3 DoomsDay.
Reply With Quote
  #10  
Old 02-06-2004, 04:52 AM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally posted by Gman4pwnu
That works, but how come it doesn't work when a trigger action is sent from the staff stick, i would really like to be able to remove only the ones i hit.
NPC Code:

if(was hit && strequals(#a,account)){
destroy;
}





Note: I write was hit with spaces because if you write it together it will turn into "shi.t" and change the word by *'s.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #11  
Old 02-06-2004, 05:38 AM
Gman4pwnu Gman4pwnu is offline
Banned
Join Date: Jan 2004
Posts: 434
Gman4pwnu is on a distinguished road
Send a message via AIM to Gman4pwnu
Thats all cleared up, thanks again!
Reply With Quote
  #12  
Old 02-13-2004, 01:14 PM
KuJiGX KuJiGX is offline
Registered User
Join Date: Dec 2003
Location: New York
Posts: 52
KuJiGX is on a distinguished road
Send a message via AIM to KuJiGX
Quote:
Originally posted by Gman4pwnu
Thats all cleared up, thanks again!
Im gonna count all your "HELP ME" threads on scripting
brb
__________________
-KuJi
Reply With Quote
  #13  
Old 02-13-2004, 01:35 PM
KuJiGX KuJiGX is offline
Registered User
Join Date: Dec 2003
Location: New York
Posts: 52
KuJiGX is on a distinguished road
Send a message via AIM to KuJiGX
Im back (Sorry for double posting)

http://forums.graal2001.com/forums/s...threadid=50886
http://forums.graal2001.com/forums/s...threadid=50920
http://forums.graal2001.com/forums/s...threadid=50949
http://forums.graal2001.com/forums/s...threadid=50930
http://forums.graal2001.com/forums/s...threadid=50892
http://forums.graal2001.com/forums/s...threadid=50856

All the links to his thread he made in about 1 week.
The last one contains about 20 threads tho
__________________
-KuJi
Reply With Quote
  #14  
Old 02-13-2004, 02:47 PM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
You didn't make it if it says
//NPC made by Josey Hunt
LOL
__________________
V$:CONFL16T
Reply With Quote
  #15  
Old 02-13-2004, 03:14 PM
Termina_Owner Termina_Owner is offline
Registered User
Join Date: Oct 2003
Posts: 175
Termina_Owner is on a distinguished road
*Waves hand in air* SPLENDID!
__________________
- Rance Vicious
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 05:39 PM.


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