Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-05-2006, 10:17 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
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.
Reply With Quote
  #2  
Old 01-05-2006, 10:52 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
GS2 only.
PHP Code:
findimg(index).actor.colors[0] = "blue"
Reply With Quote
  #3  
Old 01-05-2006, 11:01 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
thanks.
Reply With Quote
  #4  
Old 01-06-2006, 12:02 AM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
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?
Reply With Quote
  #5  
Old 01-06-2006, 12:11 AM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
Sorry, you also need findimg(index).playerlook = false;
Reply With Quote
  #6  
Old 01-06-2006, 12:18 AM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
Thanks. Works now
Reply With Quote
  #7  
Old 01-09-2006, 03:39 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
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";
  }

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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