I'm setting up my first shard, and I have picked up on alot by just toolin around, and I'm not having too many problems. But I don't quite understand making new items and such. I want to make a "guard deed". Is there an easy way to do this? Or is there even a way to make a deed for any kind of npc??
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well, the vendor deed is actually code driven, and hard coded to a specific ID. There's not an altogether easy way for you to do it. You do have one option though. What you could do is script a new item (of the deed type), and attach a JS script to it that has the onUse event implemented, that adds an NPC of the particular type you wish to use. It shouldn't be too terribly difficult.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Much greater control and flexibility is now available to the end shard op via the JS based script engine. This allows users to write custom scripts, and then link them in so that when certain things happen the scripts fire and execute.
Some example JS files already come with the installer, you can look at them for some inspiration.
This will spawn an npc from npc.scp (SECTION NPC 1234) and place it where the user used it. It returns a handle to the new npc in iNPC. If iNPC == -1, then it failed to create it.
Change the 1234 to whatever you wish it to be to customize which NPC gets created.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is it possible to make a "Mysterious Gem" with the same item ID as a diamond attached to a JS script that makes something, but can only be done with mysterious gems?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm setting up my first shard, and I have picked up on alot by just toolin around, and I'm not having too many problems. But I don't quite understand making new items and such. I want to make a "guard deed". Is there an easy way to do this? Or is there even a way to make a deed for any kind of npc??
Well, the vendor deed is actually code driven, and hard coded to a specific ID. There's not an altogether easy way for you to do it. You do have one option though. What you could do is script a new item (of the deed type), and attach a JS script to it that has the onUse event implemented, that adds an NPC of the particular type you wish to use. It shouldn't be too terribly difficult.
uh.....I'm not quite sure what you mean...onuse event? im a bit of a n00b
Much greater control and flexibility is now available to the end shard op via the JS based script engine. This allows users to write custom scripts, and then link them in so that when certain things happen the scripts fire and execute.
Some example JS files already come with the installer, you can look at them for some inspiration.
But you'd be looking for something like this:
function onUse( pUser, iUsed )
{
var iNPC = SpawnNPC( -1, 1234, GetX( pUser, 0 ), GetY( pUser, 0 ), GetZ( pUser, 0 ) );
}
This will spawn an npc from npc.scp (SECTION NPC 1234) and place it where the user used it. It returns a handle to the new npc in iNPC. If iNPC == -1, then it failed to create it.
Change the 1234 to whatever you wish it to be to customize which NPC gets created.
Where abouts would I add a new item and attach the JS script (is it item.scp)?
Could I get an example of flour attached to the cooking JS script.
Is it possible to make a "Mysterious Gem" with the same item ID as a diamond attached to a JS script that makes something, but can only be done with mysterious gems?