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
Make FireTile
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:
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:
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.
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
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
}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:
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.
Here's the corrected example:
Code: Select all
Item 0xNNNN
{
Name fstile
Graphic 0xGGGG
Facing 2
WalkOnScript fseffect
SaveOnExit 1
movable 1
}Try that and see. Also be sure to restart your POL after making the changes and saving the file.