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-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
  #16  
Old 02-17-2010, 12:07 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
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).
Well you'll need to show all scripts involved in firing this weapon, and their type(WNPC/class) for anyone to really know what's going on.
Reply With Quote
  #17  
Old 02-17-2010, 12:13 AM
Immolate Immolate is offline
Indigo
Join Date: Dec 2009
Posts: 322
Immolate is on a distinguished road
What ever I do, I can't seem to recreate your problem. This is weird.
Reply With Quote
  #18  
Old 02-17-2010, 12:16 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 Immolate View Post
What ever I do, I can't seem to recreate your problem. This is weird.
I think it has a lot to do with whatever set-up he is using with the public functions and such.
Reply With Quote
  #19  
Old 02-17-2010, 12:28 AM
Immolate Immolate is offline
Indigo
Join Date: Dec 2009
Posts: 322
Immolate is on a distinguished road
Quote:
Originally Posted by DustyPorViva View Post
I think it has a lot to do with whatever set-up he is using with the public functions and such.
I think so too. It just confuses me how they've managed to set up systems which would allow that to happen. Chances are that another weapon is calling that public function, so the x/y should always be the same (player.x/y) no matter what. It's also strange how it's only updating when the weapon containing the public function is updated, so it doesn't SEEM to be originating from the calling script.
Reply With Quote
  #20  
Old 02-17-2010, 01:48 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Did you use it on a GMAP? 'Cause they don't work on GMAP's.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #21  
Old 02-17-2010, 01:50 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 xXziroXx View Post
Did you use it on a GMAP? 'Cause they don't work on GMAP's.
The only bug with projectiles on gmaps are that they loop around the level. They still shoot correctly from the player.
Reply With Quote
  #22  
Old 02-17-2010, 02:01 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by DustyPorViva View Post
The only bug with projectiles on gmaps are that they loop around the level. They still shoot correctly from the player.
Which is fixed in v6 :3
__________________
Quote:
Reply With Quote
  #23  
Old 02-17-2010, 05:16 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
i am using this on gmap and a singel level, V6 does not fix this, i haven't tested the windows version, so i only got the unupdated linux version.
yes, anoter weapon is caling the public function, but i dont see how that should be a problem, i mean, if i was to make a weapon that triggerd another weapon, would it break then?
__________________
.
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
  #24  
Old 02-17-2010, 05:18 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
i am using this on gmap and a singel level, V6 does not fix this, i haven't tested the windows version, so i only got the unupdated linux version.
yes, anoter weapon is caling the public function, but i dont see how that should be a problem, i mean, if i was to make a weapon that triggerd another weapon, would it break then?
That's not what I was getting at, to be honest. Try it on Windows anyway and feedback.
Reply With Quote
  #25  
Old 02-17-2010, 05:19 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
That's not what I was getting at, to be honest. Try it on Windows anyway and feedback.
FYI, it's broken in v5, no matter what OS you got.
__________________
.
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
  #26  
Old 02-17-2010, 06:35 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
FYI, it's broken in v5, no matter what OS you got.
Are you 100% sure? As in, tested it on Windows as I said?
Reply With Quote
  #27  
Old 02-17-2010, 07:20 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
Are you 100% sure? As in, tested it on Windows as I said?
i don't see how this would be linux's fault, because it's not.
(currently booted in windows, tried in v5 and v6, both broken.)
__________________
.
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
  #28  
Old 02-17-2010, 07:36 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
i don't see how this would be linux's fault, because it's not.
(currently booted in windows, tried in v5 and v6, both broken.)
I was covering all bases. I wasn't saying it was a fault with Linux, just asking you to check if it was a problem with the Linux graal client.
Reply With Quote
  #29  
Old 02-17-2010, 08:52 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
Quote:
Originally Posted by xAndrewx View Post
HTML Code:
//#CLIENTSIDE
function onWeaponFired() {
  shootarrow(player.dir);
}
This works fine... what's your script?
Can you do this again but remove all the Aeon stuff so that you're using default Graal systems. If there is an error it's your playerworld / client, if not it's Aeon.
__________________
Reply With Quote
  #30  
Old 02-17-2010, 08:54 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
You still haven't shown us the scripts doing this. I mean if you don't want to, fine, but it just makes it nearly impossible for anyone to see what's going on.
Reply With Quote
  #31  
Old 02-18-2010, 09:16 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
You still haven't shown us the scripts doing this. I mean if you don't want to, fine, but it just makes it nearly impossible for anyone to see what's going on.
that's because i can't show the script that triggers the public function; it's in another weapon, and i dont have access to it.

sorry.
i'll try to replicate it on testbed.

**EDIT**
it was quite easy to replicate, i only had to try once.

Public/Deas_Voice/Weapon:
(When you update this script, it goes to player's x/y, but if u move, it stays at that x/y)
PHP Code:
//#CLIENTSIDE
public function use() {
  
shootarrow(player.dir);

Public/Deas_Voice/WeaponTrigger:
(this is the wnpc you use to trigger the Weapon)
PHP Code:
//#CLIENTSIDE
function onWeaponFired(){
  (
"Public/Deas_Voice/Weapon").use();

PS. these two exists on Testbed.

*Edit2: I've added "shootfireball(player.dir);" to the WeaponTrigger (on Testbed) because i want to show how it should look like.
__________________
.
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

Last edited by Deas_Voice; 02-18-2010 at 09:33 AM.. Reason: Zzz, replicated in one try.
Reply With Quote
  #32  
Old 02-18-2010, 11:26 AM
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 because i can't show the script that triggers the public function; it's in another weapon, and i dont have access to it.

sorry.
i'll try to replicate it on testbed.

**EDIT**
it was quite easy to replicate, i only had to try once.

Public/Deas_Voice/Weapon:
(When you update this script, it goes to player's x/y, but if u move, it stays at that x/y)
PHP Code:
//#CLIENTSIDE
public function use() {
  
shootarrow(player.dir);

Public/Deas_Voice/WeaponTrigger:
(this is the wnpc you use to trigger the Weapon)
PHP Code:
//#CLIENTSIDE
function onWeaponFired(){
  (
"Public/Deas_Voice/Weapon").use();

PS. these two exists on Testbed.

*Edit2: I've added "shootfireball(player.dir);" to the WeaponTrigger (on Testbed) because i want to show how it should look like.
The problem is fixed if you some how get the code you can't access changed to use triggers instead of calling a public function.
Reply With Quote
  #33  
Old 02-18-2010, 04:32 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
The problem is fixed if you some how get the code you can't access changed to use triggers instead of calling a public function.
but that will change the function to "onApply()" which is madness to do now, because you have to change all other scripts to that, just for the shootarrow/nuke/ect to work..
__________________
.
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
  #34  
Old 02-18-2010, 04:33 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
but that will change the function to "onApply()" which is madness to do now, because you have to change all other scripts to that, just for the shootarrow/nuke/ect to work..
Not hard to do by script.
Reply With Quote
  #35  
Old 02-19-2010, 02:51 AM
DrakilorP2P DrakilorP2P is offline
Registered User
DrakilorP2P's Avatar
Join Date: Apr 2006
Posts: 755
DrakilorP2P is just really niceDrakilorP2P is just really nice
Quote:
Originally Posted by Deas_Voice View Post
but that will change the function to "onApply()" which is madness to do now, because you have to change all other scripts to that, just for the shootarrow/nuke/ect to work..
If it means less changes, try triggering something like onWakeUp.
Reply With Quote
  #36  
Old 02-19-2010, 10:38 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 DrakilorP2P View Post
If it means less changes, try triggering something like onWakeUp.
how do you mean?
where do you want to to make a trigger?
__________________
.
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
  #37  
Old 02-19-2010, 11:29 AM
DrakilorP2P DrakilorP2P is offline
Registered User
DrakilorP2P's Avatar
Join Date: Apr 2006
Posts: 755
DrakilorP2P is just really niceDrakilorP2P is just really nice
Quote:
Originally Posted by Deas_Voice View Post
how do you mean?
where do you want to to make a trigger?
Same place that calls apply().
Reply With Quote
  #38  
Old 02-19-2010, 12:54 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
shootarrow() takes the position of the npc/weapon that shoots the arrow. Weapons are automatically moved to the player position. You cannot change the weapon position if you are on a gmap.
About triggering another weapon: If you call the function of the other weapon directly it is not syncing the position, only if the weapon receives an event (onWeaponFired, trigger etc.). I suggest using a simple approach and calling shootarrow in the original weapon script (or pass the weapon object to the other function and then call callerweapon.shootarrow()).
Reply With Quote
  #39  
Old 02-19-2010, 03: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
uhh, okey.

well it got solved by doing trigger in the public function, then do shootarrow() in that function.
thanks maui.
~and the rest of you.
__________________
.
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


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 12:00 AM.


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