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 02-16-2009, 02:58 AM
GULTHEX GULTHEX is offline
Registered User
Join Date: Jul 2008
Posts: 148
GULTHEX can only hope to improve
how do i make a npc that loads a tileset

how do i make a weapon/npc that loads a tileset
Reply With Quote
  #2  
Old 02-16-2009, 06:10 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
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
addtiledef("TILESET.png""LEVEL_START"1);

"TILESET.png" is the filename of the tileset, e.g. "era_tileset-summer.png";
"LEVEL_START" is the start of the level. All your levels must start with this (it can be left blank to apply to all). For example, "era_"

The final number is either 0 or 1. 0 is the old-style tileset, which is like pics1.png. 1 is the new-style tileset, which is usually used on most servers that aren't a classic server/classic tileset variant.

You can add multiple lines as well. For example,
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
addtiledef("era_tileset-summer.png""era_"1);
  
addtiledef("era_tileset-sewers.png""era_sewers-"1);
  
addtiledef("pics1.png""era_chris-"0);

If you want to remove the saved tiles, use the code:

PHP Code:
removetiledefs(""); 
right under the onCreated() function (before the addtiledef lines).

If you want to set the tileset in the level editor, do this (similar to the way for online):
PHP Code:
//#CLIENTSIDE
if (created) {
  
addtiledef era_tileset-summer.pngera_1;

Offline, to remove all saved tiledefs, put this code in a script (probably under the 'created' if statement):
PHP Code:
removetiledefs
__________________
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 10:43 AM.


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