Graal Forums

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

JkWhoSaysNi 01-05-2006 10:17 PM

Showani question
 
Is it possible to make showani have different attiributes (head, shield, etc) than the npc that calls it?

What i want is one npc which uses showani and shows 2 differnt npc's.

Something like this:

NPC Code:
if (created) {
// Initialize the attributes
showcharacter;
setcharprop #3,head0.png;
setcharprop #C0,orange;
setcharprop #C1,white;
setcharprop #C2,blue;
setcharprop #C3,red;
setcharprop #C4,black;
setcharprop #2,shield1.gif;
shieldpower = 1;
dir = 2;
showani 100,x+4,y,6,idle;
setcharprop #3,head10.png;
setcharprop #C0,cynober;
setcharprop #C1,yellow;
setcharprop #C2,white;
setcharprop #C3,black;
setcharprop #C4,white;
setcharprop #2,shield1.gif;
showani 101,x+6,y,6,idle;
}



That's just a basic example. I want this for a tailor script. I want to display quite a few possible outfits using showani but have them shown at once. Then have the player click on them.

I have the basis of it done but got stuck because i can only show one outfit using the weapon npc. When you do setcharprop (or this.attribute = whatever) it updates every showani with the new attributes.

Is it possible to show 2 different outfits using the weapon npc?

Thanks.

Yen 01-05-2006 10:52 PM

GS2 only.
PHP Code:

findimg(index).actor.colors[0] = "blue"


JkWhoSaysNi 01-05-2006 11:01 PM

thanks. :D

JkWhoSaysNi 01-06-2006 12:02 AM

I can't get it to work.

I just created this very basic npc and it doesn't work.

NPC Code:

//#CLIENTSIDE
// Graal2002 NPC by Stefan Knorr
if (created) {
// Initialize the attributes
showcharacter;
setcharprop #3,head0.png;
setcharprop #C0,white;
setcharprop #C1,white;
setcharprop #C2,white;
setcharprop #C3,white;
setcharprop #C4,white;
setcharprop #2,shield1.gif;
shieldpower = 1;
dir = 2;
}

if(playertouchsme) {

showani(201,x+4,y,6,"idle");
findimg(201).actor.colors[0] = "black";
}



The ani gets shown but the colours are the npc's. Any ideas?

Yen 01-06-2006 12:11 AM

Sorry, you also need findimg(index).playerlook = false;

JkWhoSaysNi 01-06-2006 12:18 AM

Thanks. Works now :)

Admins 01-09-2006 03:39 AM

Best scripting style to do it would be like this:
PHP Code:

with (findimg(200)) {
  
ani "idle";
  
playerlook false;
  
with (actor) {
    
head "head19.png";
    
colors[0] = "black";
  }




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

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