• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[General] Worldeditor Problems

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 65
Joined
Jan 18, 2005
Messages
27,290
Can somebody tell me how to fix Worldeditor taking forever to openup?
Disable brush list.

If problem still persists it must be file system IO related.
Second ingame loading? takes bloody ages how to fix?
Declare less localized "trigger strings" as loading that file is slow due to poor optimization.

This is commonly done by converting object data to SLK files.
 

Dr Super Good

Spell Reviewer
Level 65
Joined
Jan 18, 2005
Messages
27,290
So you mean something is heavily using the CPU?or gpu
I mean heavily reading from or writing to your hard disk/drive. These have limited bandwidth, especially older mechanical drives.
And can you tell me how to add a Chance for lumber to drop when a unit Dies?
Please explain what you mean by "lumber to drop". Do you want units to give a random-ish bounty of lumber? Or to drop an item that when picked up grants lumber?

Units can be made to give a bounty of lumber as well as gold when killed. One just needs to make sure lumber bounty is enabled for the player who owns the unit. This is done using the appropriate trigger action to modify the player properties.

A trigger to drop an item on unit death would be as simple as any unit dies for event with action to create the item at the location of the dying unit. Conditions could be added to check chance (eg random integer from 1 to 100 less than 20) and limit unit type or owning player. Remember to clear up all leaks including any locations created as well as removing any consume on pickup items after they are picked up (they might seem to disappear but they actually remain on map in a dead state forever unless explicitly removed with trigger).
 
Level 8
Joined
Jul 10, 2018
Messages
383
I mean heavily reading from or writing to your hard disk/drive. These have limited bandwidth, especially older mechanical drives.
Please explain what you mean by "lumber to drop". Do you want units to give a random-ish bounty of lumber? Or to drop an item that when picked up grants lumber?

Units can be made to give a bounty of lumber as well as gold when killed. One just needs to make sure lumber bounty is enabled for the player who owns the unit. This is done using the appropriate trigger action to modify the player properties.

A trigger to drop an item on unit death would be as simple as any unit dies for event with action to create the item at the location of the dying unit. Conditions could be added to check chance (eg random integer from 1 to 100 less than 20) and limit unit type or owning player. Remember to clear up all leaks including any locations created as well as removing any consume on pickup items after they are picked up (they might seem to disappear but they actually remain on map in a dead state forever unless explicitly removed with trigger).
I mean Lumber to drop but has a chance of it to drop when a unit dies
 
Level 13
Joined
Oct 12, 2016
Messages
769
If you mean with a bundle of lumber (look for it under the "powerup" section of the items list), you could either use a trigger to create the item at the point where something dies,
or set it up as a loot table for the unit (if it is placed in your map first).

Alternatively, you could go into the object data, scroll down to the "stats" section of the unit in question, and set an amount for its lumber bounty.
You will then have to use a trigger to turn on bounty for the player owner of that unit, if it isn't Neutral Hostile.
 
Level 8
Joined
Jul 10, 2018
Messages
383
If you mean with a bundle of lumber (look for it under the "powerup" section of the items list), you could either use a trigger to create the item at the point where something dies,
or set it up as a loot table for the unit (if it is placed in your map first).

Alternatively, you could go into the object data, scroll down to the "stats" section of the unit in question, and set an amount for its lumber bounty.
You will then have to use a trigger to turn on bounty for the player owner of that unit, if it isn't Neutral Hostile.
I think you're missing the meaning of my words... I want [Chance] OF the lumber to drop A CHANCE maybe like 1 lumber Added to player when a unit dies

if a unit dies it either gives him Lumber or it doesn't thats it
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
They have slightly misunderstood you but the suggestion they gave can make it random whether or not you get lumber. Using this as a guide, you need to set the following options for your units:
  • Stats - Lumber Bounty Awarded - Base = -1 (hold shift and double-click the field to put in negative values)
  • Stats - Lumber Bounty Awarded - Number of Dice = 1
  • Stats - Lumber Bounty Awarded - Sides per Die = 2
This makes a unit give a lumber bounty of: -1 + 1*(random number from 1 to 2) = 0 or 1. Unlike gold, however, there is no visual display associated with a lumber bounty so you won't see +0 or +1 in-game but it does give it to the killing player.
 

Dr Super Good

Spell Reviewer
Level 65
Joined
Jan 18, 2005
Messages
27,290
The trigger approach would involve a unit dies event combined with a condition to filter for bounty awarding deaths. Such condition might test if the dying player should give bounty to the killing player such as making sure they are a bounty enabled player and that the killing unit is not an ally of theirs.

Under actions you would first calculate if bounty should be awarded implemented inside an in then else block. Then one would compute how much bounty to award, finally adding it to the owner of killing unit lumber.

If you want either the award chance or bounty amount to vary depending on the dying unit type a hashtable could be used to map a value to the unit type. Unit types are integers so can be used as the parent key for a hashtable. The child key can be some arbitrary number, eg generated from hashing a string.
 
Level 13
Joined
Oct 12, 2016
Messages
769
I think you're missing the meaning of my words... I want [Chance] OF the lumber to drop
I know exactly what you mean. So, with triggers:

  • Chance Drop
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 12 (Brown)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 10) Equal to 1
        • Then - Actions
          • Set TempLoc = (Position of (Triggering unit))
          • Item - Create Bundle of Lumber at TempLoc
          • Custom script: call RemoveLocation(udg_TempLoc)
        • Else - Actions
This is an example of dropping a powerup with a 10% chance. Instead of dropping a powerup, you could just:
  • Player - Add 1 to (Owner of (Killing unit)) Current lumber
Alternatively, if you are happy with a 50% chance for 1 lumber, go to the object data and set:
"Stats - Lumber Bounty Awarded - Base = -1"
"Stats - Lumber Bounty Awarded - Number of Dice = 1"
"Stats - Lumber Bounty Awarded - Sides per Die = 2"

But, make sure you do this for that to work:
  • Player - Turn Gives bounty On for Player X
 
Status
Not open for further replies.
Top