Warcraft III resources & community, 2003–2006 · archived

RPG engine Alpha 4

4.54 / 5 (13)
Submitted by weaaddarSystems1,579 downloads89 KB
No preview survived for this resource
DT4a RPG engine version 4

--Discovered that the component approach is not going to work.

--Added PItems and new EItems. Eitems now show up in inv if you aren`t equipping them.

--PItems can be picked up anywhere.

--Atr removed due to a problem.
File Name
dt4a a4.w3x
Author
Unknown
Download

Comments

41
should work and daelin you idiot they weren't categories wehen i wrote it.
Will this work in the new 1.8 patch? or is it 1.9 now im not sure :/
GOD! It's a system, why couldn't you submit it correctly? Moved to systems cattegory!

~Daelin
Ok, it doesnt matter, as i got round it by just using 1 hero per player. A suggestion, next version, instead of making agi/strength/int bonus look normal, could you have them put in the little green numbers by the side of the stats? It would make it much cooler, imo. Thx anyway
I'm going to say make sure you fully initialize the unit to handle EITEMS and to be a hero. Its buggy, and I know now how to fix (some of) it, but to fix it would require a lot of rewriting. I don't know what your doign with the heroes but if you put an eitem in a bag, and drop the bag my system doesn't realize that you no longer have that bag and you can still access it through the item menu. Your probably exploiting that.

Also Pitems should be fine as a measure to counter inventory space shortage.
Great job weaaddar, very cool. I have found 1 bug, but I don't know if your system was designed to handle this sort of thing - (This is what I did) If you declare 3 heros for player 1, and the start trading the items around between them, you can clone items, and start to pull items out of people inventories by picking up swords from the gournd, and also its hard to pickup more than one item of the same type that doesnt go into your inventory. Anyways, gj
OMG!!! This system is awesome but I can't figure out anything on it . . . I want to put this in to my map, which I can do, but I can't fugure out how to add MY items into it. . .
999999/5!!! :twisted: :twisted: :twisted: :twisted:
OMG!!! This system is awesome but I can't figure out anything on it . . . I want to put this in to my map, which I can do, but I can't fugure out how to add MY items into it. . .
999999/5!!! :twisted: :twisted: :twisted: :twisted:
Anyone in the mood to try to exploit the system?

I don't think I handle for it, so grab your favorite bag put an eitem on it, and drop the bag. Open the eitem menu and try to find that item. If you can I didn't handle for it, and if I did well I rule don't I?

1)Would Orb Effects work on EItems in your Bag, or PItems? There is always another approach to this, by creating a passive ability hidden in the item (such as the Permanant Invis on the Future Gun.) but it would make things much easier to know whether or not it will.

Eitems are fake. There pickup versions are just super duper fake. Unequiped they should have no effect. They only gain effect when equipped, and giving them effects could be dangerous and result in unintentional behavior.
Pitems are regular items, with a fake pickup item attached to them. They don't get special properties, only the ability to be picked up and enter any first level avaliable container. (I was too lazy to recurse through multi-layers of containers)
So the answer is no. Just make an eitem with the ability. Its better that way, you can only have one orb active at a time, so having a sword that gives cold and one that gives fire is perfect, and won't require the player to fiddle arround to get the orb effect he wants.

2)If I were to, say... kill my hero, and revive him from an alter, would the hero come back as a mess? Or would it be capable still, to continue holding PItems and EItems

As I remember, suprisingly, it worked perfectly. No reconfigurations required. I'm guessing Revive does what it says and actually revives the unit, not create a new unit. He revives with the same equipment and all the abilities that equipment gave, which is hard to believe.


as far as code reading goes, Vector is a generic class. You really shouldn't have dificulty reading it. I'm talking about the more complex classes like bag, hero, pitem, eitem, req... Take a while to map out a tree of what goes to what. Its just about the only way to really understand what the code does. If thats not your bag (sorry for the pun), then don't really expect to mod the system. As it styands this is the last release of this approach. I might try something new a truly fully component approach. My current approach is composite triggers so its just a mess.
In fact, I remember reading through the Vector section, so it shows nothing about me not reading through the script... but as I, have no knowledge whatsoever of JASS, than I really don't have much to say about that, as I read through it not knowing it held some significant meaning. I'm sorry for offending you, now, I honestly have no idea what you've told people a million times... I wasn't here when you submitted your Alpha 1-2-3 (where I assume you've told people)
I was simply restating the question I've asked about (with no response to) 2-3 months ago.
As I don't (and haven't) have access to Warcraft, this was the only place where I could ask such questions, if these next questions are incredibly mindless and stupid. Just say so, and I'll never post here again.
1)Would Orb Effects work on EItems in your Bag, or PItems? There is always another approach to this, by creating a passive ability hidden in the item (such as the Permanant Invis on the Future Gun.) but it would make things much easier to know whether or not it will.
2)If I were to, say... kill my hero, and revive him from an alter, would the hero come back as a mess? Or would it be capable still, to continue holding PItems and EItems.
I've said no to this question about a million times.
NO SAVE/LOAD
All items in bags,eitems, etc are hidden. They are all stored in Vectors or directly attached to the hero by cache. Vectors are attached to heroes/bag by cache too.

By the way, can you try to read the code before asking such a question? Its really shows no idea how the system works and its kind of offending. Its hard to read, I realize, but the classes are much much more readable than say the triggers. Grab a pen and paper and go through each class and try to figure out what each function does. Write comments for yourself when you figure it out (most are named), then find functions you can't understand in the least and ask me about those ones. Or better yet, sit down and try to figure out what they mean.
Great! I'll try expirementing with those, and to be a pest, I have yet another question to ask.
Is it even possible to create a Save/load for this? I know it creates a lot of new invisible units, and items, I don't know how that all would work. I don't really even know if it's possible, I think this uses some In-game Cache, so creating a Save/load may not work. In the toughest of situations, I'll ask my friend, who isn't very good at JASS either, to look at this, and try to teach me as much as he can about this.

I've tried to make an Integer save/load out of this before, but I dont know how I would save the EItems, and the PItems without mixing them. I assume that the EItems are being held by some sort of hidden unit, in which case would be much easier to save the hidden unit and the real unit.
The next problem I ran into were the Bags, I could probably save the Bags themselves, but not the contents of them. I also assume they're being held by some sort of invisible unit, or a cache.
As I have asked before, if the Integer Save/load approach would be possible. I would like to ask for the lay-out of the:
---
-Invisible (or hidden) units created that need to be entered into the code
-Items that need to be entered into the code
-Cache (if there is any)
---
If there are none, great, if there are, that's okay too, I just need to figure out how to implement them all into an Integer Save/load (if it's possible in the long-run)
Thanks.

~~Two-handed weapons:: (A weapon that takes over your shield slot and your weapon slot)
--

Not supported. And mostly likely never will be. You can cheat it by editing the equip code to remove shield equipping when an item that is two handed is equipped. Of course, you'll have to add a flag to look for it too.

~~Class Specific:: (Only a certain class can equip an item)
--

Already in this release. Instead of using a blank requirement, edit the first field in the requirement and enter some integer, then give the same integer to heroes who can use it using the HeroAddClass function (i think I called it that, I don't remember).

~~Dual-weilding weapons:: (this is when you wear 2 one-handed axes/weapons, and one takes over the shield slot if it isn't being used, and I don't mean editing a shield and changing the values to be like an axe/weapon, this is because if you have no weapon in your weapon slot, the axe will be placed in your shield slot, instead of going into the slot that it belongs)
--

Already enabled. Instead of flagging a sword for just one slot, flag it for both rh and lh slot. Make sure shields have lower pvals then swords, so shields will always beat out swords on the equip trade. As long as you only try to equip weaker weapons (weapons with higher Pvals) in your left hand, this should work naturally. Obviously if you try to equip a better weapon the one currently in your right hand will be removed.
[/quote]

~~Set(s):: (These occur when you equip (ex.) one Jade Armor, Jade Ring, & Jade Boots, they give u set bonuses (this only occurs when they are all equiped!))

Not supported, and probably never will be. Again its cheatable. Let say you have a four item set, make sure in equip that when all four items in your ELV are equal to the four items of the set, then equip a fifth item Set bonus, or make it look like the blank item so nobody knows its an item giving the bonus. when deequip is run just remove the fifth item and no one will be the wiser. Also make sure no item actually uses the fifth slot.[/quote]
Back from a horrid school venture...*phew* I had a couple of questions about the limitations of this system, I prefer this system much more than the 'Invx' because of its stability and simplication for use. However, the 'Invx system' did have a few strong points to many (and my own) likings, they include things like Sockets~etc. And as for the limitations of this system, I'd like to ask about the following (Listed most important, to least in my opinion):
----------------------------------------------------------
~~Two-handed weapons:: (A weapon that takes over your shield slot and your weapon slot)
--
~~Class Specific:: (Only a certain class can equip an item)
--
~~Dual-weilding weapons:: (this is when you wear 2 one-handed axes/weapons, and one takes over the shield slot if it isn't being used, and I don't mean editing a shield and changing the values to be like an axe/weapon, this is because if you have no weapon in your weapon slot, the axe will be placed in your shield slot, instead of going into the slot that it belongs)
--
~~Set(s):: (These occur when you equip (ex.) one Jade Armor, Jade Ring, & Jade Boots, they give u set bonuses (this only occurs when they are all equiped!))
-----------------------------------------------------------
These are very important for myself, and others. They'd also help this System become truely greater!
If these are already possible, I'd really love to find out how :D and if not, could you please include them? I'd love you 999999999x more if you could at least add one of those!
Keep up the awesome work!
~Joey.
-----please respond :D ----
You have to make sure your hero supports it. Right now in my demo map you can just go call Hero_enableEquip(hero,31) and that'll enable all 5 slots so I dunno.
You have to make sure your hero supports it. Right now in my demo map you can just go call Hero_enableEquip(hero,31) and that'll enable all 5 slots so I dunno.
Great! just got off from vacation, and now, I Got it... sooooo easy, can't believe it took me this long to figure it out. I honestly couldn't find the trigger that has the Functions on creating an Item Etc... stupid me! Anyway, thanks a ton!
Made about 20 items now :)
Did you forget something in the tutorial section about creating new Equipment Slots? It seems to freak out when I pick up an item of a new slot, if you could try it using only your tutorial about that, maybe you could help me figure that out, all else seems awesome! :D
I think I made it as easy as possible. Just copy the Future Guns Code in the Test Item Trigger, and paste it right below the Future gun and modify as neccessary for your Eitem. REally it can't get much easier.

In case you haven't figured out you work between the function declarations. The system was coded in Jass and there is no way around using jass sorry.
Well, the problem with CnPing and Editing some values is that I have no Idea where they are in the triggers, can I not create a new trigger and only put in that one part of code you have added in the Tutorial, or do I need to place them above, below, or w/e in a certain Trigger. As it stands, I have no idea what the surrounding codes look like, and I can't neccessarily determine which code ends and where it starts. So what would help, would maybe tell me Which trigger it's in, and maybe Copy the surrounding code and only Highlight the part that I need to edit? For the creation of an Item, you said to Store it into a Local Variable called ID, I have no idea how to do that, and if I did, I would have no clue where to put it into the Code while making a new Item, I hope you understand me, which you probably don't. I really don't know enough about JASS to read it and determine where things go, for instance, I know you need to declare variables before you can call on anything, if I put the variables on the bottum, then it won't work properly... :( rather Complex. Again, sorry for the Inconvenience, I know trying to teach someone who has no real clue of what's going on can be tough.
PS: Is it even possible to create a Save/load for this? I know it creates a lot of new invisible units, and items, I don't know how that all would work. I don't really even know if it's possible, I think this uses some In-game Cache, so creating a Save/load may not work. In the toughest of situations, I'll ask my friend, who isn't very good at JASS either, to look at this, and try to teach me as much as he can about this. :(
You should have released a very simple version of this spell system, where you created a unique trigger for each attribute basically, that is Attachment, Skill, Crit, crit rate, Swords, shields, accessories, etc. so I could just modify the atribute I need instead of ignoring a lot of the stuff in there and not knowing where to place them, it would of course take a few more triggers, but it'd be worth it. To teach people what it does, and hey, thats what these are for right :P
You can't select the raw code of an item its fixed to the item. When you create a new one it generates a new raw code. I wish you could select a raw code value some how so I'd label all my abilities WAxx or whatever.

Um putting code in Hero would be VERY BAD. There's a reason I kept the code seperate. You should make your trigger right below the DT4a triggers like I did. You can infact just use the test trigger if your feeling lazy ( I always am)

The IDNoItem function should not be replaced but merely edited.

If you are feeling especially explicit and want to be very good, you could make A unique trigger for each Eitem slot type. I.e. Swords,shields,accessories. Make sure these triggers run at map init and then just convert them to custom text. I would copy and paste over my Future gun only because I think it uses every field you can make an eitem use except model. (which you can totally add).

I think if you get rid of custom code inside my triggers you should get rid of the problem. Jass script functions can only call preceding jass script functions. Since trying to call CreateEItem is like 15 triggers Hero it causes all sorts of errors. Jass script compiler is also retarded and once one error occurs roughly 14 other billion other ones can and will appear. Thankfully there mostly not real.
I feel smarter just by reading that :D
Thank you SO much, you kick ass!
Thanks for going out of your way to teach a newb
Imma go try it out, I'll tell you if I can get it right :D

Now I'm having a bit of trouble finding the Triggers that I CnP those into, and when I place it into a random trigger (I used 'Hero') it brings up an error during Variables while validating Map Script, quite a few Errors it shows... How do I fix this?
Also, How do i create a Custom Raw Code, If I CnP an Item, it will bring up a new one after I press ctrl+D but it doesn't show where to add one. For the most part I understand your Tutorial, and I thought I knew what I was doing, but 1 thing must have gone wrong and now the whole script has errors.
I've tried to do the Following,
Create a new Slot for Helmets + Armor
Created Custom Items for the both of them giving the NoItem 200 Prio, and the real item 105 Prio
, Like I said earlier, I wasn't sure where to put the JASS so I put them at the Bottum of a random trigger. If there is a certain place i should be putting them, please let me know :D
Alright next up is the flagship item of my Drag and Drop system called BTs

In a later version I'll probably change the name to BItems, but for now BT it is. BT are bagtypes. Bag types are what you define as items that have storage. They have paging inventory and can store huge amount of items, though due to the interface I would recommend no more than about 8 pages. (That's more than 30 items which is 5 times the defualt inventory size).
BTs are oddly defined by thier inventory size even though they must be fixed multiples of four and are better thought of by amount of pages. They also must have at least one page and a negative amount of pages will cause the game to crash.
Bts only use a single item, they are actively used and use my bullshit ability A014.
The final thing you need to do with them is define a CReq for it. A Creq is a custom requirement. This is a function that is run when you try to add an item to the bag. You are given these three event calls:
- item BT_Bag()
- unit BT_Hero()
- item BT_Item()
Basically BT_Bag is the bag, the BT_Hero is the unit who owns the bag, and BT_Item is the item that you are trying to add. I have no idea what the hell you would want to do with this but some people asked for it and I don't know. So let say our bag item is I00G. We'd like to give an inventory size of 12. And we'd like to use this awesome requirement of not letting you shove other bags in it:

function Creq_notBag takes nothing returns boolean
	return not IsItemBT( BT_Item() )
endfunction

Anyway heres how you would define this BT:

	call CreateBT('I00G',12,Condition(function Creq_notBag))


One note about BTs: THEY CANNOT BE PITEMS OR EITEMS OR NOITEMS. It would screw up alot of things if you tried pulling that bullshit off theres alot of overlap in interaction and it will cuase all sorts of glitchery.

I'm not going to do a reply for Pitems mainly because they're isn't much about them.
Pitems are retardedly simplified eitems if you haven't noticed. They have no functions except thier constructor. They are built in the ojbect editor like thier Eitem brethen. They are ancestors of the eitems.
There only field that you should ever define is this one if let say our PItem part was I00J and our Pickup part was I00K it would be:

	call CreatePItem('I00J','I00K')
Next up is this annoying question people keep asking on how to enable more inventory slots, when they are already there and you just don't know it.
Here are some quick things to note:
NoItems are NOT EITEMS. They are NOT PITEMS. They are NoItems. You can only define one NOITEM per slot. However, you can reuse the same no item for all five fields. They ONLY can use the priorty field. They also must have the highest priorty of thier type. For example all items of slot 2 may range let say from priorty of 3 to 74, a no item of slot 2 must therefore have a priorty of 75. There maybe items that have higher priorties, but they are not slot 2 items.

Well a noitem in the object editor should resemble an eitem part of an eitem. And somewhere in the map tell it that the pitem has some astronomic priorty. Anyway, after all that you have to go to the header of the map. The header of the map is the triggerbody you get when you click on the map name in the trigger editor. Look for this function:

function IDNoItem takes integer i returns integer
	if(i==2)then
		return 'I007'
	elseif(i==3)then
		return 'I00A' 
	else 
		return 'I00B'
	endif
endfunction

Let say we want to add that the first slot was helmets. So we would make a Helments no item let say its item raw id is I00Q. So we would modify the function like so:

function IDNoItem takes integer i returns integer
	if(i==1)then
		return 'I00Q'
	elseif(i==2)then
		return 'I007'
	elseif(i==3)then
		return 'I00A' 
	else 
		return 'I00B'
	endif
endfunction

Okay so now we have our hunkey dorry helmet no item. Now lets configure our hero so that he can use helmets too!
What items that can be equiped on the hero are done by bitflagging. I didn't include a boolean version because I'm a horribly lazy person and really its not so bad you really should get use to bitflagging it makes my life easier.
Anyway, create a local var called hero and define it to the hero you want to use your new helmet type, I don't really care how you do this.
anyway the code would look as follows if you just want to let the dude use helmets.

call CreateHero(hero)
call Hero_enableEquip(hero,1)

The first function assigns some values and sets up some memory for our hero. The next one assigns some more variables creates some more vectors and does some real messy work. It also sets what items the hero can and cannot use with the second field.
Of course it would be silly to define 3 other types and not let our hero use them. So we can just do this
add 28 to allow for him to use every item but the second slot field which isn't defined.

call Hero_enableEquip(hero,29)

Remember to only create the hero once. Doing so more than once may really screw somethings up.

Now ofcourse you must actually design real Eitems that use this slot designation or else you will enjoy that nice noitem for a very long time.
I couldn't get the code to work before but here goes again.
* Star means required fields. This ONLY for Eitem definations.
An Eitem is made up of two parts as I've said before. In my map the Eitem part are in Artifacts. Basically you need to make sure the items has my fake ability A014 and that it is actively used. If you get real lazy just copy and paste...its what I do.
The next part is called the Pickup it iz found in Pickups in my map. Basically you need to make sure its auto-consumed upon pickup. If you get lazy...

Next on the Agenda you have to get the Raw Code for an item it is ussually in this form Letter followed by some numbers. Let say our Eitem is I000. you want to get this value and store it in a local variable called id. The statement should look as follows
*

set id='I007'

*
Now the next thing you want to do is find the itemtype of your Pickup version. Let us say that I001 is our Pickup version. This below step is the most important step to the process.
*

call CreateEItem(id,'I001') 

Now this step initialize many variables creates vectors and sets up associations. Thankfully, this step does this for you so you don't have to do it yourself.

Next on the list is the slot configuration. This specify what slot the item will be able to be equiped in. You have up to five slots you can equip items in. There are two ways to do it. Bitflags in my opinion is the best way to do it . Basically you can compose any counting number by a unqiue combination of the powers of two. Thus each slot is a power of 2. 0-4. i.e. 1 2 4 8 16. Let say we want to make our item equippable in slots 1 3 5. The bitflag sum is 21.
*
 
call EItem_setSlotsByBitFlag(id, 21)

*
But some people aren't up to it. And I included an alternate method by booleans. Either or but not both.
*
 
call EItem_setSlots(id, true, false, true, false,true)

*
Next on the list is an extremely important step that can crash the game if not done. Basically its actually two real steps, but you can just combine it into one. You have to make a requirement. Now we want to ignore so we'll just blank those fields.
So we'll create a local string called s.
*

set s=CreateReq(0,0,0,0,0)

These fields are actually fairly useful. They are classes, level,str,agi,int. Classes are a system of boolean which can be basically used to make sure only a certain unit type uses it. Level,str,agi,int those should be fairly. Next you need to tell your eitem to use this requirement so the operation should look as follows.
*
 
call EItem_setReq(id,s)

*
You can inline the two steps and ignore assingning the requirement to that local string.

Below is priorty. This is basically a value of how good an item is. The lower this value, the better the item is. This is the value that is used by one-click equip to distinguish which slot to replace with, and it is how the list is sorted. There is also another thing you must note the NoItems should have the highest values. If they are items that have higher priorty they will never be displayed in this list. Let say are item is mediocre. Are NoItem range is 50. So we'll use the value 25.
+

call EItem_setPriorty(id,25) 

+

The next step is Ability assignment. This is one of the many effects Eitems can have. Like the steps before it you have to go to the object editor and press control-d and find the ability you want to add to the item. Let us say that we would like to give our eitem the ability A000. We also must specify what level of the ability we would like to add. For our purposes let say we'd like to add just 1 level. But you can add as many as you levels as you want.

 
call EItem_addAbility(id,'A000' ,1) 


The three fields are as follows: The Eitem to modify, the ability to add, and the amount of levels. Also you can add as many ability as you would like. So you can repeat this step as many times as you would like. This step is not required.

Next up is BonusMod fields. BonusMod is an incorpated ability system that basically allows a large range of values of non-trigger mutable fields for very minmal amount of abilities. The included version with the DT4a system includes Attack, armor,max hp,max mp. This version uses 11 ability per each stat to obtain a range of [-1024,1023] in total 2048 possible combinations. It works again on the system of bitflagging. Let say we'd like our item to add 10 attack 1 armor 75 hp and 25 mana. we would call

call EItem_setBonuses(id,10,1,75,25) 

The fields of this function are the id of the eitem, change to attack, change to armor, change to hp, change to mana.

The next three fields are the three trigger mutable stats Strength, Agility and Intelligence. Let say our item will add 1 of each.

call EItem_setStats(id,1,1,1) 

The fields this time are id of the eitem, change to str,change to agi,change int.

Next on the list is my new tech demo put to good use. DBMod! To use DBMod you must add my DBModd ability called Fighting Profiecies or something stupid like that. Now basically DBMod lets you view Evasion, Critical Strike multiplier, and Critical strike rate as upgradable fields. Now you can modify DBMod to your own liking but in the DBmod tech demo map I wrote a nice report on what you should do to max out your dbmod's precious 100 ability range. This version allows you to have 3 upgradable level per each stat and uses 64 levels of one ability. But let say we want to add 1 level of evasion 2 of Critical strike multiplayer and three of critical strike rate. So our input would look like this

call EItem_setDBM(id,1,2,3) 

The fields are the itemtype of the item, the level of evasion inc, the level of Cs multiplayer inc, and the levels of cs rate inc.


Next on the list is special effect this is probably the field that will get the least milage. But you can attach a model if your so inclined. Let say you want to add your importated model which you added to the base directory "myModel.mdl" and would like to attach it to "head". The step would look like this:

call EItem_setFX(id,"myModel.mdl","head") 

The fields are item type, the models path, and the attachment point.

Those are all the fields of the eitem that I can think of that you'd possibly want to use. There are plenty more fields but I don't know how you'd use this in game or the safety of doing so.
Yeah, well I have been using 1.17 as the patches never quite install properly, I was having trouble duplicating it aswell, but I've finally found out how, What I did was, I put one Eitem on, and a Pitem of the same type in my inventory, or backpack, I left click the Pitem as if I were equiping it, and then, when you attempt to Drag and Drop the Eitem, it causes the bug, either way I'll use this in my map because it's so good anyway, just thought I'd let you know to find an Easy solution.
Plus you have no other Versions posted :P



I'm having a REALLY hard time understanding the JASS, is it possible that you could Simplify on how to create new items for this Mod, How do add Swords, where to find them, how to add Shields, where to find them, Accessories, where to find them, and how to add a new Equipment slot for say.. Helmets and Armor, and have them add Attachment files, by reading what you've typed several several SEVERAL times, it still doesn't teach a noob at JASS how to add the Items, you've posted what the Code is, but haven't told us What to add into a specific Part of the Code so we could edit the field values, and as it stands, only people that know JASS at all have a chance of understanding this stuff, please make a tutorial on how to add Equipment slots (i.e. Armor etc.) how to add Pitems and Eitems to go into a certain equipment spots (i.e. Sword slot, Armor slot,~etc.) how to edit Model Attachments for the Specific Items and where to find the places you need to search (i.e. Trigger Name) Put in the spot that needs to be edited in all of the Field Values in BOLD You don't understand the Frustration, and dissapointment of trying to do stuff, but dont know JASS and have all of these Great ideas I would like to use this for, but you guys keep typing in JASS with me having no idea what your talking about and I think many many many more people will enjoy this as much as I do, thanks, and sorry for the Inconvenience, but I really want to use this amazing system in my RPG, but have no clue at all on how to add Items, or Equipment slots ~etc.
Since you're such a genious, I have no doubt that you could add a Tutorial in Forums section and update this, please, I beg of you.
You can have multiple heroes for the same (or other) player you just have to define them. There is hero defination shown in the map in the TEST section.

I think trying to give items to non-heroes types was never fully worked out. Unfortuantly, I really don't have the time to work on this project any more and this is regretfully the last release for a long time.

The duplication is not really duplication. Pitems and Eitems work as dual nodes. Whats happening is that for whatever reason the EItems isn't listening to the command to hide itself. You created a situation where the code expects it to be inventory. I imagine its a pretty inconsistent case as I can't duplicate it at the moment.
This could be 1.18s fualt as I haven't updated.

For 2 and 3 I think you can easily fix it by just defining each and every unit with an inventory. For the first one i have no idea. Just try to avoid using that method of inventorying Or use an older release of DT4a one without pitems but 100% stable eitems. I'd say there still a very small bit buggy (hence alpha)
Found a few MAJOR bugs,
1)Duplicating... What I did was Click on my inventory ability, and when I had an item equiped, I right clicked, drag and dropped it to a random spot, it created 1 item where i dropped it, and one where i was standing..
2) Giving an item equiped to your hero to another unit controlled by you, will result in a fatal error, of I think the item passing between both units so fast it causes the game to Desync.
3) If you have 2 or more of the Same hero by the same player, one is not considered a Hero, thus cannot pick up Swords or what not, but if you put a sword into a Backpack Item, and give it to the Non-hero unit, then u click on the backpack, you have the Item you could not pick up, and if u Left click it (To equip) it will also cause the game to Desync by an Error, please fix these..
I only wrote these, not so people could abuse it, but so you could fix it, and I assume you can, I should also mention, this is the most amazing genious system I have EVER seen on the Warcraft 3 Engine, it breaks the limits completely, I would never ever work up the patience to get close to making something near mediocre to this, The Bag was genius, the--- EVERYTHING! I am a big fan of your work, and I beleive this is the Best spell System ever submitted to this site, Great Job, and a well deserved 5/5 for your talent and smarts to create something like this...
I only wish it was easier to merge, I would love to use this, but the JASS is way to complex for me, and coded so long I lose myself! I may just Start the RPG over and use this map as the base, but adding items would be frustrating to add to the code.
Also, does this work for *ALL* players? Or only player 1 (red)?
i cant seem to get it to merge on to my map
i used we unlimited export/import abilitys and triggers and stuff if thats what you meant by merge
help?
Nice 5/5 :)
Last edited by God in 2006
I use worldedit unlimited ability merge thing its really the only way to add bonus mod without going crazy.
ok i experimented some now how exactly do i merge this with my map :oops:
All the code for them is found in the Test category. Probably Test DT4a
The PItem creation is found in the bag trigger.
Its just
call CreatePItem('I007','phea') or whatever. Remember the second one is the fake item.
"call CreatePItem(ItemTypeId of Pitem,ItemTypeId of Pickup) "

if the item was IOOL:phea (potion of healing)
it would be

call CreatePItem(ItemTypeId of Pitem,IOOL:phea of Pickup)

im probably rong thnx for the help in advance

P.S. where is the code for your Eitems
DT4a/D+D is extremely customizable.

BTs are very easy to design. You need to create an Item with the ability Inventory do nothing ('A014' in my demo map).
From there you basically have to at map init add the following line of code.
call CreateBT(ItemTypeId of Bag,Number of Slots,Condition( conditional function ) )

Where itemTypeId is the raw code value in single quotes of the item. (Press control-d in the object editor)
Number of Slots is a multiple of 4 which is the length of the bag
And Conditional Function is a Boolean returning function that is the custom condition of adding items to the bag.
In the custom condition the following three Event values are given to you:::

 - item BT_Bag()
 - unit BT_Hero()
 - item BT_Item()

Where BT_Bag is the bag that the item is trying to enter
Hero is the hero that owns the bag (Note this can be gotten by simply going Bag_getHero(BT_Bag() ))
And Item is the item trying to be added.
I'm not really sure what conditions you may want, but I give a general example in my map of Container Types only allowed to be one level deep. (just on the Hero, not inside other bags)
If you do not want to use a condition you should create a function that simply returns true like I did.

As far as PItems. They are a rather simple code wise, but kind of annoying object editing wise. You'll need to create a dummy item that is consumed on pickup which has the fields identical to that of the real item you want except it should only have my dummy ability "Inventory Do Nothing" ('A014' in my demo map). Anyway, you also need the real item. We'll call the dummy item "Pickup" and we will call the real item version (the one that actually has the ability yoy want the item to have) "Pitem". So when you are ready in a trigger that runs at map init add the following line of code:
call CreatePItem(ItemTypeId of Pitem,ItemTypeId of Pickup)
Where itemtype id is the raw value of the item.

Eitems themselves are just more complicated Pitems. So instead of the "Pitem" actually having the abilities you want you should just make it have only the ability "Inventory Do Nothing" ('A014') The Eitem must also be actively used and cannot be passive.
From here in a trigger that runs at map init add the following lines. Note it is heavily suggested you declare a local variable called id like I did.

*set id=ItemTypeId of EItem.
*call CreateEItem(id,Item TypeId of Pickup)
call EItem_addAbility(id,AbilityTypeId ,Levels)
    ... (this step can be repeated for each ability you want to add)
*[b]call EItem_setSlotsByBitFlag(id, BitFlag of slot)[/b]
or 
[b]call EItem_setSlots(id, Use Slot 1?, Use Slot 2?, Use Slot 3?, Use Slot 4?,Use Slot slot 5?)[/b]
call EItem_setBonuses(id,attack inc,armor inc,max hp inc,max mp inc)
call EItem_setStats(id,str inc,agi inc,int inc)
*call EItem_setReq(id, CreateReq(class,level,str,agi,int  )
call EItem_setDBM(id,Level of Evas inc,Level of CS multiplier increase,Level of CS rate increase)
+call EItem_setPriorty(id,Priorty)
call EItem_setFX(id,"Model Path","attachment point")


Most of those fields are self obvious. But Anyway to my knowledge only the STARRED fields are required for an Eitem to work. Of course without some of the fields its kind of pointless to use my system. Priorty can actually be left blanked and assumed as zero, but for it to function properly you should enter a NON-Negative value. Zero by my system is considered the BEST class of items. NoItems should have the highest Priorty numbers. Any item that is passed a No Item of that slot designation is completely ignored by my code. Negative numbers are error cases and can potentially screw things up.

Reqs can be reused by other Eitems. As shown in my Demo map with the heavy use of my noreq req value.

If you use the model field you must input both a model and an attachment point. If you use a space in the model field it will probably cuase warcraft III to crash. Worldeditor will crash if you only use single \ in the string for models. THe attachment field can have spaces and uses the standard attachment locations like "weapon" and "overhead"
I like the ByBitFlag version of SetSlots because you can make convience constants of say, ACCESSORY being =3 meaning slots 1 and 2.
Here is some more junk and information:
There are three systems of equipping. Manual (old style), One Click-Equip, and Auto-Equip.

Manual Equip is accessed by opening the inventory menu, and clicking on the item currently in the slot that you want to switch items with. You will then be presented a list of items that can fit in that slot in decending order of priorty. (i.e. best items are on page 1...worst on Page N where N is the amount of pages of items able to be equiped.) This does have the advantage of letting you view multiple items that can be equipped at a time and lets you make a decision of chosing which to equip.

One-Click-Equip is new to Alpha 4. One-Click-Equip allows you to equip items by clicking on them when they appear in your inventory. This will find out what slots it can fit in, and if it can have be equipped in multiple slots, will equip itself in the slot of the item with the worst priorty. (No Item over any other item)

Finally, Auto-Equip, is my LEAST favorite method of equipping items and is probably the most useless. But, if you pick up an item and you happen to have a No Item in the slot that it is equipped in, it will try to equip itself in that slot.
Please Release a more customizable version. Where people can easily create new BTs. Also, how do I define whether an item is an EItem or a PItem?
I think you can remove spells in the add / update resource thing, well I am going to delete it anyways.

This is the first time I check the web since the post in that thread you made asking for the 'mega help' so comments on the new stuff which sounds really good will come later.

There are still two disabled slots in the demo. You can enable them. Meaning you can have a total of five different tpyes of items. Items thankfully, can be equipped in multiple slots so if you want two accessory slots slot 1 and 2 lets say you can make the EItem use slot 1 and 2. you also will need to change the NoItem definations.

I'm going to have composite the triggers again. So Atr will make a comeback. Depending on how hard it is I may re-add the spellbook. I should have a demo RPG soon.
Awesome work! :twisted:
But could you please do at least one additional slot for a helmet or a second accessory ?

Keep up the good work! :wink:
Vexorian can you remove alpha 3? Anyway here is a huge introductory text in case you need it:
DT4a A4 is trying to be the end all be all RPG engine when it comes to item related nonsense.
The script engine allows you to equip items directly forgoeing the requirement of the item being physically in the inventory.

The RPG engine uses custom data types including:
BTs-- Bag Types
Bag types allow you to create specification for containers. A container allows for more storage of items.

PItems-- Pick Up Anytime Items
Pick up any time items, are special item types that when you pick them up they will try to enter any storage medium avaliable to them one level deep. Meaning that if you have 5 items and a bag, and you pick up a PItem it will enter your bag.

EItem -- Equipment Items
Special Types of Pitems. They can be directly equiped to the unit, forgoeing the requirement of having to be in the units inventory to use. Eitem when you have nothing equiped in a slot they can fit in, will equip to that slot. Eitems can also be equipped by clicking on them, or by going through the equipment menu. EItems can have the following:
Bonus Modification (damage,armor,mana,hp)
Attribute modification (str,agi,int)
DB Modification (evasion, critical strike damage, critical strike multiplier)
Attaching models
Ability Modification (can add many abilities and modify the level of currently owned abilities)

Requirement fields (on custom class, level,str,agi,int)

Hero- ...Hero
A specially designed unit that is an interface for my RPG engine. It is allowed to use bags Pitems Eitems etc.

Well there you go, now download and tell me what you think.