PenUltima Online

It is currently Thu Aug 28, 2008 10:03 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Make FireTile
PostPosted: Thu Aug 02, 2007 9:41 am 
Offline

Joined: Sat Jul 28, 2007 8:09 am
Posts: 11
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 02, 2007 10:41 am 
Offline

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1118
Location: Southern Central USA
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:
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 [i]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:
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.

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 03, 2007 9:24 am 
Offline

Joined: Sat Jul 28, 2007 8:09 am
Posts: 11
compiled it after i did it but .create itemnumber doesnt work, so doesnt .create itemname...


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 03, 2007 9:41 am 
Offline

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1118
Location: Southern Central USA
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:
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.

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 03, 2007 10:45 am 
Offline

Joined: Sat Jul 28, 2007 8:09 am
Posts: 11
this makes no sense still nothing., what map shud it be in?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 04, 2007 5:58 am 
Offline
User avatar

Joined: Sat Feb 04, 2006 8:17 am
Posts: 136
Location: Illinois, USA
The realm/map only matters when you create the item. Can you create the tile at all?

_________________
2nd place is the 1st loser.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 06, 2007 10:06 pm 
Offline

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1118
Location: Southern Central USA
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.

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl