Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   is there something like..... (https://forums.graalonline.com/forums/showthread.php?t=25771)

la_builder 03-17-2002 03:30 AM

is there something like.....
 
is there something like if (hitby(<weaponname>)){......}
and if there is could you tell me the command for it.

mikepg 03-17-2002 04:18 AM

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.

la_builder 03-17-2002 04:21 AM

k thanks

la_builder 03-17-2002 07:58 PM

are you sure there isnt any other way caus the apple trees on 2k1 work diffirent bud i dunt know how

AlexH 03-17-2002 08:00 PM

use triggeraction

konidias 03-17-2002 08:01 PM

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

la_builder 03-17-2002 08:09 PM

mm..
 
can someone tell me something about triggeraction

screen_name 03-17-2002 11:20 PM

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

:D

la_builder 03-17-2002 11:32 PM

so in action name i would fill in the weapon name or somethin'

mikepg 03-17-2002 11:46 PM

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"

la_builder 03-18-2002 12:33 AM

thanks that helped i understand now thanks everybody.

screen_name 03-18-2002 03:35 AM

:D


All times are GMT +2. The time now is 09:28 PM.

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