HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Drag and Drop+=2, has reached the next beta (you got served in the process too).

06-30-2004, 01:50 PM#1
weaaddar
If you enjoyed my other wacky betas...you'll probably enjoy drag and drop+=2 doing exactly the samething as drag and drop++ but with much easier to read code and a 2 kb drop in size Wow a whole 2 kb.
Code:
Features include:

--Bag Object
 -Drags items to store.
 -Drag item to cancel to remove from bag
 -Each bag length is customizable (default==12)

--SpellBook object
 -Click a spell to add it to your command card
 -Drag a spell to cancel to remove it.
 -Spellbook size is unlimited*! 
 -Easy to add new spells to in real game time!
--Spell dictionary entry
 -An entry which contain the static info about a spell (i.e. its ability, its buff its cooldown)
 -Makes adding the same spell to multiple books easy

--Req dictionary entry
 -Contains a requirement list that the hero can pass or fail. 
 -Test on custom class,level,str,agi,int
--Scroll dictionary entry
 -An item that when consumed will add a spell to the spellbook
 -Can have a req
 -Can also have a custom special effect

--Hero Object
 -Interaction object in the object layer.
 -Can manually attribute stats if it has a postive number of stats.
 -Can have as many custom classes as you see fit.
 -Can use a bag, and spellbook and scroll.
The most important change code wise:
all methods are now Class_methodName()
all hero methods take a hero instead of a herostr
all bag methods take a bag instead of a bps
Spellbooks now take take spells instead of spellitem,ability,buff,cooldwon
Reqs are no longer part of scrolls.
A lot of worthless methods were removed and code was cleaned up.



NOTE:
There is a bug in 1.16 beta:
http://www.battle.net/forums/war3/th...t=0#post135970

THe map also displays debug messages because...i'm lazy.


*(limited to gamecache size)
Use this version of the map:
http://weaaddar.wc3campaigns.com/bag3a.w3x
06-30-2004, 07:50 PM#2
sweet5
OMG that is the first version of drag drop I tried and OMG its so fun :D ^_^ :> !!! but I have a question, I can read a lil JASS and do a few things like make text appear but thats it :\ :( . So I wanted to know if it is possible to do that thing with the arrow in the corner of the inventory with gui or if its was just like, u cleard the inventory then with a varible that was keeping track of items but in the ones for the 2nd page, or w/e just tell me how u did it plzzzzzzzz :D
06-30-2004, 07:53 PM#3
Draco
Nice, even better than the last... didn't think that was possible. :D
06-30-2004, 10:04 PM#4
weaaddar
Since I assume you mean with the backpack its actually a very interesting situation.

I using gamecache to attach an array of item ids and charges to the backpack itself. And two more variables of importance the page, and a static final value called length.

The bag on the other hand is itself an object that is stored on the hero. The heroes method Hero_nextBagPage is called when you click on the next page icon. What it does is increment page by one, if page minus one times four exeeds the length of the bag then it sets the page back to one, if the item located at page minus times fire slot is non existant, then it sets page to one.
It then will "print" the items located between page-1*4 and page*4-1, giving you four items. It then adds a next page icon with the charge being the current page number, and a cancel button.
I don't really know how hard that would be in gui, I can pretty much garuntee the object layer and even the object oriented approach is almost definetly out of the question due to very nature of being restricted to global variables. Plus without functions it'll become quite obnoxious and repetitive code. So I say use Drag and Drop+=2! Did I mention that the bag is an automatically made object? No? Well it is! Its generated as neccessary.
06-30-2004, 10:15 PM#5
sweet5
ok, well most of that made no sense to me o_O umm...so how about...

what if in GUI I had the back pack item and all that with a varible for the main inventory and 4 others for each page of the bag. with 6 for the main and 4 for the bag pages then every time the page or next button was clicked I'd clear the inventory and display the items in the right varible. But what I dont really know how to do is how to add the items to the varible I have an idea, just havent put much thought into it, but Im sure it could be done like this. Or maybe I could use game cache tho Im not sure how it works :\ , maybe u could give me a quick explination? ^_^ and feedback on if you think my idea will work :D . I think it should!
07-01-2004, 12:05 AM#6
sweet5
weaaddar, I was looking at ur system some more and found three bugs, buffs dont stay when u put items in pack, u cant see page 3 VERY BIG problem and uhh... dammit lol... OH, when u drop back, it says resets items in it BUT when another hero picks it up it still says theres 12 and then when u add more items it continues from 12 to 24 then if u drop and pick up again goes to 36 after full again so u should fix thoes
07-01-2004, 12:28 AM#7
weaaddar
The debug msg should be ignored, its just was for me to see what was wrong with a different problem. Its setting the bag variable on the hero to null that all it means.
The bag should retain whatever items it has on transfer to the demon hunter or paladin. In my test it seems it does. I can't get the item count to go higher then 12.
EDIT Your right here too. I forgot a NOT before a statement. Seems it was always making a bag when it didn't need to be. Alright thats fixed.

The buffs is a known issue since version 1. And its one that can't be fixed and I have no intention of even bothering trying to fix it.

Good catch on the not displaying page 3. I'm looking into that one.
Edit: Fixed too, i'll remove all debug messages and upload it.

http://weaaddar.wc3campaigns.com/bag3a.w3x

IF you catch any more bugs please make sure your using this 3a version and tell me about it too.
07-01-2004, 12:35 AM#8
sweet5
what about my other post b4 the one u answered?

ok, well I dunno but I think I heard of a way to detect duffs b4 so why not just dectect buff and add it to bag?

when I switch the bag from one hero to the next it clears item but item # doesnt clear and it keeps adding till 24 then switch again and it'll add it 36 and so on. So just reset the charges when bag is dropped plz.

yeah, I was like...what the..why cant I see 3rd page???


thx
07-01-2004, 12:42 AM#9
weaaddar
You can't detect non-specific buffs, you can detect buffs that you know the id of (ie. if the unit is under the effect of devine shield), however the buff isn't the problem. The buff on its own does nothing. The buff is merely a graphical display to show the effect.

As far as your other post, I already gave a suggestion to that point, use D+D+=2, its much easier then trying to write your own. (it does everything behind the scenes)

I already tought a class on the usage of gamecache (as well as many other things) log file for it could probably be found somewhere.

You can't store 4 items on one variable. You can store them in an array. However, having a global array per backpack is hardly practical as you'll need that many arrays for that many backpacks. Plus you'll need some referencing system. My system is very clever it uses the backpack itself as its reference identifier. Meaning you just need to pass it the bag and it'll find information about itself.
07-01-2004, 12:49 AM#10
sweet5
Ok...well as for buffs, I meant cant u just detect buff and then add that ability to the bag item? So if somone has the item that gives unholy(not sure what its called...helm of somthing) then u detect that it has that buff and add that ability...or maybe u can dectect abilities? w/e I'll try it, u dont seem to into helping noobs like me, but u are one great triggerer, :D .

Ok, I'll just try my system then, already have it started works so far, only main inventory tho. And I do have array.

Otherwise GREAT job
07-01-2004, 12:56 AM#11
weaaddar
Quote:
Originally Posted by sweet5
Ok...well as for buffs, I meant cant u just detect buff and then add that ability to the bag item? So if somone has the item that gives unholy(not sure what its called...helm of somthing) then u detect that it has that buff and add that ability...or maybe u can dectect abilities? w/e I'll try it, u dont seem to into helping noobs like me, but u are one great triggerer, :D .

Ok, I'll just try my system then, already have it started works so far, only main inventory tho. And I do have array.

Otherwise GREAT job

I would have to store every buff giving item and its buff giving ability. Its such an obnoxious process that I for one would not want to do it. I don't think guys with 100s of custom items would like it easier. Remember that this is a supplement to DT4a even though the two are completely incompatible systems (at the moment). Your really suppose to be using my Equipable Items for your items with permanant bonuses.
07-01-2004, 01:00 AM#12
sweet5
j/w, whats DT4a?
07-01-2004, 01:03 AM#13
weaaddar
click the hyper linked damn in my signature to check out DT4a my now deprecated in style RPG engine.
08-24-2004, 06:54 PM#14
Switch33
There is 1 glitch after updating i noticed in the first version when you dropped the item with a trigger it was fine and u could pick it up again but... on the 3rd one you cannot! This is annoying and it is the reason i didn't upgrade the bag to the 2nd version but it uses items so u can give a description and the spellbook is not in it which is good because i don't need the spellbook. Great ideas though!
08-24-2004, 07:13 PM#15
weaaddar
I don't have a clue as to what you mean. Can you please explain in detail what you are saying?