Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EE]How to add a new item type?


GammaÃâžÂ
 Share

Recommended Posts

@Anna:

> ![](http://img.photobucket.com/albums/v400/annacomnena/silly/reactions/puzzled.jpg)
>
> You need to be more clear on what you are asking.

Sorry my english isn't that good,
I mean like in the item editor you can select a type like an helmet,
How to make a new one like that and make it scripted + paperdoll?
I hope i'm clear enough now XD
Link to comment
Share on other sites

Gamma what language do you speak? Could you perhaps explain it in your native language and Ill take a lookie.

I think you mean you want to create a new type of Item e.g At the moment you have Helmet, Legs, Armor which if PaperDoll is on will also show their Paperdoll counterparts.

What you want to do is make a new Item Type like : Scripted Helmet, Scripted Legs, Scripted Armor. So that when you set an Item to one of those it gives you an option to attach a script to it whilst it still shows Paperdoll counterpart.

At the moment if you set an item as scripted Item it acts more like a Potion and you can not equip it.

So with that said you would need to edit the source and combine the code used for scripted items with that of an equippable Item like Helmet,Armor, Legs etc.

That or you could set the item as Helmet, Legs or Armor etc then in the OnEquip Script of Server Scripts you could do a check for certain items and apply the functions you want.

NOTE : You could even edit the ScriptedItem.ess script so that when you click on it it will equip / unequip - Im little busy at moment to test if that would still show PaperDoll counterpart but your best, cleanest best would be Source edit Im so sorry I do not have time to post code for it atm only the logic.
Link to comment
Share on other sites

@silentdemonic:

> Gamma what language do you speak? Could you perhaps explain it in your native language and Ill take a lookie.
>
> I think you mean you want to create a new type of Item e.g At the moment you have Helmet, Legs, Armor which if PaperDoll is on will also show their Paperdoll counterparts.
>
> What you want to do is make a new Item Type like : Scripted Helmet, Scripted Legs, Scripted Armor. So that when you set an Item to one of those it gives you an option to attach a script to it whilst it still shows Paperdoll counterpart.
>
> At the moment if you set an item as scripted Item it acts more like a Potion and you can not equip it.
>
> So with that said you would need to edit the source and combine the code used for scripted items with that of an equippable Item like Helmet,Armor, Legs etc.
>
> That or you could set the item as Helmet, Legs or Armor etc then in the OnEquip Script of Server Scripts you could do a check for certain items and apply the functions you want.

I speak dutch i will explain it:

> Ok, ik zou de helmet item type zo willen veranderen dat ik er een script aan kan toevoegen.
> Of een nieuwe item type, zoals scripted helmet maar dat het wel paperdoll heeft + een script

I hope this is clear enough XD
Link to comment
Share on other sites

Probleem is, je kunt dat wel doen maar zo'n script kan niet continue draaien, als je dat probeert vreet één item je hele server performance op.. En om het alleen op equip/unequip te laten draaien is ook zo raar.
Link to comment
Share on other sites

Yeah I understood fully, my post is the answer you need do you understand it?
The following might not make much sense but it might beat trying to understand the long lines of English I posted.

Ik denk dat je bedoelt dat je wilt om een nieuw type van punt bv op het moment dat u te maken Helm, benen, die, indien Paperdoll Armor is zal blijken Paperdoll hun tegenhangers.

Wat u wilt doen is een nieuwe post Type zoals: Scripted Helmet, Scripted Legs, Scripted Armor. Dus dat wanneer je een item ingesteld op een van die het geeft je een optie om een script te hechten aan het, terwijl het nog steeds blijkt Paperdoll tegenhanger.

Op het moment als u een post als scripted Post fungeert meer als een Potion en je kunt niet uit te rusten is.

Dus met dat zei je nodig zou hebben om de bron te bewerken en de gebruikte code voor het script items met die van een equippable Post als Helmet, Armor, Benen, enz. te combineren

Dat of u kunt het item in te stellen als Helmet, benen of Armor etc dan in de OnEquip Script van Server Scripts je kon een cheque van bepaalde items te doen en toepassen van de gewenste functies.

Apologies if I made a mockery of Dutch…

YamYam could you explain what you mean when you say the script would need to run the whole time?
Depending on how you did it you could place a check in the scripted item to check if its equipped or not when called, if it is then it goes back to inventory if it is not it is equipped and said script executed.
This can be done with Scripted Items, the area I have not tested however is whether it will show PaperDoll with it.
Link to comment
Share on other sites

You can either run the script only on equip/unequip, or as some people want it have a script that runs forever and ever for certain effects and whatnot.. problem if a script like the second one won't work as it'll just eat your system performance.. I did however think of it that you could also let attacking trigger your scripts, or various other actions.
Link to comment
Share on other sites

Silent, if this was scripted, it'd have to be done with a timer. A source edit would allow you to trigger an event in any way.

Gamma, explain what you mean by "scripted". I know what the term means when referring to a "scripted item", but that's because there's a predefined trigger. Do you mean a script that runs when you attack? When you get attacked? When you equip an item? When you remove an item? Upon "using" the item? There's so many ways for an event to run that the word "scripted" doesn't tell us much.

I'll link you to two tutorials of mine for adding scripted events. http://www.touchofdeathforums.com/smf/index.php/topic,16162.0.html

Warning - while you were typing a new reply has been posted. You may wish to review your post.

Damn. What she said. ^

Edit: There, added on my tutorial. Keep in mind, though, that scripting anything comes with additional lag due to slow execution. You might be better off coding it a different way.
Link to comment
Share on other sites

Thats the thing I dont get though, why would it need to be triggered in the attack script. If you wanted a weapon whose script only affected your attacking situations you could just store the effects in a putvar file.
E.g
I equip the Mighty Helmet of the Ancients
This means whenever I fight on a Map that the Ancient Race used to live on - all my attacks are increase by 200% damage and my defence by 400%.
In the PutVar File called ScriptedHelmet Effects I would have.
[Mighty Helmet of the Ancients]
A=200
D=400
M=20, 21, 22, 23, 24, 25

Where 20-25 are the Map Numbers.
Then you place it in an appropiate place such as OnMapLoad.ess a check that scans if Player is equipped with such an item and execute accordingly.

This is a quick write up and not efficiently written or thought through but I think it could be effective.
Personally I would just have Scripted Tiles activate for certain Items/Weapons/Tools etc. But each to their own xD
Oh and off-topic thanks for the defence in another thread ^_^

EDIT : Dammit Baille! YamYam beat you to it and you beat me to it T_T darn you all lol thanks Baille your tutorial makes much more sense I type way too much T_T
EDIT EDIT : I think the main thing is having an Item such as Scripted Item that behaves like equipment showing the PaperDoll attached. Which is not currently in ES. If you set an item to say Armor and then equip it and then edit it to be Scripted Item itll crash. A scripted helmet wouldnt have that problem and would still behave like a scripted item type is what he is getting at I believe.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...