Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-16-2010, 10:03 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
[Broken(?)] shootarrow/nuke/ect

i was making a weapon script with shootarrow() today, and i noticed that, it wont shoot correctly, it doesnt follow the player.
however, this seems to work on UN, i dont know why, but i guess it's because it got gs1 enabled still(?) .

either stefan fixes this, we better come up with a workaround for all types of shoot*()..
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #2  
Old 02-16-2010, 10:06 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
HTML Code:
Shootarrow(dir);
Just shoots an arrow in the direction...

You're probably thinking of a custom projectile using the command shoot().
__________________
Reply With Quote
  #3  
Old 02-16-2010, 11:45 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
Quote:
Originally Posted by xAndrewx View Post
HTML Code:
Shootarrow(dir);
Just shoots an arrow in the direction...
that's what im trying to do. i update the weapon, i shoot using onWeaponFired(), it shoots at the player's x/y, but if i move, it doesnt follow the player.
Quote:
Originally Posted by xAndrewx View Post
You're probably thinking of a custom projectile using the command shoot().
no im not.

(i'm not an idiot or a newby scripter.)
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #4  
Old 02-16-2010, 11:49 PM
Immolate Immolate is offline
Indigo
Join Date: Dec 2009
Posts: 322
Immolate is on a distinguished road
Quote:
Originally Posted by Deas_Voice View Post
that's what im trying to do. i update the weapon, i shoot using onWeaponFired(), it shoots at the player's x/y, but if i move, it doesnt follow the player.
So, for example, you shoot an arrow at point A(30, 30) and then move to, say, point B(20, 20) the arrow still shoots from point A?
Reply With Quote
  #5  
Old 02-16-2010, 11:52 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
Quote:
Originally Posted by Immolate View Post
So, for example, you shoot an arrow at point A(30, 30) and then move to, say, point B(20, 20) the arrow still shoots from point A?
yes, until you update the weapon, then it's shooting from point B, but if u move again, it will remain at point B.
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #6  
Old 02-16-2010, 11:52 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Not sure what you mean by "following the player".
Reply With Quote
  #7  
Old 02-16-2010, 11:55 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
From what I remember, the old shootX()'s work off the NPC's x/y instead of the player's.

Something like:

this.x = player.x;
this.y = player.y;
shootarrow(player.dir);

might work. However, I'm pretty sure you don't need to take precautions like this(as WNPC's should by, default, be positioned at the player's x/y). Default bows are actually scripted and simply use shootarrow(player.dir).
Reply With Quote
  #8  
Old 02-16-2010, 11:56 PM
Immolate Immolate is offline
Indigo
Join Date: Dec 2009
Posts: 322
Immolate is on a distinguished road
Quote:
Originally Posted by Deas_Voice View Post
yes, until you update the weapon, then it's shooting from point B, but if u move again, it will remain at point B.
Works perfectly fine for me on Testbed?
Reply With Quote
  #9  
Old 02-16-2010, 11:57 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
Quote:
Originally Posted by DustyPorViva View Post
From what I remember, the old shootX()'s work off the NPC's x/y instead of the player's.

Something like:

this.x = player.x;
this.y = player.y;
shootarrow(player.dir);

might work. However, I'm pretty sure you don't need to take precautions like this(as WNPC's should by, default, be positioned at the player's x/y). Default bows are actually scripted and simply use shootarrow(player.dir).
yes, i know about the bow, but i need shootnuke, shootfireball, ect too.
i don't see how setting this.x/y to player's x/y is going to change the shootarrow, but i'll try that tomorrow anyway.
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #10  
Old 02-16-2010, 11:57 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
HTML Code:
//#CLIENTSIDE
function onWeaponFired() {
  shootarrow(player.dir);
}
This works fine... what's your script?
__________________
Reply With Quote
  #11  
Old 02-16-2010, 11:59 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
Quote:
Originally Posted by xAndrewx View Post
HTML Code:
//#CLIENTSIDE
function onWeaponFired() {
  shootarrow(player.dir);
}
This works fine... what's your script?
PHP Code:
//#CLIENTSIDE
public function apply(itemid) {
  
shootarrow(player.dir);

apply is the same as onWeaponFired() but, on Aeon.
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #12  
Old 02-17-2010, 12:01 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by Deas_Voice View Post
yes, i know about the bow, but i need shootnuke, shootfireball, ect too.
i don't see how setting this.x/y to player's x/y is going to change the shootarrow, but i'll try that tomorrow anyway.
Well back in the day, bows like the super bow(which fire 4 arrows of all types in a row) would change the position of the weapon NPC in relation to the player, to change the placement of the arrow. So doing something like:

PHP Code:
if (weaponfired) {
  
shootarrow playerdir;
  
playery 1;
  
shootnuke playerdir;
  
playery 1;
  
shootfireball playerdir;

Would make the arrow shoot normally, with a fireball above it and a nuke below it.

However, I'm not even sure that will work anymore as I'm pretty sure Stefan make this.x/y not accessible via script in WNPCs since a lot of old weapon scripts used those without intending to alter the position of the weapon's x/y.
Reply With Quote
  #13  
Old 02-17-2010, 12:02 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by Deas_Voice View Post
PHP Code:
//#CLIENTSIDE
public function apply(itemid) {
  
shootarrow(player.dir);

apply is the same as onWeaponFired() but, on Aeon.
Try changing that to just onWeaponFired() and seeing if it fixes it. May just be a problem with the two NPC's(the one calling the function and the one with the public function) having different positions.
Reply With Quote
  #14  
Old 02-17-2010, 12:02 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Are you using a custom movement that doesn't involve player.x and player.y? [Don't know why- but that's all I can think of]
__________________
Reply With Quote
  #15  
Old 02-17-2010, 12:05 AM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
Quote:
Originally Posted by DustyPorViva View Post
Try changing that to just onWeaponFired() and seeing if it fixes it. May just be a problem with the two NPC's(the one calling the function and the one with the public function) having different positions.
well, i can't do onWeaponFired(), unless i make a trigger for it, or remove all the systemscripts from my attributes (witch i dont have time for right now).
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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:59 PM.


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