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 06-08-2013, 01:22 AM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Making NPC's appearance show differently

I assume this is possible in some way, but how would you go about creating a NPC (let's say for simplicity, a noob character) and if you had a particular item, you would see the noob in a new form, like some other kind of person? (Simple outfit change based on meeting a criteria of having an item or flag checked to true) ?

I guess what I'm trying to say is how would this be gone about script wise?

Would it go something like default appearance if you don't have the item and then if you do then the apperance changes or is there a better way to handle this?
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #2  
Old 06-08-2013, 03:25 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Just do whatever change you need clientside. Then it only affects the current player.

Simple example:

PHP Code:
// display block.png unless you have clientr.boo set;
// if it _is_ set, then, display bcalarmclock.png instead
//#CLIENTSIDE
function onPlayerEnters() {
  if (
player.clientr.boo) {
    
this.setImg("bcalarmclock.png");
  } else {
    
this.setImg("block.png");
  }

You do the same thing for characters, substituting the various body parts for the setImg. You can change the check to check if, for example, a player has a weapon.
__________________
Reply With Quote
  #3  
Old 06-08-2013, 04:00 AM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Quote:
Originally Posted by cbk1994 View Post
Just do whatever change you need clientside. Then it only affects the current player.

Simple example:

PHP Code:
// display block.png unless you have clientr.boo set;
// if it _is_ set, then, display bcalarmclock.png instead
//#CLIENTSIDE
function onPlayerEnters() {
  if (
player.clientr.boo) {
    
this.setImg("bcalarmclock.png");
  } else {
    
this.setImg("block.png");
  }

You do the same thing for characters, substituting the various body parts for the setImg. You can change the check to check if, for example, a player has a weapon.
Interesting, good to know, thank you
You've helped me more than you know.
__________________

Careful, thoughts and opinions here scare people.

Last edited by Fulg0reSama; 06-08-2013 at 07:01 AM..
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 12:04 AM.


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