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

A little problem. {making a region to increase stats, limiting it to 8 adds}

Status
Not open for further replies.
Level 18
Joined
Mar 7, 2005
Messages
824
When you're using some specific times, just add a variable, for example AGIamount (integer) and increase it..

For example: The region can be used only 4 times after it don't works anymore
  • Events
    • Unit - A unit enters <Str region>
  • Conditions
  • Actions
    • If/then/else
      • If
        • STRamount smaller than 4
      • then
        • Hero - add str to entering unit
        • Set STRamount = STRamount + 1
        • Game - show text message to triggering player "You can enter this region x more times"
      • else
        • Game - Show text message to triggering player "Region disabled"
just wrote it out of my head, search for the triggers they should be similar
oh, and of course you have to use an array for it, this is just for one player.. if you're using the same region for more players just add an array and use it for the players like STRamount[1] is for player1, STRamount[2] for player 2 and so on
 
Level 11
Joined
Feb 14, 2009
Messages
884
i mean that evry hero should go in the region for getting it but not make 1 man take every str and other things for themselves.

Then you should create a variable for every hero in game. For example, you can use "PlayerOneStr", "PlayerTwoStr" like this:

  • Events
    • Unit - A unit enters <BonusRegion>
  • Conditions
  • Actions
    • If (Owner of <Triggering Unit>) = Player 1 Then
      • If PlayerOneStr = False Then
        • <Add str to hero>
        • PlayerOneStr = True
      • Else
        • Game - Show text message to (Owner of <Triggering Unit>) "You cannot gain any more strength!"
    • If (Owner of <Triggering Unit>) = Player 2 Then
      • If PlayerTwoStr = False Then
        • <Add str to hero>
        • PlayerTwoStr = True
      • Else
        • Game - Show text message to (Owner of <Triggering Unit>) "You cannot gain any more strength!"
  • etc etc...
Hope it helps.
 
Level 18
Joined
Mar 7, 2005
Messages
824
there's an easier way to do this:

First of all you should make some variables: Hero with array (amount of total players), PlayersCount
--> Hero = unit based variable
--> PlayersCount = Integer

Now when you create the Hero for the Players set the variable for it, example:
  • Actions
    • Unit - Create 1 Archmage for Player 1 at blablabla
    • Set Hero[1] = last created Unit
    • Unit - Create 1 Paladin for Player 2 at blablabla
    • Set Hero[2] = last created Unit
The Hero variable isn't needed but I would suggest it to built it in, you could use it for a lot of stuff.
Now you have to check the amount of playing Players = Number of Units within region. This way you'll be able to calculate how many Heroes shall be within this area, all Heroes from all Players, that are playing, or just the half of them.. just how you like it.. now here comes the trigger part for the region:
  • Events
    • Unit - A Unit enters <Region Str>
  • Conditions
  • Actions
    • Loop - Pick every Unit in <Region Str> of Type Hero and do actions:
      • If Number of living (picked unit) equal to PlayersCount Then
        • Unit - Add 1 Str to (Picked Unit)
      • Else
        • Game - Show Text Message to all Players "Not enough Heroes with the Region"
try something like that, should work
 
Level 18
Joined
Mar 7, 2005
Messages
824
I don't get you dude..
Please start all over again, each of your explanations are different and mean different stuff, if you really need the help and want it, then try to explain the whole thing again.
I really don't understand what you're going to do, and what you want..
I can't help you for now, I just don't get it (each explanation means something different and destroys an earlier explanation, that you've written.. that's really strange, for me, dunno if others have same problems)

edit: I think, that kercyn did the thing you want.. I'm still not sure, but his solutions means every hero can enter the region only once, but you should improve it and use an array instead of creating a variable for each player/hero.
 
Level 12
Joined
Jul 27, 2008
Messages
1,181
Try using a custom skill to give the stats, then do:
  • Events
    • Unit - A Unit enters <REGION>
  • Conditions
    • (Custom Value of (Entering Unit)) Equal to 0
  • Actions
    • Unit - Add <CUSTOM_ABILITY> to (Entering Unit)
    • Unit - Set the Custom Value of (Entering Unit) to 1
Of course this works only if you gain all skills in one region.
 
Level 11
Joined
Feb 14, 2009
Messages
884
Use a variable that checks if there is a hero in the bonus region already (i.e. "BonusOccupied")

  • Events
    • Unit - A unit enters <Region>
  • Conditions
    • BonusOccupied Equal to True
  • Actions
    • Set ExitRegion = <A region your hero will be moved if there another hero in the bonus region>
    • Unit - Move (Triggering unit) instantly to (ExitRegion)
    • Custom script: call RemoveLocation(udg_ExitRegion)
And do the stuff Reaper2008 mentioned...
 
Level 20
Joined
Jan 6, 2008
Messages
2,627
you guys are almost there, just that i made several regions thats making your skill go up.
EDIT: I want 1 hero at the time just to walk over an region and make hes skill go up and then he can never get more skills but other players heroes can also learn it once.
 
Level 11
Joined
Feb 14, 2009
Messages
884
So, if I've understood correctly, you have, let's say, 2 regions and there are 2 players, each controlling a different hero. Each hero should be able to enter a bonus region once only, but every hero can enter every region.

Did I get it right?
 
Level 12
Joined
Jul 27, 2008
Messages
1,181
Strength Player 1
  • Events
    • A unit owned by Player 1 (Red) enters <YOURREGION>
  • Conditions
  • Actions
    • Trigger - Turn off (this trigger)
    • Unit - Add <STRENGTH_ABILITY> to (Entering Unit)
You'll need one trigger for every player, and different triggers for every region.
 
Level 11
Joined
Feb 14, 2009
Messages
884
I'm not sure, but I think it will gain str. If it doesn't, place "Trigger - Turn off" at the end of the trigger.
 
Level 1
Joined
Apr 25, 2009
Messages
3
well i think if you were to make multiple triggers like what reaper suggested..for each player it would work...

{EDIT}
oh....i only looked at the first page my bad :/
 
Last edited by a moderator:
Status
Not open for further replies.
Top