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
  #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 09:35 PM.


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