Trigger Help PLZ

  • Thread starter Thread starter WartHawg
  • Start date Start date
W

WartHawg

Guest
OK. I am trying to make a trigger where, when a unit enters a region, a random level creep replaces the unit.

My map in particular involves a Male unit entering a region and being replaced by a random level 4 creep.

I have tried many things to get this to work but nothing seems to do it. I got close. I got random creeps to replace the Male unit but I noticed the same random unit is replacing the Male unit everytime the game is being tested

Just incase that confused you, here is what happens...

Unit enters region - Replaced by centaur outrunner (lvl 4).
Next one enters region - Replaced by tuskarr trapper (lvl 4).
Next one enters region - Replaced by giant spider (lvl 4)
Next one enters region - Replaced by tuskarr trapper (lvl 4).
Final unit enters region - Replaced by frost revenant (lvl 4).

Everytime I test out the map I get these same units in the same exact order.

Please tell me how I can fix it so I get different random creeps everytime. Thank you.
 
Oh yea, here is the trigger I am currently using for the spawning. Maybe it will help you figure out what is wrong.

[Event] - Unit enters region 000

[Conditions] - ((Unit-type of (Triggering unit)) Equal to Villager (Male 2)) or ((Unit-type of (Triggering unit)) Equal to Villager (Male))

[Actions] - Unit - Replace (Triggering Unit) with a (Random level 4 creep unit-type) using The new unit's default life and mana
 
dont think you can get a truely rand unit that way. This would work though:

Untitled Trigger 001
Events
Unit - A unit enters Area 1 <gen>

Conditions
yours is fine

Actions

Set randcreep = (Random integer number between 1 and 3)

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
randcreep Equal to 1
Then - Actions
Unit - Replace (Triggering unit) with a Centaur Outrunner using The new unit's default life and mana
Else - Actions
Do nothing

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
randcreep Equal to 2
Then - Actions
Unit - Replace (Triggering unit) with a Tuskarr Trapper using The new unit's default life and mana
Else - Actions
Do nothing

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
randcreep Equal to 3
Then - Actions
Unit - Replace (Triggering unit) with a Giant Spider using The new unit's default life and mana
Else - Actions
Do nothing

I left out the condition cause your is fine. to add more units simply copy the if/then/else statement, change the if to the next integer then change the replaceing unit to the new unit and make sure that randcreep can pick the new highest integer. If you put alot of units in this way you should add an action "skip remaining actions" after you replace the unit to clean it up a bit.

Note: randcreep is a integer varible.
 
WOOHOO Thanks a lot! Worked on the first shot for me, surprisingly.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Real users can't really disable Javascript anymore these days.
  • Ghan Ghan:
    The internet is broken without it.
  • Ghan Ghan:
    Bot readable, not human usable.
  • The Helper The Helper:
    got it
  • The Helper The Helper:
    Happy Thursday!
  • The Helper The Helper:
    Check out the new Featured Content feature we apparently got with the forum software upgrade! https://www.thehelper.net/featured/
  • The Helper The Helper:
    Also on the bottom right side bar we now have a Trending Content Box!
    +1
  • The Helper The Helper:
    Not on the Headline News page just on the Forums page can we get that Featured and Trending on the home page?
  • Ghan Ghan:
    Since the home page is technically a forum, it now shows on all forum views. Still in the sidebar.
    +1
  • The Helper The Helper:
    Happy Friday! Hope everyone has a fantastic day and an even better weekend!
  • The Helper The Helper:
    Happy Sunday!
  • The Helper The Helper:
    I lovc that I can post webp and X links now! :)
  • The Helper The Helper:
    Happy Thursday!
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    we were down for a minute - think a log file or something got too big
    +1
  • Ghan Ghan:
    The alerts say it was down for a while unfortunately.
  • Ghan Ghan:
    Didn't know what was going on while I was at work.
  • Ghan Ghan:
    Disk filled up with logs. Fixed now.
    +1
  • The Helper The Helper:
    not a problem at all thanks for getting us back up
  • The Helper The Helper:
    I think the bots are finding a way to get through the anubis
  • The Helper The Helper:
    Happy Wednesday Everyone! Hope everyone has a Fantastic Day!
    +1
  • The Helper The Helper:
    Yeah, stats are showing big bot influx like 12k page views.
  • Wizard Wizard:
    :wave:
    +1
  • Ghan Ghan:
    TH changed his avatar again. 6 more weeks of summer.
    +3
  • Wizard Wizard:
    lol
    +1

The Helper Discord

Members online

No members online now.

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top