Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   how do i make a npc that loads a tileset (https://forums.graalonline.com/forums/showthread.php?t=84234)

GULTHEX 02-16-2009 02:58 AM

how do i make a npc that loads a tileset
 
how do i make a weapon/npc that loads a tileset

cbk1994 02-16-2009 06:10 AM

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



All times are GMT +2. The time now is 04:52 AM.

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