![]() |
Triggeraction Guide
Could someone be kind enough to explain Triggeraction for non-p2p stuff in its fullest content?
|
triggeraction x,y,name,param;
triggers action "name" at x,y in the npc at x,y (if any) if (actionNAME) { dostuff; } |
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: talk about a loop... |
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 |
srry ur right i should have mentioned that. thanks ;)
|
give me an example plz. ;)
|
Quote:
|
Quote:
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. |
the make the weapon like
triggeraction playerx+1.5+vecx(playerdir)*2,playery+2+vecy(playe rdir)*2,minehere; |
Quote:
|
yay! another scripting problem solved by the superheros of the graal2001 forums...lol
|
Quote:
na |
Quote:
|
vector of x and vector of y
|
Quote:
|
vecx( dir ) vertical movement vector (0,-1,0,1)
vecy( dir ) horizontal movement vector (-1,0,1,0) :p |
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... |
Quote:
|
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.