Graal Forums

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

ownerofbabylon 09-26-2001 02:20 AM

scripting?
 
Can someone explain how to use and what to use these for?

-Trigger action (I kinda know)
-vectorx and y

Falcor 09-26-2001 03:56 AM

triggeraciton is a combination of hitobjects and callnpc or callweapon


It flags a weapon/npc with certain params.
NPC Code:

triggeraction x,y,actionname,param1,param2,...;



And it is interperated from the other npc wich is triggered.

If the NPC has pixles near that X and Y you selected (showcharacter i think its can be in 0x0 to 3x3 from there x/y though. not sure, never experimented)

so you trigger an NPC with...
NPC Code:

triggeraction 30,30,ihityou,5;


and the npc there responds when the action is given to it based on what you programed it to do.. such as
NPC Code:

if(actionihityou) {
message IVE BEEN HIT FOR #p(0) DAMAGE!!!!! OMG NO!!!!;
}



the flag in the if statement is actionactionname

#p(index) is the value of the Param number sent.

as in my example. #p(0) = 5 but this isSTRING BASED

wich means #p(index) is KINDOF like #s(strname)

If you dont want params you STIL MUST INCLUIDE THE COMMA!

NPC Code:

triggeraction 30,30,ihityou2,;



Get the idea?


Vectorx and y Or dirived from something alot of people used for movement.

it was originally
NPC Code:

dirgo = {0,-1,-1,0,0,1,1,0};


and it was used to move things like this.
NPC Code:

x += dirgo[dir*2]
y += dirgo[dir*2+1]


But now you can just do
NPC Code:

vecx(dir)
vecy(dir)


ownerofbabylon 09-27-2001 07:49 AM

thanks a lot Falcor :)

nyghtGT 09-27-2001 08:02 AM

i still ?
 
i still dont understand about vecx and vecy what is there purpose ?

KJS 09-27-2001 09:35 AM

Re: i still ?
 
Quote:

Originally posted by nyghtGT
i still dont understand about vecx and vecy what is there purpose ?
its if you want to move back or forth depending on there direction...

its good for like detecting things right infront of the person or right behind the person ect...

nyghtGT 09-27-2001 09:44 AM

ok
 
still unsure but ok ...

KJS 09-27-2001 07:10 PM

Re: ok
 
Quote:

Originally posted by nyghtGT
still unsure but ok ...
well if you go like
NPC Code:

if(playerenters)
timeout=.5;
if(timeout){
playerx+=vecx(playerdir);
playery+=vecy(playerdir);
timeout=.5;
}


that would make the player move the direction he is facing... So if he is facing up it will move him up and if he is facing left it will move him left and same with right and down and so on...


All times are GMT +2. The time now is 02:51 AM.

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