- Joined
- Jun 6, 2024
- Messages
- 13
Upfront disclaimer, I know virtually nothing about Jass. All of my experience in programming is in other languages or using the editor itself and my map so far has been built using gui entirely until i stumbled across this drop table and it was easy enough. So these may be easy questions, sorry if answers are easy to find, I apparently am struggling to find them. I just cant seem to find out how to write the commands or find where to even find that information and rather than keep hunting for ages or continuing trial and error, maybe this is more practical? I keep making commands i think are what i want in gui, then converting them to jass to see how they work and im just making no progress.
Below is currently one of the generic tables I've worked on, pulled from Itempools Guide with very minimal modifications.
Im working on taking a similar template to use for a creep pool since they seem to use most the same commands.
Now for what I'm getting at, my target idea or current iteration I'm trying to implement that i need some help with finding information on. What my end goal looks like in steps:
1. Creep dies
2. Check region
3. Generate number between 1 and X.
4. If number is less than/= Y, continue, if above end.
5. If X is some function involving level of creep. perhaps X = A - (lvl * lvl) so higher level creeps are weighted much heavier. if max level is 100 and A is 12,000. Y can be 2,000 so a level 100 creep always procs but a level 1 has a large chance not to. values are just dummy for this and id balance them later.
6. If successful then roll another value and this determines which table to roll.
7. Roll that table.
Another system is the respawn. Inside these larger regions, ill create regions for creep spawn. Perhaps triggered off the time of day where it checks if any units owned by neutral hostile are in that region, and if not creates some amount based on the creep spawn region, but it rolls which creep to spawn on a table similar to the drops so i can weight some rarer or higher level spawns. These would be a lot more straightforward and i can probably figure these out.
Any advice or resources you can point me to that will assist with information involving these is greatly appreciated. If something I'm asking isnt quite clear, ask for clarification and ill provide it asap. Or if you think there's a glaring issue with a system like this that my ignorance is missing please let me know and I can alter the plan. Also this doesn't need to be done in Jass if gui is capable of it. Thanks for taking the time to read.
Below is currently one of the generic tables I've worked on, pulled from Itempools Guide with very minimal modifications.
JASS:
function Trig_Neutral_Hostile_Drop_Table1_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local real ux = GetUnitX(u)
local real uy = GetUnitY(u)
local itempool ip = CreateItemPool()
//===========================================================================
// Generic Table 1
//===========================================================================
call ItemPoolAddItemType(ip, 'I007', 1000) // 5gp Chance:
call ItemPoolAddItemType(ip, 'I008', 1000) // 7gp Chance:
call ItemPoolAddItemType(ip, 'I009', 750) // 10gp Chance:
call ItemPoolAddItemType(ip, 'I00A', 500) // 12gp Chance:
call ItemPoolAddItemType(ip, 'I00B', 250) // 15gp Chance:
call ItemPoolAddItemType(ip, 'I00C', 150) // 20gp Chance:
call ItemPoolAddItemType(ip, 'I00D', 100) // 25gp Chance:
call ItemPoolAddItemType(ip, 'I00E', 75) // 50gp Chance:
call ItemPoolAddItemType(ip, 'I00F', 50) // 75gp Chance:
call ItemPoolAddItemType(ip, 'I00G', 25) // 100gp Chance:
call ItemPoolAddItemType(ip, 'I00H', 5) // 150gp Chance:
call ItemPoolAddItemType(ip, 'I00I', 2) // 250gp Chance:
call ItemPoolAddItemType(ip, 'I00J', 1) // 500gp Chance:
call ItemPoolAddItemType(ip, 'I00K', 0) // 1000gp Chance:
call ItemPoolAddItemType(ip, 'I00L', 0) // 2000gp Chance:
call ItemPoolAddItemType(ip, 'I00M', 0) // 5000gp Chance:
call ItemPoolAddItemType(ip, 'pghe', 50) // Chance:
call ItemPoolAddItemType(ip, 'whwd', 75) // Chance:
call ItemPoolAddItemType(ip, 'hlst', 50) // Chance:
call ItemPoolAddItemType(ip, 'phea', 150) // Chance:
call ItemPoolAddItemType(ip, 'pman', 200) // Chance:
call PlaceRandomItem(ip,ux,uy)
call DestroyItemPool(ip)
set ip = null
set u = null
endfunction
//===========================================================================
function InitTrig_Neutral_Hostile_Drop_Table1 takes nothing returns nothing
set gg_trg_Neutral_Hostile_Drop_Table1 = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Neutral_Hostile_Drop_Table1, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_Neutral_Hostile_Drop_Table1, function Trig_Neutral_Hostile_Drop_Table1_Actions )
endfunction
Im working on taking a similar template to use for a creep pool since they seem to use most the same commands.
Now for what I'm getting at, my target idea or current iteration I'm trying to implement that i need some help with finding information on. What my end goal looks like in steps:
1. Creep dies
2. Check region
3. Generate number between 1 and X.
4. If number is less than/= Y, continue, if above end.
5. If X is some function involving level of creep. perhaps X = A - (lvl * lvl) so higher level creeps are weighted much heavier. if max level is 100 and A is 12,000. Y can be 2,000 so a level 100 creep always procs but a level 1 has a large chance not to. values are just dummy for this and id balance them later.
6. If successful then roll another value and this determines which table to roll.
7. Roll that table.
Another system is the respawn. Inside these larger regions, ill create regions for creep spawn. Perhaps triggered off the time of day where it checks if any units owned by neutral hostile are in that region, and if not creates some amount based on the creep spawn region, but it rolls which creep to spawn on a table similar to the drops so i can weight some rarer or higher level spawns. These would be a lot more straightforward and i can probably figure these out.
Any advice or resources you can point me to that will assist with information involving these is greatly appreciated. If something I'm asking isnt quite clear, ask for clarification and ill provide it asap. Or if you think there's a glaring issue with a system like this that my ignorance is missing please let me know and I can alter the plan. Also this doesn't need to be done in Jass if gui is capable of it. Thanks for taking the time to read.
Last edited: