Full Version : XmlStealable
xmlspawner >>XMLSpawner Feature Request's >>XmlStealable


<< Prev | Next >>

Lord Hog Fred- 09-01-2006
Just realised that this functionality is on the spaner but not available as an attachment, it would be great to be able to define items as stealable in their scripts just by adding an XmlStealable attachment.
I wouldn't have thoguth it would be too difficult, would obviously require another change to Stealing.cs but to prevent the item from being stolen more than once the Stealable attachment could have a true/false setting so when it's first spawned the attachment is set to true and can be stolen but once it's been stolen the attachment gets set to false and then can no longer be stolen.

ArteGordon- 09-01-2006
actually that functionality is already available, although the implementation predates attachments.
I have been recently thinking about changing the system over to one that was attachment based, but the way that it works now is through the saved user flags on items.

The [stealable command lets you check or set the stealable flag on any item.

[stealable [true/false]

If the flag is set, and you have made the mods to stealing.cs that check for it, then the item can be stolen.

To set the flag when spawned, you would use the STEALABLE keyword like

platehelm/movable/false/STEALABLE/true

If I did switch it to an attachment-based system it would still work in the same way, so it would be fairly transparent although I would be able to add more functionality with the attachment than I can with the flags, like being able to explicitly set stealing difficulty for individual items, etc.

Lord Hog Fred- 09-01-2006
Ah ok cheers, I wasn't aware you could do that outside of spawning the item.
So to add the stealable flag to a script would I use:
CODE
ItemFlags.Stealable(true);


On what you said about the attachments defininf skill would the skill be a second variable of the attachment so it would have Stealable true/false and Skill int

ArteGordon- 09-01-2006
QUOTE (Lord Hog Fred @ September 01, 2006 06:05 am)
Ah ok cheers, I wasn't aware you could do that outside of spawning the item.
So to add the stealable flag to a script would I use:
CODE
ItemFlags.Stealable(true);


On what you said about the attachments defininf skill would the skill be a second variable of the attachment so it would have Stealable true/false and Skill int

yes, that is how you would script it.

Note that setting the stealable flag does not automatically make the item immovable. You still have to set the movable flag yourself.

The way I would be thinking about implementing the extended stealing attachment would be to extend the current syntax to add optional arguments for the min/max skill required so it would look like

platehelm/STEALABLE,70,90

You could still use the default

platehelm/STEALABLE

to just enable stealing and have the weight determine the difficulty as it is by default.

The scripted version would also support additional optional arguments, like

CODE
ItemFlags.Stealable(true, 70,90);


and you could manually set/check stealability with the [stealable command like

[stealable true 70 90

So it would be completely backward compatible with the existing system. It would just use attachments instead of flags, which is better anyway.
The problem with flags is that if other systems decide to use flags for their purposes there could be conflicting use.
Doing it with attachments avoids that and also gives you additional flexibility.

I was also thinking about adding attachment support for an OnStolen hook which would allow you to have attachments actively carry out actions when things are stolen.

Lord Hog Fred- 09-02-2006
That would be brilliant. An OnStolen attachment would be fantastic for making thief quests.

ArteGordon- 09-02-2006
yeah, I like that idea too.