please help =( >> adding effects to items

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Damo307
Expert Poster
Posts: 79
Joined: Fri Jul 07, 2006 1:32 am

please help =( >> adding effects to items

Post by Damo307 »

could someone tell me how i can add effects to an item and so it works? i can get the item to make but the effect i have no clue on what to do e.g. like a flame tile, i can get the tile done but when you walk on it, nothing happens..

please help
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Post by CWO »

add an entry in itemdesc.cfg called WalkOnScript for the item. The value of WalkOnScript should be the name of the script you want to fire when they walk on it.
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Post by Yukiko »

If you look at the main itemdesc file in \pol\config and search for rexcob1 you'll find the following:

Code: Select all

// Resurrection-field cobblestones
Item 0xEE01
{
    Name                rescob1
    graphic             0x515
    WalkOnScript        resField
    Movable             0
}
Note the line: WalkOnScript resField

Now if you look in \pol\scripts\items you will find resField.src. I reproduce it below.

Code: Select all

use os;
use uo;

include "include/res";
include "include/resPenalty";
include ":poisonwatcher:poisons";

const EFFECT_SPARKLE := 0x373a;
const SOUND_EFFECT_RES := 0x215;

program resfield(mobile)
  set_critical(1);
  if(mobile.dead)
    start_script("itemRes", mobile);
    return;
  else
    SendSysMessage(mobile,"You are at peace...");
  endif
endprogram
You can use that as an example of what is needed to make a walokon script and tile.
Gnafu
Grandmaster Poster
Posts: 136
Joined: Thu Feb 02, 2006 7:29 am

Post by Gnafu »

Just an intrusion...

Where can i find a complete list of options that can be used in itemdesc.cfg?

In example, the "CanInsertScript" option is not on the head-comments in the pol\config\itemdes.cfg .

Is there a complete list somewhere?
Bytehawk
Apprentice Poster
Posts: 56
Joined: Fri Feb 03, 2006 2:25 am

Post by Bytehawk »

Go to this page and scroll down bit, until you reach "itemdesc.cfg"
Damo307
Expert Poster
Posts: 79
Joined: Fri Jul 07, 2006 1:32 am

Post by Damo307 »

i have an little error with my "item.cfg" so can someone help me out with it please?



-------------------------------------
item 0x0ecq
{
Name ft
Desc Flame Tile
color 1176
Graphic 6173
WalkOnScript tile
Movable 0
}
-------------------------------------
Xadhoom
Neophyte Poster
Posts: 30
Joined: Fri May 26, 2006 12:53 am

Post by Xadhoom »

0x0ecq it's not a valid Hex value :eek:
Damo307
Expert Poster
Posts: 79
Joined: Fri Jul 07, 2006 1:32 am

Post by Damo307 »

oh okay, do you know one that will work :( ?
Pierce
Forum Regular
Posts: 420
Joined: Thu Feb 02, 2006 8:33 am

Post by Pierce »

Hex Values go from 0 to 9 and from a to f.
To find an unused value you have to look inside your objtypes.txt in your main pol directory.
Marilla

Post by Marilla »

And be sure to use a value over 0x5000, but below 0xf000. It may work if you violate that rule, but you would be highly likely to have problems with collisions in the future with core/distro items, or new items you need to create later.
Post Reply