Doom Angel's Question Thread

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
that would make me a lot of triggering................................
isn't there any easier way?
 

Thanatos_820

Death is Not the End
Reaction score
91
Master said:
P.S: How could a Peasant...hold an item by default?

Okay, I dunno which question you're currently waiting for but I think this will solve the problem with a peasant holding an item. Here's a sample trigger:

Code:
Peasant Item
    Events
        Unit - A unit Finishes training a unit
    Conditions
        (Unit-type of (Trained unit)) Equal to Peasant
    Actions
        Hero - Create Claws of Attack +15 and give it to (Trained unit)

Tested it and it works :D!

EDIT:

For your question Doom-Angel, you could make a dummy item (It's an item that gives nothing) and trigger it to give an ability to the hero. Like this (Hopefully):

Code:
Stat Change
    Events
        Unit - A unit Acquires an item
    Conditions
        (Item-type of (Item being manipulated)) Equal to Claws of Attack +15
    Actions
        Set YourHero = Paladin 0002 <gen>
        Unit - Add Item Damage Bonus (+15) to YourHero

The Paladin was preplaced, so sorry if it was that way. And make sure that the dummy items does nothing.
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
well but for doing this kind of thing i would need for each item these things:
1 item
Number of ability's the item contain as a unit ability
2 trigger
this will finish up for 100 items to:
100 items
150 abilitys
200 triggers

anyway this just takes too much time or room from map and i rather need something more shorter or easier even if it require jass to do that i don't care just plz give me some solution :banghead: :banghead: :banghead:


--------------------------------------------------------------------------------------------------------------
"We are still looking for Jassers"
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
well i though on it a little since i could do it like that but making so many triggers would take me too much so i though of an idea of doing something like this:
Code:
Event
    Map initialize
Condition
Action
    Set Ability[1] = Attack + 15
    Set Ability[2] = Defence + 5
    Set Ability[3] = Attack + 10
    Set Ability[4] = Defence + 2
    Set Item[1] = Claws of attack +15
    Set Item[2] = Leather Armor +5
    Set Item[3] = Claws of attack +10
    Set Item[4] = Leather Armor +2
than do:
Code:
Event
    Unit - A Unit Acquire an Item
Condition
Action
    For Each (Integer A) from 1 to 4 Do (Actions)
       Loop
          If (Condition) Then (Action) Else (Action)
             If - Condition
                 (Item Being Manipulated) Equal to Item[(Integer A)]
             Then - Action
                 Remove (Item Being Manipulated) from (Hero Manipulating Item)
                 Add Ability[(Integer A)] to (Hero Manipulating Item)
that would work and save me a lot but then i got new problem what i do if there is more than 1 ability for that item?


--------------------------------------------------------------------------------------------------------------
"We are still looking for Jassers"
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
well if u mean integers by arrays than what i simply do is detecting if the item is the number of integer A it will add ability with the same array like for item[1] it will add [1] but my prob is when the item has more than 1 ability cuz i can't add both ability[1] and [2] cuz it will mess up the whole trigger for me.....
i need some solution....


--------------------------------------------------------------------------------------------------------------
"We are still looking for Jassers"
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
well i thought of it and i found a solution (i can't believe it took me so much time to think of it....)
anyway here's my solution:
Code:
Event
    Map initialize
Condition
Action
    Set Ability[1] = Attack + 15
    Set Ability[2] = Defence + 5
    Set Ability[3] = Attack + 10
    Set Ability[4] = Defence + 2
    Set Ability2[1] = Defence + 5    
    Set Ability2[2] = Attack + 15
    Set Ability2[3] = Defence + 2
    Set Ability2[4] = Attack + 10
    Set Item[1] = Claws of attack +15
    Set Item[2] = Leather Armor +5
    Set Item[3] = Claws of attack +10
    Set Item[4] = Leather Armor +2
and then do the same just adding also ability2 as well:
Code:
Event
    Unit - A Unit Acquire an Item
Condition
Action
    For Each (Integer A) from 1 to 4 Do (Actions)
       Loop
          If (Condition) Then (Action) Else (Action)
             If - Condition
                 (Item Being Manipulated) Equal to Item[(Integer A)]
             Then - Action
                 Remove (Item Being Manipulated) from (Hero Manipulating Item)
                 Add Ability[(Integer A)] to (Hero Manipulating Item)
                 Add Ability2[(Integer A)] to (Hero Manipulating Item)
i still can't belive i didn't thought of it from the first place..... :(

anyway thx for any1 here giving me ideas and trying to help +Rep to all of u (im feeling genrous today :D)
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
k i got new question:

is it possible to use Item Tables with triggers?
e.g:
Code:
Add Item table to (Last created unit)
if it's possible only in Jass than i don't mind u can write it as well.
+Rep for helpers :p
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> is it possible to use Item Tables with triggers?

Not really...

Well, if you put one on a Creep, the editor generates some JASS code that runs at loading time to add the table to the Creep.
If you're really interested, get yourself some MPQ Viewer / Editor, make an empty map with just one Creep and a table, and extract the map's "war3map.j" file.
Look for a function called "CreateNeutralHostile".

Basically, for every Creep with a table, the game creates a trigger that waits for that particular Creep to die.

And, well, it has a function like this:
Code:
function ItemTable000000_DropItems takes nothing returns nothing
    local widget  trigWidget = null
    local unit    trigUnit   = null
    local integer itemID     = 0
    local boolean canDrop    = true

    set trigWidget = bj_lastDyingWidget
    if (trigWidget == null) then
        set trigUnit = GetTriggerUnit()
    endif

    if (trigUnit != null) then
        set canDrop = not IsUnitHidden(trigUnit)
        if (canDrop and GetChangingUnit() != null) then
            set canDrop = (GetChangingUnitPrevOwner() == Player(PLAYER_NEUTRAL_AGGRESSIVE))
        endif
    endif

    if (canDrop) then
        // Item set 0
        call RandomDistReset(  )
        call RandomDistAddItem( 'ches', 50 )
        call RandomDistAddItem( 'mort', 50 )
        set itemID = RandomDistChoose(  )
        if (trigUnit != null) then
            call UnitDropItem( trigUnit, itemID )
        else
            call WidgetDropItem( trigWidget, itemID )
        endif

    endif

    set bj_lastDyingWidget = null
    call DestroyTrigger(GetTriggeringTrigger())
endfunction

Which is rather basic, one set only, with two items, Cheese and Mogrin's Report.
The function is created when you prepare that item table.
If you find out the name, you can trigger it yourself.

Now imagine that thing with a more complicated set of sets...

Run your own random tables.
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
yea i guess that's too much of a complicated trigger to do and i rather using already the simple normal dropping trigger system..........

anyway thx for the info +Rep :D
 

Chocobo

White-Flower
Reaction score
409
yea i guess that's too much of a complicated trigger to do and i rather using already the simple normal dropping trigger system..........

anyway thx for the info +Rep :D

See also.. :

Item Pools are like Item Drops from Creeps. Here is an example :

Code:
function Unit000005_DropItems takes nothing returns nothing [B]//This is started whenever the unit dies, from a trigger[/B]
    local widget  trigWidget = null [B]//Widget, can handle units, doodads,..[/B]
    local unit    trigUnit   = null [B]// = bj_lastDyingWidget, equal to last dying handle[/B]
    local integer itemID     = 0 [B]//itemId[/B]
    local boolean canDrop    = true [B]//Is able to drop[/B]

    set trigWidget = bj_lastDyingWidget [B]// Fixes a value to trigWidget[/B]
    if (trigWidget == null) then [B]//If the trigWidget equal to nothing (no handle), then trigUnit = Triggering unit[/B]
        set trigUnit = GetTriggerUnit() [B]//Set trigUnit to triggering unit[/B]
    endif

    if (trigUnit != null) then [B]//If the trigUnit equal to nothing (No unit), then do actions[/B]
        set canDrop = not IsUnitHidden(trigUnit) [B]//Checks if canDrop not equal to if the trigUnit is hidden[/B]
        if (canDrop and GetChangingUnit() != null) then [B]//ChangingUnit() returns unit, if canDrop and GetChangingUnit = null, then do actions[/B]
            set canDrop = (GetChangingUnitPrevOwner() == Player(PLAYER_NEUTRAL_AGGRESSIVE)) [B]//Gives a boolean value to canDrop[/B]
        endif [B]//If/Then Actions ends[/B]
    endif [B]//If/Then Actions ends[/B]

    if (canDrop) then [B]//If canDrop equal to .. true[/B]
        [B]// Item set 0[/B]
        call RandomDistReset(  ) [B]//Resets the DistCount[/B]
        call RandomDistAddItem( ChooseRandomItemEx( ITEM_TYPE_POWERUP, 2 ), 100 ) [B]//Determines a item for the drop and its chance to be dropped[/B]
        set itemID = RandomDistChoose(  ) [B]//Percentage to drop[/B]
        if (trigUnit != null) then [B]//If trigUnit equal to No unit[/B]
            call UnitDropItem( trigUnit, itemID ) [B]//Drop the item from the RandomDistAddItem selected item, in this, it is a Random Powerup[/B]
        else [B]//Else[/B]
            call WidgetDropItem( trigWidget, itemID ) [B]//Drop item again[/B]
        endif [B]//If/Then/Else Action ends[/B]

    endif [B]//If/Then Action ends[/B]

    set bj_lastDyingWidget = null [B]//Nullifies bj_lastDyingWidfget[/B]
    call DestroyTrigger(GetTriggeringTrigger()) [B]//Destroys this trigger[/B]
endfunction

They give a chance to drop an item from a pool.




It takes an integer. There is ever a specific Id for each item. Ctrl +D to see them.

http://www.thehelper.net/forums/showthread.php?t=42846

..if you want to use it.
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
k here's a new question:

is it possible to detect which abilitys a certain unit has?
(checking it 1 by 1 won't help i can't start checking every skill)

i don't mind either JASS or GUI solution.

+Rep Guaranteed :D
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
If you were hoping for some "Dear unit, please give me a list of all abilities you have", you're out of luck.
There is no such thing.

Though it should be rather easy to keep a list of spells the unit learns or gets from buying or so.
 

Korolen

New User (Why do I keep getting those red bars?)
Reaction score
69
I think you can detect if a unit has a certain ability by comparing (Unit - Level of Ability for Unit) with zero.
 

Korolen

New User (Why do I keep getting those red bars?)
Reaction score
69
Yes, you can. But, that's the 1 by 1 method he talked about and didn't want...
Oh, right. Sorry :eek:

What do you want the list abilities for, anyway? And, like AceHart said, it is pretty easy to keep track of what abilities a hero has... either by a global array, or handle variables (which is easier, but requires a few lines of JASS).
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
Though it should be rather easy to keep a list of spells the unit learns or gets from buying or so.
so from what i understand u meant to detect when u unit learns a skill and add it to variable but yet i tried it and i can't since i don't have any option to do something like:
Code:
Set Ability = (Learned Ability)
anyway to add the learned ability to a variable?
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
Bump

and also adding a question:
Ace u said u can't base ability twice even if u change it's order string so does that also speaks about channel as well?
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
That's right. The triggers don't care that the ability is channel, they only look at it's order ID. Channel's only benefit is that it can change its order ID. So, if Channel has the same ID as another ability, there would be a conflict.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top