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 03-17-2002, 03:30 AM
la_builder la_builder is offline
Registered User
Join Date: Jan 2002
Location: Holland
Posts: 154
la_builder is on a distinguished road
is there something like.....

is there something like if (hitby(<weaponname>)){......}
and if there is could you tell me the command for it.
__________________
Dark Frontier
The enemy is surrounding us all,more evil than a human could ever imagine.

Dark Fontier Coming Soon
Reply With Quote
  #2  
Old 03-17-2002, 04:18 AM
mikepg mikepg is offline
Registered User
Join Date: Nov 2001
Location: VA, USA
Posts: 501
mikepg is on a distinguished road
Send a message via AIM to mikepg Send a message via Yahoo to mikepg
umm

not exactly the weapons...the only things you can determine is if:

1: The NPC was hit by a sword if (washit)
2: The NPC was hit by an explosion if (exploded) ( i think it's exploded)
3: The NPC was hit by an arrow if (wasshot)
4: The NPC was pelt by an object if (waspelt) ( there are also things like waspeltbybush and stuff )

But, I dont believe the NPC can check for the weapon's name, unless you put a param in your weapon and set a triggeraction aswell.
__________________
~War Lord Mpg2
Bravo Online's Asst. Staff Manager

"Sittin by the tree, sippin eggnog, waitin on christmas gifts"
Reply With Quote
  #3  
Old 03-17-2002, 04:21 AM
la_builder la_builder is offline
Registered User
Join Date: Jan 2002
Location: Holland
Posts: 154
la_builder is on a distinguished road
k thanks
__________________
Dark Frontier
The enemy is surrounding us all,more evil than a human could ever imagine.

Dark Fontier Coming Soon
Reply With Quote
  #4  
Old 03-17-2002, 07:58 PM
la_builder la_builder is offline
Registered User
Join Date: Jan 2002
Location: Holland
Posts: 154
la_builder is on a distinguished road
are you sure there isnt any other way caus the apple trees on 2k1 work diffirent bud i dunt know how
__________________
Dark Frontier
The enemy is surrounding us all,more evil than a human could ever imagine.

Dark Fontier Coming Soon
Reply With Quote
  #5  
Old 03-17-2002, 08:00 PM
AlexH AlexH is offline
Have A Drink On Me
AlexH's Avatar
Join Date: Jun 2001
Location: Somewhere In Time
Posts: 7,442
AlexH is on a distinguished road
Send a message via AIM to AlexH Send a message via MSN to AlexH
use triggeraction
Reply With Quote
  #6  
Old 03-17-2002, 08:01 PM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
Quote:
Originally posted by la_builder
are you sure there isnt any other way caus the apple trees on 2k1 work diffirent bud i dunt know how
Um, the apple trees use triggeractions.. when you use the water can on the tree it sends a trigger action to the tree. If you mean when you hit the tree to get apples.. um well that's just (washit) I think
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
  #7  
Old 03-17-2002, 08:09 PM
la_builder la_builder is offline
Registered User
Join Date: Jan 2002
Location: Holland
Posts: 154
la_builder is on a distinguished road
mm..

can someone tell me something about triggeraction
__________________
Dark Frontier
The enemy is surrounding us all,more evil than a human could ever imagine.

Dark Fontier Coming Soon
Reply With Quote
  #8  
Old 03-17-2002, 11:20 PM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
well, the syntax is:
triggeraction x,y,actionname,param(s);


using this will call actionname on the player/npc on that x and y

example:

NPC Code:

if (playerchats&&strequals(#c,trigger)) {
triggeraction x,y,triggerme,#a;
}

if (actiontriggerme) {
say2 I was triggered by #p(0);
}



this is just a way to use triggeraction in one npc but, you could take the if (action....) part and put it in a seperate npc, and just change the x and y varibles in the first npc

__________________
[signature]insert here[/signature]
Reply With Quote
  #9  
Old 03-17-2002, 11:32 PM
la_builder la_builder is offline
Registered User
Join Date: Jan 2002
Location: Holland
Posts: 154
la_builder is on a distinguished road
so in action name i would fill in the weapon name or somethin'
__________________
Dark Frontier
The enemy is surrounding us all,more evil than a human could ever imagine.

Dark Fontier Coming Soon
Reply With Quote
  #10  
Old 03-17-2002, 11:46 PM
mikepg mikepg is offline
Registered User
Join Date: Nov 2001
Location: VA, USA
Posts: 501
mikepg is on a distinguished road
Send a message via AIM to mikepg Send a message via Yahoo to mikepg
well

Triggeraction works just like a built in call flag (like if (playerenters)), except, it's only called when it is activated by an NPC. The only way to activate it is for an NPC to use triggeraction other'sx,other'sy,<actionhere>,#g;

supposing the NPC you want triggered is on other'sx,other'sy, it would call <actionhere>, and send the message that #p(0)=#g (or your guild name, let's say it's happy clan, the point for the NPC is 33,33 and the action is called "dostart")

you'd write in the Weapon NPC
NPC Code:

if (weaponfired) {
triggeraction 33.25,33.25,dostart,#g;
}



in the other NPC

NPC Code:

if (actiondostart) {
message I have been triggered by a member of #p(0);
}



The reason the triggering point is 33.25,33.25, Is because the action MUST be triggered on a visible spot on the NPC (part of the image that is NOT transparent)

For more info on triggeraction, I suggest you open up newfeatures2001.txt that is in your graal folder, and search "triggeraction"
__________________
~War Lord Mpg2
Bravo Online's Asst. Staff Manager

"Sittin by the tree, sippin eggnog, waitin on christmas gifts"
Reply With Quote
  #11  
Old 03-18-2002, 12:33 AM
la_builder la_builder is offline
Registered User
Join Date: Jan 2002
Location: Holland
Posts: 154
la_builder is on a distinguished road
Thumbs up

thanks that helped i understand now thanks everybody.
__________________
Dark Frontier
The enemy is surrounding us all,more evil than a human could ever imagine.

Dark Fontier Coming Soon

Last edited by la_builder; 03-18-2002 at 02:43 AM..
Reply With Quote
  #12  
Old 03-18-2002, 03:35 AM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
__________________
[signature]insert here[/signature]
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:34 AM.


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