• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

item system request (recipies and owner of item)

Status
Not open for further replies.
Level 17
Joined
Apr 3, 2010
Messages
1,101
Its also for Gui users and contains many GUI functions new to WE and also uses some natives instead of B.j So basically its an advanced Gui system bundled in with the Tileset map size and Doodad maximum expansion. Its not just limited to Vjass n jass users

Anyhow the system is this ...


Triggers

Hastable 6 item recipes
Hastable 5 item recipes
Hastable 4 item recipes
Hastable 3 item recipes
Hastable 2 item recipes
Hastable 1 item recipes

Hastable 6 item recipes
-Time-Elapsed game time is 0.01

Actions Hashtable - Create a Hashtable
Set Hashtablearray[0] = Last created hashtable

Hashtable - Save Itemrecipe1 as 0 of 0 in Hashtablearray[0]
Hashtable - Save item1req as 0 of 1 in Hashtablearray[0]
Hashtable - Save item2req as 0 of 2 in Hashtablearray[0]
Hashtable - Save item3req as 0 of 3 in Hashtablearray[0]
Hashtable - Save item4req as 0 of 4 in Hashtablearray[0]
Hashtable - Save item5req as 0 of 5 in Hashtablearray[0]
Hashtable - Save item6req as 0 of 6 in Hashtablearray[0]
Hashtable - Save Itemcreated as 0 of 7 in Hashtablearray[0]

Hashtable Item recipe for 5 items

Copy but use Hashtable[1] And omit Item req 6

Hashtable Item recipe for 4 items Copy and omit Itemreq4

etc etc


Alternatively you can put these all into 1 trigger. This would be better and use A Comment to seperate each recipe and A Tripple comment for each Type -- 6 5 4 3 2 and 1 Item amount for recipe.
Just for neatness and readabillity

Item creation trigger:

Unit - A unit uses an item (All Recipes should be tomes)

Condition: Item class of item being manipulated equal to powerup

Action: Comment: Resetting Checks

Do Mutiple actions for each integer A from 0 to 5 do actioins
Set item check onof Integer A = False

Do mutiple action for each integer A from 0 -7
Set count Integer A = 0

Set itemcheckcount=0

Comment: To Decide which hashtable to use and to set recipe and creation

Comment: ------------------------------------------------------------

Do mutiple actions for each integer A 0 to 10
If Item being manipulated Equal to Load integer A of 0 in hashtable array 0

Set count 0 - integer A
Set Count 1 = 0
Set itemarray 0 = Load integer A of 7 in Hashtable[0]

Repeat for each Hashtabe so

Do mutiple actions for each integer A 0 to 10
If Item being manipulated Equal to Load integer A of 0 in hashtable array 1

Set count 0 - integer A
Set Count 1 = 0
Set itemarray 0 = Load integer A of 7 in Hashtable[1]



Comment: After repeats for setting the item amount in Recipe Do

Comment: Core loops

Do mutiple Action for each integer a From 1 to 6
Set itemarray[Integer A] = Item carried by triggering unit in slot integer A

Do Action for each Integer A from 1 - 6

IF itemcheckonof[0] = flase
And Itemarray Integer A Equal Load count 0 of 1 in hashtable array Count 0

Then Set itemcheckcount = itemcheckcount+1
Set itemcheckonof = true
Set count 2 = integer A

Else Do nothing

Repeat this function for each Point so

Change -- Load count 0 of 1 hashtablearray count - to load count 0 of 2

change Itemcheckonof [0] tp [1]
and Count[2] -[3]

Then the next would be

of 3
[2]
[4]

Etc

Do this all the way up to 6 so this checks for each item in inven fi it is there

Comment: Now to check item count is = and if so remove each item as it is picked

If Itemcheckcount = 6-Count[1]

Then Do Mutiple actions for each integer a from 2-7

If Count integer A greater than 0

Then Item remove Item carried by triggering unit in slot Count integer A

Else Do nothing


-----Now to create item000----

Add the item type Load count[0] of 7 hashtablearray [count 1] to pool and give it a chance 100% to be chosen

Give triggering unit a get random item from item pool in slot 1

Reset your own pool for random items

----End----



Trigger comments

Item creation:

Tomes=powerups
If no recipe made money is returned

Recipes cant be carried but may be bought with full inventory.

Configure the loop number with how many recipes you have :p

This is not MUI :p i dont think.

Also i think slot 1 contain one of the binding items or be free im not sure if wc3. Checks it automatically and puts into nearest slot


To create mui make every variable shown a seperate variable with an array of 11 and Do PIckedplayer owner of trigger unit -1
:p
As at the moment it uses arrays :O


trigger comments for Hashtable:

You will want to change the string saves to Item handle saves. You can do this by creating the item then removing it. Or by picking items in a region ^^. Im not sure how else.

Or string
 
Last edited:
Level 17
Joined
Apr 3, 2010
Messages
1,101
Lazy

Im pretty sure now from the variety and amount of systems given that this thread will be ignored as there are many recipes system but your just too lazy to use any of them or they dont fit your "specific requirements" if you know Gui create one of your own/ otherwise there are many Only had to search in spell section to find 4 system. So in total including the ones in this thread there are 7 different system offered to you. Yet you refuse all of them. And yet you down give a real basis to why--Basically what im trying to say is Spam bumping isn't gonna help

http://www.hiveworkshop.com/forums/spells.php?search=Item recipe&d=list&r=20
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
none of the current systems work with a full inventory.
also ur saying lazy..... of course id do it my self if i knew how to systems just arnt my thing.

also bumping is better then letting this thread fall fakll fall so no one sees it why else would i bump it?
 
Level 15
Joined
Oct 18, 2008
Messages
1,588
dude, use a mercenary shop instead of an item shop for recipes, and use a trigger which checks for those specific dummy units (1 dummy recipe unit for every recipe) then check if he has the items, if yes then remove them and give him the new item. Bravo, you have done a new recipe system :D I don't think it's too hard to make, you only need a base knowledge of triggers to make it work. I'd gladly make it for you but I'm far away from my own computer so I can't help any more than this.
 
Level 17
Joined
Apr 3, 2010
Messages
1,101
You dont need a merc you can just use a tome system as its more itemwise then. Although tomes can leak you remove them when aquired :p before usage.
OR save them as a variable then remove them :p

He already has a few systems which do exactly what he wants. He just wont use them due to lazyness


And actually Milzy mine works with full inventory and im sure its not the only one. Alos Nestharus detection system is quite helpfull for getting an item instead of the tome method
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
wouldent i use some kind of system like this to give real items instead of the tomes

  • event
  • map int
  • condition
  • actions
  • set real item[1] = boots
  • set real item[2] = sword
  • set real item[3] = shied
  • set tome item[1] = boots(tome)
  • set time item[2] = sword (tome)
  • set tome item[3] = shield(tome)
  • event
  • unit buys a item
  • condition
  • actions
  • for each integer A do actions 1 to 3
  • if
  • item being bought is = to tome item[integer A]
  • then
  • give item Real item[integer A]
 
Level 17
Joined
Apr 3, 2010
Messages
1,101
No you would use a hashtable. It can be done as part of teh recipe system.

Just replace the part of my system which says give refund to give item recipe
 
Level 15
Joined
Oct 18, 2008
Messages
1,588
hashtables doesn't need JNGP, as I'm not using it because it takes too much effort to make my map work on a non-JNGP WC3, and I could solve ANYTHING so far that I wanted to IN GUI sometimes with some lines of custom script... And I must admit that map is still working :goblin_yeah:

But dude if you can't make a so simple system by yourself, don't expect anyone to do it for you, since most likely you would never finish your map :p Learn advanced GUI triggering, then if you're done with that and you still want to make your map, we can talk...
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
if its such a simple system why am i still after the system when the thread was made weeks ago and the only person that seems to be helping is bramble

no shit hashtables dont need jngp but his using some other trigger that does

i do know some advanced gui triggering just systems arnt my thing
 
Level 17
Joined
Apr 3, 2010
Messages
1,101
No matter what triggers you use you can transfer directly from JNGP to WE due to the JNGP improving gui triggers by ref natives whenever possible instead of bjs. Or something like that. They made it more efficiant. IF no one makes it cause they cant be asked. Milzy if you want you can just make it your self i even provided a list of what the system is like all you have do is in put it in :p
 
Level 15
Joined
Oct 18, 2008
Messages
1,588
No matter what triggers you use you can transfer directly from JNGP to WE due to the JNGP improving gui triggers by ref natives whenever possible instead of bjs. Or something like that. They made it more efficiant. IF no one makes it cause they cant be asked. Milzy if you want you can just make it your self i even provided a list of what the system is like all you have do is in put it in :p

I said the same with different words :ogre_icwydt:
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
ok i downloaded jngp and i still cant open it??? wtf

ill try me self from what u posted b4 but im having trubble undeastanding what u posted for the hashtable set up

u need a hash table for each type of recipie like 1 that is when u need 2 items then 3 items 4 item 5 items ect????
 
Level 17
Joined
Apr 3, 2010
Messages
1,101
You have to open it via going onto NewgenWE then open file- Then pick the map> directly opening the map or going through standard WE wont work. Altertively right click and open with Newgenwe.

Hashtables

Yes you need a seperate hashtable for each Item amount for a recipe.

So you have a hashtable for all 6 item recipes
A hashtable for all 5 item recipes etc.
 
Level 17
Joined
Apr 3, 2010
Messages
1,101
Well WEU is part of the new gen pack . But no i use Newgen WE ;P probs the version difference ^^

Also if you did it via 1 hashtable you would have to set the points where a 6 item recipe meets with a 5 item recipe
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
Its also for Gui users and contains many GUI functions new to WE and also uses some natives instead of B.j So basically its an advanced Gui system bundled in with the Tileset map size and Doodad maximum expansion. Its not just limited to Vjass n jass users

Anyhow the system is this ...


Triggers

Hastable 6 item recipes
Hastable 5 item recipes
Hastable 4 item recipes
Hastable 3 item recipes
Hastable 2 item recipes
Hastable 1 item recipes

Hastable 6 item recipes
-Time-Elapsed game time is 0.01

Actions Hashtable - Create a Hashtable
Set Hashtablearray[0] = Last created hashtable

Hashtable - Save Itemrecipe1 as 0 of 0 in Hashtablearray[0]
Hashtable - Save item1req as 0 of 1 in Hashtablearray[0]
Hashtable - Save item2req as 0 of 2 in Hashtablearray[0]
Hashtable - Save item3req as 0 of 3 in Hashtablearray[0]
Hashtable - Save item4req as 0 of 4 in Hashtablearray[0]
Hashtable - Save item5req as 0 of 5 in Hashtablearray[0]
Hashtable - Save item6req as 0 of 6 in Hashtablearray[0]
Hashtable - Save Itemcreated as 0 of 7 in Hashtablearray[0]

Hashtable Item recipe for 5 items

Copy but use Hashtable[1] And omit Item req 6

Hashtable Item recipe for 4 items Copy and omit Itemreq4

etc etc


Alternatively you can put these all into 1 trigger. This would be better and use A Comment to seperate each recipe and A Tripple comment for each Type -- 6 5 4 3 2 and 1 Item amount for recipe.
Just for neatness and readabillity

Item creation trigger:

Unit - A unit uses an item (All Recipes should be tomes)

Condition: Item class of item being manipulated equal to powerup

Action: Comment: Resetting Checks

Do Mutiple actions for each integer A from 0 to 5 do actioins
Set item check onof Integer A = False

Do mutiple action for each integer A from 0 -7
Set count Integer A = 0

Set itemcheckcount=0

Comment: To Decide which hashtable to use and to set recipe and creation

Comment: ------------------------------------------------------------

Do mutiple actions for each integer A 0 to 10
If Item being manipulated Equal to Load integer A of 0 in hashtable array 0

Set count 0 - integer A
Set Count 1 = 0
Set itemarray 0 = Load integer A of 7 in Hashtable[0]

Repeat for each Hashtabe so

Do mutiple actions for each integer A 0 to 10
If Item being manipulated Equal to Load integer A of 0 in hashtable array 1

Set count 0 - integer A
Set Count 1 = 0
Set itemarray 0 = Load integer A of 7 in Hashtable[1]



Comment: After repeats for setting the item amount in Recipe Do

Comment: Core loops

Do mutiple Action for each integer a From 1 to 6
Set itemarray[Integer A] = Item carried by triggering unit in slot integer A

Do Action for each Integer A from 1 - 6

IF itemcheckonof[0] = flase
And Itemarray Integer A Equal Load count 0 of 1 in hashtable array Count 0

Then Set itemcheckcount = itemcheckcount+1
Set itemcheckonof = true
Set count 2 = integer A

Else Do nothing

Repeat this function for each Point so

Change -- Load count 0 of 1 hashtablearray count - to load count 0 of 2

change Itemcheckonof [0] tp [1]
and Count[2] -[3]

Then the next would be

of 3
[2]
[4]

Etc

Do this all the way up to 6 so this checks for each item in inven fi it is there

Comment: Now to check item count is = and if so remove each item as it is picked

If Itemcheckcount = 6-Count[1]

Then Do Mutiple actions for each integer a from 2-7

If Count integer A greater than 0

Then Item remove Item carried by triggering unit in slot Count integer A

Else Do nothing


-----Now to create item000----

Add the item type Load count[0] of 7 hashtablearray [count 1] to pool and give it a chance 100% to be chosen

Give triggering unit a get random item from item pool in slot 1

Reset your own pool for random items

----End----



Trigger comments

Item creation:

Tomes=powerups
If no recipe made money is returned

Recipes cant be carried but may be bought with full inventory.

Configure the loop number with how many recipes you have :p

This is not MUI :p i dont think.

Also i think slot 1 contain one of the binding items or be free im not sure if wc3. Checks it automatically and puts into nearest slot


To create mui make every variable shown a seperate variable with an array of 11 and Do PIckedplayer owner of trigger unit -1
:p
As at the moment it uses arrays :O


trigger comments for Hashtable:

You will want to change the string saves to Item handle saves. You can do this by creating the item then removing it. Or by picking items in a region ^^. Im not sure how else.

Or string

can u repost this with trigger tags i give up with the god dam newgen not working and im going to try my self


i realy dont get hashtables i know u save data in them in a table like

1 yyy zzz yyy zzz yyy zzz
2 yyy zzz yyy zzz yyy zzz
3 yyy zzz yyy zzz yyy zzz

ect

but when loading the values how do i know what one to load

also how to use so that if/then/else isent needed (i presume u can use them with out the if/then/else)
 
Level 17
Joined
Apr 3, 2010
Messages
1,101
Well basically you index function it. So what i did was go through a loop which selects each recipe untill the recipe bought or picked up is equal to that recipe type. This is like seeing a table. And looking down the column


Recipe ---- Req 1 Re2 etc

X X
Y Y
Z Z


So cycle through the X Y Z till Manipulated item = Recipe -- Then from that the row which it is u then load the row of data. Then Check that data to see if it matches the items carried. If they match then you add 1 to a count. IF all match then the count = x
So therefore it will then init the making of the recipe. Otherwise it will give a refund or give a recipe item.



If then else is required. Unless your gonan run each part in a seperate trigger which would be pointless
 
Level 17
Joined
Apr 3, 2010
Messages
1,101
My bad i was thinking WEU aws UMSWE

And you cant use a single hashtable without adding references. This will slow due to many == number checks instead i just check the recipe thourgh each one so it would be equal time if i was cyclic through a single hashtable. Also its better this way as its easier to add recipes and recipe lists into the system instead of having all 7 6-1 item recipes mixed up. As otherwise you would have to add an extra data slot to show / represent number for recipe.
 
huh? You don't need repetitive checks... Just loop the item recipe requirements from 1 to the number dictated by a saved value on the hashtable... it will save you data space if you just use one hashtable, and free up hashtable usage which can be used for other purposes (as hashes has a max number, its better if we can get away as much as we can...)
 
Level 17
Joined
Apr 3, 2010
Messages
1,101
You dont seem to undesrstand. Your thinking of the activation and checking of items part of it. Yes that is a single loop but for the actual matching of a recipe instead of spam if item = to etc. You use a single loop through each hashtable. And then check for items. Otherwise you need to add stop points which is very difficult to do and a waste of time. For where it changes from one point to another. To dictate each section.
Also these stop points would change with every edit of it. So its not user friendly.

Alternatively the more user friendly single hashtable idea would require the usage of an extra column to each row dicatating how many items are in that recipe. That would work better, but again not really much point to it if you can lay them out neater in seperate hashtables. Depends how you prefer it. -

This way you pointed out to be and i already said in my previous post if you read it ._.
And as i said although it may save data it also slightly slows it due to having to have an extra check.
 
Oh, the editor if UMSWE is activated... I never activated it before, but when I activated it, I was able to open your map, but other maps showed errors...

your method was inefficient as you needed to loop through all of the hashtable values of each hashtable just to get the data, when in fact you don't need a loop at all... You can always use the Item's rawcode as a parent key to the hashtable, saving you the need to use all those useless loops, and then just use one hashtable (you will also be able to get rid of those If-then-elses, you only need 1 if then inside a 1-6 loop for the checking of items)... Also, using several triggers to initiate all the hashtables just populates your map with useless triggers, as you can do it in just one trigger...

But anyway, I don't see the point in this anymore, Maggy created one cool and easy to use recipe system though its in vJASS (but very easy to use even for GUIers as the only edit you need is to register the item recipes via a very linear function), but since your map needs JNGP anyway, they might want to just use Maggy's resource...
 
Last edited:
Level 17
Joined
Apr 3, 2010
Messages
1,101
Yeh sorry about that it was meant to be a basic system not 100% efficiant. I guess that would be the better way. ^^ -Agreed this is rather pointless also i saw mag's :p its simple and good =D


On a side note isnt calling rawcode names of the item manipulated custom script--(jass)
 
Last edited:
Status
Not open for further replies.
Top