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 01-30-2004, 06:17 AM
Value Value is offline
Registered User
Join Date: Jan 2004
Posts: 8
Value is on a distinguished road
Question Help with actionprojectile

(BEFORE YOU READ - I searched the forums already and none explained how to make it work right or none had the problem ive been having) I need help with actionprojectile. I put it in the control-npc and it never works when the projectile hits a player or npc. I did it clientside too and put it in a system npc, but it NEVER works. Here is the part of my script (NOTE: The shoot and setshootparams work perfectly because I tested it with actionprojectile2 and it works)
NPC Code:

if (actionprojectile) {//THIS ONE DOESN'T WORK!
if (strequals(#p(2),altairarrowhit)){
this.ax = strtofloat(#p(0));
this.ay = strtofloat(#p(1));
for (this.p = 0;this.p < playerscount;this.p++) {
hitplayer this.p, 3, this.ax, this.ay;
}
}
}


NPC Code:

if (actionprojectile2) {//THIS ONE DOES! Just hits everyone in the level
if (strequals(#p(2),altairarrowhit)){
this.ax = strtofloat(#p(0));
this.ay = strtofloat(#p(1));
for (this.p = 0;this.p < playerscount;this.p++) {
hitplayer this.p, 3, this.ax, this.ay;
}
}
}



Help if you can.
~Value (Manager of Altair)

Edit: Loriel added [code]-tags.

Last edited by Loriel; 01-30-2004 at 02:36 PM..
Reply With Quote
  #2  
Old 01-30-2004, 07:10 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Re: Help with actionprojectile

NPC Code:

if (strequals(#p(2),altairarrowhit)){



should be

NPC Code:

if (strequals(#p(0),altairarrowhit)){



helps?

or you can just go

NPC Code:

if (actionprojectile) {
if (strequals(#p(0),altairarrowhit)) {
if (!nopkzone) {
hurt 1;
}
}
}



that'll do .5 damage. Hope it helps
Reply With Quote
  #3  
Old 01-30-2004, 06:02 PM
VeX_RaT_Boy VeX_RaT_Boy is offline
WannaBe Scripter
VeX_RaT_Boy's Avatar
Join Date: Aug 2002
Location: Norway
Posts: 960
VeX_RaT_Boy is on a distinguished road
Send a message via ICQ to VeX_RaT_Boy Send a message via AIM to VeX_RaT_Boy Send a message via Yahoo to VeX_RaT_Boy
Re: Re: Help with actionprojectile

Quote:
Originally posted by napo_p2p
Stuff..
Wrong.

He is doing it in the Control NPC, that then #p(0) is the landing x, and the #p(1) is the landing y.

You should have it in some kind of system weapon and in clientside...THEN it would be #p(0).
__________________
-Kjetil Valen
Reply With Quote
  #4  
Old 01-30-2004, 07:24 PM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Re: Re: Re: Help with actionprojectile

Quote:
Originally posted by VeX_RaT_Boy

Wrong.

He is doing it in the Control NPC, that then #p(0) is the landing x, and the #p(1) is the landing y.

You should have it in some kind of system weapon and in clientside...THEN it would be #p(0).
What do you mean "#p(0) is the landing x, and the #p(1) is the landing y."? Those params are set using the command setshootparams. They don't have a designated value to begin with unless you set them.
__________________
Reply With Quote
  #5  
Old 01-30-2004, 08:44 PM
Shifter Shifter is offline
GST
Join Date: Nov 2003
Posts: 11
Shifter is on a distinguished road
Re: Re: Re: Re: Help with actionprojectile

Quote:
Originally posted by ZeLpH_MyStiK

What do you mean "#p(0) is the landing x, and the #p(1) is the landing y."? Those params are set using the command setshootparams. They don't have a designated value to begin with unless you set them.
I generally don't use shoot, BUT here's how it should be setting:
#p(0) = x of projectile
#p(1) = y of projectile
#p(2) = first param of projectile
and so on and so fourth. It's like how if (pm) takes #p(1) as the first param (or rcchat, think it's PM) where it's not the first param as #p(0). Just trust us on this one m8 If it's online on a server let me know and I'll come check it out in about 2-3 hours when I get home and before I go to work tonight.
---Shifter
Reply With Quote
  #6  
Old 01-30-2004, 09:50 PM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Re: Re: Re: Re: Re: Help with actionprojectile

Quote:
Originally posted by Shifter

I generally don't use shoot, BUT here's how it should be setting:
#p(0) = x of projectile
#p(1) = y of projectile
#p(2) = first param of projectile
and so on and so fourth. It's like how if (pm) takes #p(1) as the first param (or rcchat, think it's PM) where it's not the first param as #p(0). Just trust us on this one m8 If it's online on a server let me know and I'll come check it out in about 2-3 hours when I get home and before I go to work tonight.
---Shifter
O, ya learn something new everyday I guess...=)
__________________
Reply With Quote
  #7  
Old 01-30-2004, 10:40 PM
Value Value is offline
Registered User
Join Date: Jan 2004
Posts: 8
Value is on a distinguished road
ALSO

The script I posted is clientside, not serverside. Serverside would of had the with (players[i]) stuff. Also, I already put //#CLIENTSIDE in the npc but I forgot to post it here. But it's pretty obvious it's not serverside.

BTW, my server is online and the name is Altair (not visible).

~Value (Manager of Altair)
Reply With Quote
  #8  
Old 01-31-2004, 02:41 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Hmmm I will make a little docu about custom hitpoint system and how to handle projectile impacts in a few hours, need it for Zone and Classic anyway so I can also post it here.

A quick note: on serverside you need to do 'hitobjects', the other commands (hitplayer etc.) don't work
Reply With Quote
  #9  
Old 02-02-2004, 03:31 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
There posted, in a new sticky thread
Reply With Quote
  #10  
Old 02-10-2004, 02:30 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 Stefan
There posted, in a new sticky thread
Here it is:
http://forums.graal2001.com/forums/s...threadid=50809
__________________
-KuJi
Reply With Quote
  #11  
Old 02-15-2004, 03:32 AM
Medabee5111 Medabee5111 is offline
Registered User
Join Date: Jan 2004
Posts: 71
Medabee5111 is on a distinguished road
Send a message via AIM to Medabee5111 Send a message via Yahoo to Medabee5111
i'm also having a action w/e problum, only mines diffrent, it works on players (havn't tried online but not gonna et a server anyways) but it's not working on NPCs, please help.

Code:

// NPC made by Medabee5111
if (created) {
toweapons Gun Test;
hide;
}
if (weaponfired) {
freezeplayer 0.2;
players[].sprite = 33;
if(playerdir==0){
setshootparams #w,500;
shoot playerx,playery-1.5,,3.14/2,,0,adv_snowball,;
}
if(playerdir==2){
setshootparams #w,500;
shoot playerx+0.01,playery,,3.14*3/2,,0,adv_snowball,;
}
if(playerdir==1){
setshootparams #w,500;
shoot playerx-0.1,playery-0.3,,3.14,,0,adv_snowball,;
}
if(playerdir==3){
setshootparams #w,500;
shoot playerx+0.1,playery-0.3,,0,,0,adv_snowball,;
}
}
if(actionprojectile){
if(strequals(#p(0),Gun Test)){
lay heart;
}
}

//i made it do lay heart; couse i knew that it would make somthing happen if action projectile worked on the NPC
__________________
Loud Speaker "Will the party or parties responsible for releasing all of the experimental loonybots PLEASE return them to their pens, they are shooting the employees, THANK you."

That is Masaki's Katana of Stupid Evil+26 (slay nub, pker) repell nub+100 repell pker+100 attack+20 wc+15 object has a story: Masaki's trusty weapon of choice, he wouldn't sell it, no matter the price.
Reply With Quote
  #12  
Old 02-15-2004, 03:34 AM
Riot Riot is offline
Delteria Management
Join Date: Nov 2003
Location: Seminole County, Florida
Posts: 280
Riot is on a distinguished road
[list=1][*]Use code tags[*]Read Stefans document, it has a lot shorter way of doing "shoot"[/list=1]
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:24 AM.


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