| 11-02-2006, 09:46 AM | #1 |
I feel kind of newbish for asking these but I've only noticed that these functions are not pre programmed into WC: FT are they? 1. How do I stack perishable/charged items? Like if I had 2 potions; one with 2 charges and the other with 3, how do I just make it stack into 5? I suppose I could trigger it with variables and stuff, but I wonder if there's already a simple formula for it. 2. How do I display Time Elapsed (for the whole game). For some reason I thought there's a native function for it, but I am missing it. Thanks a lot :D |
| 11-02-2006, 10:06 AM | #2 |
Item stacking, nope, good thing I've written a nice tutorial on it. http://www.wc3campaigns.net/showthread.php?t=80327 Time elapsed, not that I know of, you'll have to trigger a leaderboard with a counter (periodic event every second or something like that). |
| 11-02-2006, 11:17 AM | #3 |
Well goddamn. A periodic leaderboard event.. Hahaha why didn't I think of that. Thanks a bunch. |
| 11-02-2006, 12:49 PM | #4 |
I suggest you to use repeating timer, because... it's better! |
| 11-02-2006, 01:30 PM | #5 |
^ Wait sorry, what's a repeating timer? |
| 11-02-2006, 02:02 PM | #6 | |
Quote:
copy this whole function into your map, then all charged item will stack by itself JASS:function ReplaceItem takes nothing returns nothing local unit u = GetTriggerUnit() local item x = GetManipulatedItem() local item xx local integer cx = GetItemCharges(x) local integer d local integer i = 1 if cx > 0 then loop exitwhen i > 6 set xx = UnitItemInSlotBJ(u,i) if x != xx and ix == GetItemTypeId(xx) then set d = GetItemCharges(xx) + cx call SetItemCharges(xx,d) call RemoveItem(x) endif set i = i + 1 endloop endif set u=null set x=null set xx=null endfunction //=========================================================================== function InitTrig_Item_Stacking takes nothing returns nothing local trigger d = CreateTrigger() call TriggerRegisterAnyUnitEventBJ( d, EVENT_PLAYER_UNIT_PICKUP_ITEM ) call TriggerAddAction( d, function ReplaceItem ) set d = null endfunction |
| 11-02-2006, 02:09 PM | #7 |
zen87, don't eat people's brains. I guess author doesn't know JASS. Matarael, timer option. It can be one-shot or repeating. I have no idea how it's called, because my WE is translated to russian. |
| 11-02-2006, 02:22 PM | #8 |
uhmmm okay =_=" - first, go create a new trigger - then go to edit --> Convert to Custom Text - now you will see the trigger in something like this JASS:function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing endfunction //=========================================================================== function InitTrig_Untitled_Trigger_001 takes nothing returns nothing set gg_trg_Untitled_Trigger_001 = CreateTrigger( ) call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions ) endfunction hmph, if nothing goes wrong it will work |
| 11-02-2006, 03:10 PM | #9 |
For your game time. Create 4 variables, one called Seconds, one called Minutes, one called Hours (they are all integer type) and one called Time which is string type. Then do something like this: |
| 11-08-2006, 06:47 AM | #10 |
Everyone here's is so helpful hahaha... I thank you all. You're amazing. I have added said functions to the map. After attempting to figure out how to do a stacking by myself (its... I don't know, I think it's impossible to make a GUI script for it when I need it to be multi-instance-castable -_-) ----- Here's one more I still can't wrap myself: a multiboard for death/kills. How do I assign a specific row for a player. I mean, lets say there are 4 players, they choose numbers 1, 4, 6, and 7 because they want the colours to be of those numbers. I count the number of human players playing and store it in integer to decide how many rows the multiboard has right? Then I need to assign a number for each player right? (because using "player(number of player)" will give the players a 4th, 6th, and 7th row place on the board). How do I do this? Every time I do a "pick every player", the only one chosen is player 1 (red). I could look for a multiboard tutorial, but I like a good mystery, and this is just like that. Only I got stuck hahaha... |
| 11-09-2006, 04:21 AM | #11 |
Oops never mind that last question. I figured it out already. Hahahaha.... I could write a tutorial explaining how to make such multiboard now I think. Should I write one? For GUI map makers? And by the way, I got an error implementing that item stack JASS function on my map, something about "expected name" and "expected variable" and "expected endloop" or something. I think I may have pasted it wrong. I'll post again when I get it right. |
