While I wait to go home, I'm going to write the instructions for how to use the code I posted.
Since I'm not sure how new you are to the toolset or Aurora script, I'm going to try to be as specific as possible.
I'm a programmer, not a builder. Thus, my instructions on how to create/modify items may be a bit vague.
Note that you do not need to alter any of your modules event scripts to make this work. As long as you have tag based scripting enabled in your ModLoad script, this should work.
I plan to improve on the script I posted before I upload the erf and example mod so that only party members standing close to the character using the item will teleport instead of all party members in the area. The improved code will work exactly the same as this code.
If this item is purchased from a store, it may fail. The custom variables get deleted from store-bought items.
The fix I use for this is easy, and I'll upload that tonight also.
To make the code I posted work, you'll need 3 things:
A useable item. The code assumes that it is a scroll, although that's not essential. The code plays an animation of the player reading a scroll before teleporting them. The important things for the item are the tag, item powers, and a variable.
- For this example, I will use the tag jumpitem. The important thing to remember is that the tag of the item must match the name of the script, which I'll cover later. For now, change the tag of your new item to "jumpitem" (Without the quotes).
- In the item properties tab, remove any default properties that may be on the item. Then add a new property. The property that you want to add is "Cast Spell: Unique Power (Self Only)". I think it's listed as a spell. If this is a scroll, you should set it to Single Use.
- Now, open the variables page for the item. I forget exactly where you go to do that... In one of the tabs, there should be a var button. At the bottom of that window, you need to enter the following as the name of the variable (Left side text box): "JUMPTO" (Without the quotes). In the center box, choose String. The right hand text box is the value of the new variable. This value needs to match the tag of the waypoint that we are going to create in a few minutes. For this example, I am going to use JUMPDEST. Go ahead and type "JUMPDEST" (Without the quotes) in the right hand box and click the Add button to add it to the item.
A Waypoint This is the easiest part. Create a new waypoint. Give it a tag that matches the JUMPTO value that you set on the item. For the sake of the example, set the tag of the waypoint to "JUMPDEST" (Without the quotes).
A Script Create a new script and delete any default code that appears in the new script. Copy/Paste my code in to the script. Save the script with the same name as the tag of your item. For this example, save it as "jumpitem" (Without the quotes). Compile the script.
That should be all you need. To set it up in the mod, place one of your custom waypoints in your mod, and make sure the players can find the item that you made.
When a player uses the item, they will read a scroll and then teleport (along with any party members in the area) to the location of the waypoint.
If you want to make multiple items that teleport to different locations, all you have to do is make a copy of the item (Don't change its tag), change the value of the JUMPTO variable, and make a new waypoint with a tag that is the same as the new JUMPTO value.
EDIT: Fixed a few minor typos.
Modifié par wyldhunt1, 09 janvier 2012 - 11:59 .