Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Baddies/compus gani's (https://forums.graalonline.com/forums/showthread.php?t=73197)

DustyPorViva 04-01-2007 05:49 AM

Baddies/compus gani's
 
3 Attachment(s)
I didn't know where to post this, here or in the gani section. I figure that since this is mainly to help scripters, I'd post it here.
As a little project I was starting for myself, I created gani's of the current soldier baddy. It's a little complex, but that's because of the fact that baddies can have head directions seperate from their body direction.

The baddy's image uses the NPC's head image, IE #3.
The head of the baddy must be shown using a showani. I was going to use it by setting P1, but I found that you can't pass parameters, which was needed(unless there is a way).
When showing the gani, the direction of the head is passed in the parameter as 0-3, like so:
NPC Code:
showani 0,x,y,dir,baddyhead,#v(headdir);


GS2:
NPC Code:
showani(0,this.x,this.y,this.dir,"baddyhead", this.headdir);


killerogue 04-01-2007 06:37 AM

What was "#v" in Gs1? :O

DustyPorViva 04-01-2007 06:43 AM

Oops, forgot to translate that over. Read variables. No idea how to pass the variable into the showani with GS2. So if someone know's how, please post the right code. For now I'll just edit it to GS1.

xXziroXx 04-01-2007 06:48 AM

GS1: message I have #v(this.var) apples!;

GS2: chat = "I have" SPC this.var SPC "apples!";

DustyPorViva 04-01-2007 06:53 AM

Ya, thing is I want to pass the variable as a parameter in the showani.
If I did
NPC Code:
showani 0,x,y,dir,baddyhead,headdir;


In gs1, it wouldn't pass the variable.
So I don't know how to make it correctly pass the variable in gs2.
Anyways, I'm sure if someone is going to use the gani's to script a baddy in GS2, they'd know how to convert the showani.

xXziroXx 04-01-2007 07:16 AM

PHP Code:

showani(0xydir"baddyhead.png"headdir); 


DustyPorViva 04-01-2007 07:46 AM

Ahh, makes sense now. Thanks :), though shouldn't it be this.x, this.y, and this.dir?

killerogue 04-01-2007 07:48 AM

showani(0,x,y,dir,baddyhead,headdir);

Chompy 04-01-2007 10:55 AM

Quote:

Originally Posted by DustyPorViva (Post 1295233)
Ahh, makes sense now. Thanks :), though shouldn't it be this.x, this.y, and this.dir?

Depends on what object you are working with, for example a player.joined class would use this. as the current player, and this.joined would use the current class/npc


All times are GMT +2. The time now is 08:01 AM.

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