• 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.

2.x disease spread.

Status
Not open for further replies.
Level 2
Joined
May 26, 2014
Messages
18
I am trying to devise a way to make a rabies buff/debuff that spreads upon incubation to 2x hosts. With an infinite number of spreads occurring, provided the hosts are not killed/dispelled.

Primary issue is the means of firing the trigger/It's event.

1:There is no GuI event/condition "check for unit with XXX buff"
2: I have an extremely limited Jass knowledge. (I can manipulate it but not contrive it much.) I would be happy to sludge through any trigger that can help me with this.
3: After two years of leaving this "spell" on the shelf have still not thought of another way to fire this off.

Disease would ideally be given with a passive attack mod as the unit already has such a mod labeled rabies. (stacking damage over time mod) but I am open to ANY suggesting enabling this idea even if it forces me outside of this box.

Thank you. :)
 
Level 12
Joined
Nov 3, 2013
Messages
989
Use a DDS and check if the attacker have the Rabies ability or if the target have the debuff

Does it only spread when an infected attacks another?
 
Level 2
Joined
May 26, 2014
Messages
18
I hadn't decided if I wanted the unit to go berserk on incubation and spread by that means (granting the unit rabies spell like original host) or just have it spread. I was still concerned with firing the event. I knew I could do either or probably. I couldn't use damage dealt to check fro this event though at least not in any way I have been able to contrive so far...
 
Level 12
Joined
Nov 3, 2013
Messages
989
Didn't really get what you're saying, i'll clarify my earlier post.

If a unit is infected, give it an ability or add it to a unit group.

With a DDS you will have event for each time a unit takes damage together with the source.

Check if the source have the ability or if it's in the unit group (e.g. unitgroup_infected)

Then add the damaged unit to the unit group or give it the same or another version of infected ability if you have different kind or w/e
 
Level 2
Joined
May 26, 2014
Messages
18
Ok, I could give the unit a passive attack mod after being "bitten" which then adds it to another unit upon being "bitten" and then apply a cool-down to those passives. What I need though is a means to "bite" a unit which then receives a rabies passive attack mod or just plain disease buff. Have that unit return to its owners base and later upon incubation spread that disease to other units on it's own player team. (or cause it to attack it's own team upon incubation) Either one of which requires an incubation endpoint event of some kind. Some way to know when that unit has had rabies too long and now it is time to spread it.
 
Level 12
Joined
Nov 3, 2013
Messages
989
timer - timer expires

Also, didn't you say first that it was when a unit got attacked? if "bitten" is a target ability then you have that event instead of DDS
 
Level 2
Joined
May 26, 2014
Messages
18
I tried to use timers over a year ago. 1st unit timer 1. 2nd unit got rabies timer 2. 3rd unit got rabies timer 3. By the time I was done I needed 10 separate triggers x3 just to test to see if it worked in theory and would have needed to make at least another 200 - 100 to be reasonably sure I didn't run out in an actual game. IDK how I could get around that without putting all rabies victims on the same timer which would be a little weird having units which just contacted it finishing incubation same time as units who have had it for some time. That is what made this so hard for me at my very limited programming level. And finally pushed me to beg for help haha.
 
Level 12
Joined
Nov 3, 2013
Messages
989
Would also work with periodic event

Edit: Actually nvm about the timer it would be better with Periodic event since you'd need to make more work with timer, have an integer that count up for each infected unit.

Still need hashtable or unit indexer

Or actually you could use wait and do it in the same function, after the wait just check if the unit is still infected and whatever condition you would need for it to complete
 
Level 2
Joined
May 26, 2014
Messages
18
Would that be hard to write? I haven't used arrays nor the hashtables at all. But I can certainly delve into them further if it will make this happen. I have a reasonable understanding of what arrays are for from other games editors etc. It hadn't occurred to me that they might track timers separately for me like that.

Are you fairly certain this can be done using those? If so I will go get to work on both elements right now.
 
Level 12
Joined
Nov 3, 2013
Messages
989
Simplified arrays let you use the same variable together with a number. Using that you can connect the variables who share the same index (number). It's supposedly capped at something like 8000+ but with the hashtable or indexer you will be recyleing the indexes. And I highly doubt you'd have over 8 thousand infected units at once

Here is a good tutorial that covers a lot of these things

http://www.hiveworkshop.com/forums/...u-should-know-when-using-triggers-gui-233242/
 
Level 2
Joined
May 26, 2014
Messages
18
I already started messing with it and I do think that u set me in a good direction. I already ran into my first problem. But I realize this has to be a common problem and I will find a way around that eventually. Nevertheless I think the right direction. Thanks for looking at it and the push.

Probably should have learned arrays in wc3 years ago , hehe.
 
Level 2
Joined
May 26, 2014
Messages
18
I have browsed through some 30 or so triggers with unit arrays in them no and the one recurring theme I am seeing goes something like this.


Events
Map initialization
Conditions
Actions
Set Unit[1] = unit 0016 <gen>
Set Unit[2] = unit 0017 <gen>
Set Unit[3] = unit 0025<gen>

where each line designates a specific point of reference within the index or array. I have not yet seen a single example of somebody using this system to designate "the next index location in succession" or " any un-used index location within array" the latter of which is obviously what I need to do for this particular mechanic. being that I just started messing with this a few hours ago I am reluctant to ask for help so soon but I am also kind of excited about this new direction on this old problem so if anyone browses this and has a solution to enter units into the index without giving it a specific location (thereby preventing accidently writing over locations already filled within the index) I would greatly appreciate it. Will continue learning in the meantime hopefully find a solution.
 
Level 12
Joined
Nov 3, 2013
Messages
989
Edit: Thanks ForTheSwarm It were getting old trying to explain without reference to an appropriate tutorial now I'll remove some crap and leave what may possibly still be useful...

Well if you don't like indexing just use hashtable instead.

http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/hashtables-mui-133407/

It's easier but indexing is supposedly faster (probably won't matter)

Another example of where you'd use an Array that isn't related to this what so ever just to give arrays some kudos
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • For each (Integer SomeInt) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set UnitsPlayer[SomeInt] = (Units in (Playable map area) owned by (Player[SomeInt]))
 
Last edited:
Level 2
Joined
May 26, 2014
Messages
18
It wasn't that I didn't "like" it I simply didn't see how to utilize it for this if it was limited as such. I spent the last hour or so studying one of this guy purple poot's systems for variable unit group arrays trying to puzzle out how to use it. Moving in the right direction (I think and hope) thanks to your help again. Thank you both very very very much :)
 
Status
Not open for further replies.
Top