Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Triggeraction Guide (https://forums.graalonline.com/forums/showthread.php?t=23097)

royce 02-05-2002 10:29 AM

Triggeraction Guide
 
Could someone be kind enough to explain Triggeraction for non-p2p stuff in its fullest content?

Faheria_GP2 02-05-2002 10:44 AM

triggeraction x,y,name,param;

triggers action "name" at x,y

in the npc at x,y (if any)

if (actionNAME) {
dostuff;
}

Saga2001 02-05-2002 01:22 PM

triggeraction x,y,action,params,.....;

as said b4 it triggers action "action" at x y. however they failed to mention that you can add params, mostly for p2p stuff..but awww heck...
watch:
NPC Code:

if (playertouchsme) toweapons weapon;
if (playerchats) triggeraction playerx+1.5,playery+2,weapon,name,#c,#a;
if (actionname) setplayerprop #c,#p(1): #p(0);


talk about a loop...

TDK_RC6 02-05-2002 08:12 PM

both failed to mention that if a player is on the x&y cordinate that you trigger, then they must have the weapon that triggered it (ie. you have a net and you try to catch someone, then they must also have the net)



PS i know this can be worked around, so please dont

Saga2001 02-06-2002 12:08 AM

srry ur right i should have mentioned that. thanks ;)

royce 02-06-2002 04:07 AM

give me an example plz. ;)

TDK_RC6 02-06-2002 04:17 AM

Quote:

Originally posted by royce
give me an example plz. ;)
of what, the way to work around it??

royce 02-06-2002 04:52 AM

Quote:

Originally posted by TDK_RC6


of what, the way to work around it??


Well what I am trying to script is a job that is sort of like mining. I am working on creating a npc that uses putnpc and uses a random setting to where the ore will be placed, a random setting that determines the type of ore, and another random setting that determines the density/purity of the mineral in percentage. So, I want to learn how to use triggeraction for NON-P2P (if it matters p2p or not) so I can create the pickaxe.

TDK_RC6 02-06-2002 04:56 AM

the make the weapon like

triggeraction playerx+1.5+vecx(playerdir)*2,playery+2+vecy(playe rdir)*2,minehere;

royce 02-06-2002 05:08 AM

Quote:

Originally posted by TDK_RC6
the make the weapon like

triggeraction playerx+1.5+vecx(playerdir)*2,playery+2+vecy(playe rdir)*2,minehere;

Thanx thats what I needed.

Saga2001 02-06-2002 06:49 AM

yay! another scripting problem solved by the superheros of the graal2001 forums...lol

TDK_RC6 02-06-2002 07:39 AM

Quote:

Originally posted by Saga2001
yay! another scripting problem solved by the superheros of the graal2001 forums...lol
a superhero??

na

lordhelmut 02-06-2002 08:53 AM

Quote:

Originally posted by TDK_RC6
the make the weapon like

triggeraction playerx+1.5+vecx(playerdir)*2,playery+2+vecy(playe rdir)*2,minehere;

whats vecx and y

TDK_RC6 02-06-2002 08:57 AM

vector of x and vector of y

lordhelmut 02-06-2002 09:44 AM

Quote:

Originally posted by TDK_RC6
vector of x and vector of y
I know but whats a vector?

Saga2001 02-06-2002 11:43 AM

vecx( dir ) vertical movement vector (0,-1,0,1)
vecy( dir ) horizontal movement vector (-1,0,1,0)


:p

Faheria_GP2 02-06-2002 11:56 AM

when the player is up, y is decreasing so vecy = -1, and x is staying the same so vecx = 0

when the player is right, y is staying the same so vecy = 0, and x is increasing so vecx = 1

and so on...

Saga2001 02-08-2002 02:36 AM

Quote:

Originally posted by Kaimetsu


Well, no. You don't get single-element vectors very often :rolleyes:

Someone freaking describe vectors? I read the definition, but it didn't really help me.

Saga2001 02-08-2002 02:38 AM

nevermind I think i get it more now. Old dictionaries suck.

vec·tor (vktr)
n.

1.Mathematics.
a.A quantity, such as velocity, completely specified by a magnitude and a direction.
b.A one-dimensional array.
c.An element of a vector space.
Source www.dictionary.com


All times are GMT +2. The time now is 07:20 PM.

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