| 11-07-2003, 04:44 PM | #1 |
EDIT: Thanks to MidnightPaladin I found a bug! Please leave commentary. I forgot that this is not something many people have used before so here goes on what it does. Dialog Test III, and its older brother Dialog Test II are trigger "engines" which make easier certain hard to do functions. Dialog Test II enabled a dialog menu which popped up when you clicked the idle peon button to assign attribute points. And Dialog Test III assimilated IIs features, optimized them (Resistance is futile), and add a nifty backpack which allows storage of 5 items in a seamingly invisible inventory. It tought me jass it might be a nice addition to a single/multi player Rpg. Mostly optimizing, but bug fixes kick *** to. From the changelog: Code:
CHANGELOG DT 3.8a:
MAJOR BUG FIX
--I'm an idiot and accidently removed a required return statement!
Commentary:
--Many triggers now have comentary explaining themselves. And there is explanation for some of the cryptically
named variables.This should be very helpful for you new programmers to jass.
Bug and Graphical Fixes:
--the stat menu dialog will no longer pop up when you hit cancel on the bag when it is fully loaded.
--The bug with the item names in the bag not appearing, or appearing incorectly has been fixed.
--This bug was due to me accidently using the integer which held the players number value (i),
when I was supposed to be using the inventory slot value( bj_forLoopAIndex)
--No longer does a shadow trail your unit.
Optimization:
--The custom script area at the top of the map holds many oftenly used functions or functions
that are just plain really big and I didn't feel like commenting on as they could be a verbatim copy paste.
--This means there are not 4000 different version of the stat menu like earlier version of 3.
--Response has once again gotten a make over.
--Unfortuantly trigger comments suck so the explanation is here of whats been done marvel at this supershort
version of Dialog test ii (about 20 triggers shudders)
Code:
set bj_forLoopAIndex = 1
loop
exitwhen bj_forLoopAIndex>4
set bj_forLoopBIndex = 0
loop
exitwhen bj_forLoopBIndex==12
if ( GetClickedButtonBJ() == udg_db[Index(bj_forLoopBIndex,bj_forLoopAIndex)] and bj_randDistID[bj_forLoopAIndex] >= 1 and bj_forLoopBIndex<3) then
call ModifyHeroStat( bj_forLoopBIndex, bj_ghoul[bj_forLoopAIndex], 0, 1 )
set bj_randDistID[bj_forLoopAIndex]= ( bj_randDistID[bj_forLoopAIndex] - 1 )
call Main_Dialog_Show ( bj_forLoopAIndex )
endif
Code:
I discovered that BJ_HEROSTAT_whatever was actually a constant integer. I decided that instead of having 3 copies
of the samething I'll run the loop which was running part 2 through the first part of the trigger. This enabled
me to reduce the code quite a bit.
However this creates some confusion. Loop B is the stat which is being modified. And Loop A is the player number.
And who said variables have to be named something thats understandable? I certainly didn't...Hoo boy do I hate
myself for that one.
--Removal of some trivial code.
--Got rid of the region and thus that stupid black square at the bottom.
Known Bugs:
--None yet, however there is some left over code from 4.0 in the trigger header which I didn't feel like sifting out.
--Before you ask. 4.0 doesn't work because 1.13 has not been released to fix the permanant items don't launch events
bug.
Future Planed Fixes/Optimizations:
--A function which gets the player number and the button of the dialog clicked instead of this disgusting mess I have.
--Somehow getting rid of the little white blip on the minimap which fallows your hero.
--A GUI trigger for the user which will allow him to define the hero, and how many starting stat points you have.
--Currently this is staticly defined in the poorly named Melee Initilization Trigger.
--Making the second part of Response actually readable.
--Variable names with meanings, or atleast local variables with meaning (hell might freeze over first so don't hold your breathe)For those questioning: WHAT WEAADDAR ACTUALLY DID SOME CODE AGAIN? Yes, it happened. With hearing about 1.13 being so eminent I felt such fixes were neccessary before I wowed you with the not so impressive, but kinda cool DT 4. If your a freak whos into scouring huge triggers you can peice together how DT 4 would work, but for the most part I removed the triggers with DT 4 functionality (The equiping of weapons, armor, misc items). Its war3x only due to the nature of the optimization...Sucks, but really nothing news (Well theres been quite a fix little bug fixes and the snazzier bag layout) been added since dialog test 3.3 which was War3 workable. A fun fact: Dialog Test II for 12 players, was 20 triggers longs the same functionality as now 1 trigger, and used over 15 variable which have been replaced by only 2 global variable. pretty neat if you ask me. |
| 11-07-2003, 05:44 PM | #2 |
Sorry for the wrong version being uploaded before... |
| 11-09-2003, 01:39 AM | #3 |
Glad you like it. As far as 3.9 goes If I have free time tommorow, I'll update the map to include this wrapper "class" for dialogs which grabs the player and which button they clicked. (Less Loops and if then elses=cohesson!) |
