Page 1 of 1

Make FireTile

Posted: Thu Aug 02, 2007 9:41 am
by yrrefsz
Hi all.
I want to make a item called fire tile, it will be a rare and when u lay it on the ground and stand on it u will get flamestriked, but without any damage, anyone can link me with the script for it, or help me make it i want to learn it

Posted: Thu Aug 02, 2007 10:41 am
by Yukiko
First, the type of script you will want in the itemdesc file for your tile is a a walk-on script. Info on walkon scripts can be found in the \docs directory. Look at the file named scripttypes.html.

Second, you will want the tile to create the flame strike effect when the player walks on it. I will post a simple script that should do the trick.

simple walkon flame strike effect script:

Code: Select all

use uo;
use os;

program fseffect(who, what)

 	PlayObjectCenteredEffect(who, 0x3709, 0x0a, 0x1e );
	PlaySoundEffect(who,0xf8);

endprogram
You can add any other effect inside the program[/] declaration.

Save it as fseffect.src or whatever name you like but if you change the name you need to make sure the walkon script entry in the itemdesc file matches the script name. Now compile it.

I'll tell you a secret to scripting, if you want a script that does something, look for scripts that do similar things and see how they do it. You can find walkon scripts in the Distro and the flame strike or flame ploom effect and sound effect are in the old GM textcommand .e

Now you'll need to create an entry in your itemdesc.cfg file for the tile. It will look something like this:

Code: Select all

Item 0xNNNN{
    Name                fstile
    Graphic             0xGGGG
    Facing              2
    WalkOnScript        fseffect
    SaveOnExit          1
    movable             1
}
You need to look at objtypes.txt in the root POL directory to find an unused objtype number and then change 0xNNNN to the number. Next decide on a graphic for your tile and change 0xGGGG to the graphic number you have chosen. Add the entry to the itemdesc.cfg file you want it in and make sure the script is in the same package as that itemdesc file and I think you will have what you want.

Posted: Fri Aug 03, 2007 9:24 am
by yrrefsz
compiled it after i did it but .create itemnumber doesnt work, so doesnt .create itemname...

Posted: Fri Aug 03, 2007 9:41 am
by Yukiko
Check your itemdesc entry and make sure it's typed correctly. I just reviewed my post and see a typo in my example.

Here's the corrected example:

Code: Select all

Item 0xNNNN
{ 
    Name                fstile 
    Graphic             0xGGGG 
    Facing              2 
    WalkOnScript        fseffect 
    SaveOnExit          1 
    movable             1 
}
It's a small typo but the emu is really picky about cfg files. The brace "{" was supposed to be on the line after the item number.

Try that and see. Also be sure to restart your POL after making the changes and saving the file.

Posted: Fri Aug 03, 2007 10:45 am
by yrrefsz
this makes no sense still nothing., what map shud it be in?

Posted: Sat Aug 04, 2007 5:58 am
by Tritan
The realm/map only matters when you create the item. Can you create the tile at all?

Posted: Mon Aug 06, 2007 10:06 pm
by Yukiko
I tested this script and it worked for me.

The odd thing was though that when I changed the parameter in the PlayObjectCenteredEffect function call to what (referencing the tile) I didn't get a flamestrike effect but as it was originally written it works.