Victory condition HeLP

  • Thread starter Thread starter Unregistered
  • Start date Start date
U

Unregistered

Guest
Hi I Need Help Making Team1 Win if a specific unit dies and team2 wins if they kill that same unit..... so whichever team kills that unit wins the game . I know its probably simple
 
go into the trigger editor and make a trigger, the trigger u need here isnt very hard to figure out on your own, (and im on my way to bed so im to tierd to write down the trigger :o)
 
ive searched for a long time and coun't figure it out.
someone plz help would make my map not boring
 
First Setup The Teams.

Create a "Player Group" Variable named: "Team1"
Create a "Player Group" Variable named: "Team2"

Then add Players to those groups:

For each (Integer A) from 1 to 3, do (If (((Player((Integer A))) slot status) Equal to Is playing) then do (Player Group - Add (Player((Integer A))) to Team1) else do (Do nothing))

If there are 6 rooms open for players and 3 on each team. (Edit the numbers if this differs)

Then offcourse:

For each (Integer A) from 4 to 6, do (If (((Player((Integer A))) slot status) Equal to Is playing) then do (Player Group - Add (Player((Integer A))) to Team2) else do (Do nothing))

---

Winning the game:

Event:

Unit - A unit Dies

Condition:

(Triggering unit) Equal to WinUnit

(Be more creative than I was doing the Event and Condition)

Action:

Player Group - Pick every player in Team1 and do (If ((Owner of (Killing unit)) Equal to (Picked player)) then do (Player Group - Pick every player in Team1 and do (Game - Victory (Picked player) (Show dialogs, Show scores))) else do (Player Group - Pick every player in Team2 and do (Game - Victory (Picked player) (Show dialogs, Show scores)))

---

Not an as easy trigger as I thought, when I read your post.

Hope you can use it.
 
Ok I understand what your saying but im having problems putting more than 1 player in a player group in my team1 and team2 variables.it only lets me select one player out of 12.

and i can't find (Triggering unit) Equal to WinUnit.
and i can't find (owner of killing unit.)

if i can find these i can probably do it.


and now im having trouble with a new triiger that works on one map and not another. its a spell
it has a problem with this line
----local location targetpoint = udg_VolcanoLoc --- why???
HERE IS THE TRIGGER
function Trig_Volcano_Conditions takes nothing returns boolean
return ( GetSpellAbilityId() == 'A000' )
endfunction

function Trig_Volcano_Actions takes nothing returns nothing
local effect array effects
local location targetpoint = udg_VolcanoLoc <---here!!!
call TriggerExecute( udg_VolcanoTriggers[1] )

call TerrainDeformationCraterBJ( 0.50, true, targetpoint, 400.00, -450.00 )
call TerrainDeformationCraterBJ( 0.50, true, targetpoint, 200.00, 400.00 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call AddSpecialEffectLocBJ( PolarProjectionBJ(targetpoint, 100.00, ( I2R(GetForLoopIndexA()) * 60.00 )), "Objects\\Spawnmodels\\Human\\FragmentationShards\\FragBoomSpawn.mdl" )
call AddSpecialEffectLocBJ( PolarProjectionBJ(targetpoint, 100.00, ( I2R(GetForLoopIndexA()) * 60.00 )), "Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl" )
call AddSpecialEffectLocBJ( PolarProjectionBJ(targetpoint, 100.00, ( I2R(GetForLoopIndexA()) * 60.00 )), "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl" )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call TriggerSleepAction( 0.50 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call AddSpecialEffectLocBJ( PolarProjectionBJ(targetpoint, 100.00, ( I2R(GetForLoopIndexA()) * 60.00 )), "Doodads\\Cinematic\\FireRockSmall\\FireRockSmall.mdl" )
set effects[GetForLoopIndexA() * 2] = GetLastCreatedEffectBJ()
call AddSpecialEffectLocBJ( PolarProjectionBJ(targetpoint, 100.00, ( I2R(GetForLoopIndexA()) * 60.00 )), "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl" )
set effects[(GetForLoopIndexA() * 2) + 1] = GetLastCreatedEffectBJ()
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call AddSpecialEffectLocBJ( targetpoint, "Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl" )
set effects[1] = GetLastCreatedEffectBJ()
call TriggerSleepAction( 22.00 )
call TerrainDeformationCraterBJ( 0.50, true, targetpoint, 400.00, 450.00 )
call TerrainDeformationCraterBJ( 0.50, true, targetpoint, 200.00, -400.00 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call DestroyEffectBJ( effects[GetForLoopIndexA() * 2] )
call DestroyEffectBJ( effects[(GetForLoopIndexA() * 2) + 1] )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call DestroyEffectBJ( effects[1] )
endfunction

function Trig_Volcano_Target_Conditions takes nothing returns boolean
return ( GetIssuedOrderIdBJ() == String2OrderIdBJ("silence") )
endfunction

function Trig_Volcano_Target_Actions takes nothing returns nothing
set udg_VolcanoLoc = GetOrderPointLoc()
endfunction

function Trig_Volcano_Attack_Actions takes nothing returns nothing
local integer i = 1
local integer j
local unit array volcano
local location target
local location targetpoint = udg_VolcanoLoc
set j = 1
loop
exitwhen j > 3
call CreateNUnitsAtLoc( 1, 'e001', Player(0), targetpoint, bj_UNIT_FACING )
set volcano[((j-1)*3)+1] = GetLastCreatedUnit()
call SetUnitPathing( GetLastCreatedUnit(), false )
call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
call SetUnitPositionLoc( GetLastCreatedUnit(), targetpoint )
call SetUnitInvulnerable( GetLastCreatedUnit(), true )
call CreateNUnitsAtLoc( 1, 'e002', Player(0), targetpoint, bj_UNIT_FACING )
set volcano[((j-1)*3)+2] = GetLastCreatedUnit()
call SetUnitPathing( GetLastCreatedUnit(), false )
call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
call SetUnitPositionLoc( GetLastCreatedUnit(), targetpoint )
call SetUnitInvulnerable( GetLastCreatedUnit(), true )
call CreateNUnitsAtLoc( 1, 'e003', Player(0), targetpoint, bj_UNIT_FACING )
set volcano[((j-1)*3)+3] = GetLastCreatedUnit()
call SetUnitPathing( GetLastCreatedUnit(), false )
call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
call SetUnitPositionLoc( GetLastCreatedUnit(), targetpoint )
call SetUnitInvulnerable( GetLastCreatedUnit(), true )
set j = j + 1
endloop
loop
exitwhen i > 22
set j = 1
loop
exitwhen j > 9
set target = PolarProjectionBJ(targetpoint, GetRandomReal(300.00, 700.00), GetRandomDirectionDeg())
call IssuePointOrderLocBJ( volcano[j], "attackground", target )

set udg_VolcanoTarget = target
set udg_VolcanoTime = 1.6 * ((DistanceBetweenPoints(GetUnitLoc(volcano[j]), target)) / 500)
call TriggerExecute( udg_VolcanoTriggers[2] )

set j = j + 1
endloop
call TriggerSleepAction( 0.8 )
set i = i + 1
endloop
set j = 1
loop
exitwhen j > 9
call UnitRemoveAbilityBJ( 'Aloc', volcano[j] )
call RemoveUnit( volcano[j] )
set j = j + 1
endloop
endfunction

function Trig_Volcano_Damage_Group takes nothing returns boolean
return (( IsUnitType(GetFilterUnit(), UNIT_TYPE_GROUND) == true ) and ( IsUnitEnemy(GetFilterUnit(), Player(0)) == true ))
endfunction

function Trig_Volcano_Damage_Actions takes nothing returns nothing
local real time = udg_VolcanoTime
local location target = udg_VolcanoTarget
local effect fire
local unit Target2
local group DamageGroup = GetUnitsInRangeOfLocMatching(300.00, target, Condition(function Trig_Volcano_Damage_Group))
call TriggerSleepAction( time )
call AddSpecialEffectLocBJ( target, "Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl" )
set fire = GetLastCreatedEffectBJ()
call TriggerSleepAction( 1.0 )
call DestroyEffectBJ( fire )
loop
set Target2 = GroupPickRandomUnit(DamageGroup)
exitwhen Target2 == null
call SetUnitLifeBJ( Target2, ( GetUnitStateSwap(UNIT_STATE_LIFE, Target2) - 40 ) )
call GroupRemoveUnitSimple( Target2, DamageGroup )
endloop
endfunction

//===========================================================================
function InitTrig_Volcano takes nothing returns nothing
local trigger Volcano_Target = CreateTrigger( )
set udg_VolcanoTriggers[1] = CreateTrigger( )
set udg_VolcanoTriggers[2] = CreateTrigger( )
set gg_trg_Volcano = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Volcano, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Volcano, Condition( function Trig_Volcano_Conditions ) )
call TriggerAddAction( gg_trg_Volcano, function Trig_Volcano_Actions )
call TriggerRegisterPlayerUnitEventSimple( Volcano_Target, Player(0), EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
call TriggerAddCondition( Volcano_Target, Condition( function Trig_Volcano_Target_Conditions ) )
call TriggerAddAction( Volcano_Target, function Trig_Volcano_Target_Actions )
call TriggerAddAction( udg_VolcanoTriggers[1], function Trig_Volcano_Attack_Actions )
call TriggerAddAction( udg_VolcanoTriggers[2], function Trig_Volcano_Damage_Actions )
endfunction
 
TRY TO COPY PASTE IN A MAP AND SEE IF IT WORKS.
THERE MIGHT BE SOMTHING SIMPLE IM NOT SEEING.
ALSO IF YOU WANT TO SEE MAP SO YOU CAN HELP THEN GIVE EMAIL... THNX
 
MAKE SURE YOU TAKE AWAY THE <-----HERE!!!!
OUT OF THE LINE IM HAVING PROBLEMS WITH.
 
rather than pasting all that code, you should just mention that you got it from darky's website and give a link to the spell.

My best guess is you haven't made a global point variable called "VolcanoLoc". Go into edit -> variables and do that and see if it fixes it.

edit: i think your caps lock key is stuck in the "on" mode.
 
thank you for your help darg.
just try not to be like simon in american idol
also can you help me with putting players 1,3,5,7,9,11
in a player group in variables and writing the trigger 4 is they kill (unit) they win
 
In player settings one can enable how many players a map can allow. There also one can make team settings.

For example:

Player 1: Open
Player 2: Open
Player 3: Open
Player 4: Open

Then in Team settings:

Team 1:

Player 1
Player 2

Team 2:

Player 3
Player 4

---

Now when 2 players join a map with those settings. They initially become Player 1 and Player 2.

But clicking on the Team 2 line, that player switches to first open spot in Team 2, hence becoming Player 3.

---

With that my trigger above has no problems in finding the players for the teams. If you do want to make it the way of splitting all equal numbers into Team 1 and all Unequal numbers into Team 2 it would have to be decided with in which order players join.

---

In the line where I wrote:

(Triggering unit) Equal to WinUnit

I created a variable named WinUnit, because I do not know which unit you want to be the unit that triggers the kill. If I were you I'd change that to Specific unit event and have it something like footman <001> dies, instead of having a condition to every unit dies.

In the event of the Owner of Killing Unit thing, here is the procedure:
New Action -> If / Then / Else -> Condition -> Player Comparison -> Press "Owner of (Triggering Unit)" -> Press "Triggering Unit" -> Find "Killing Unit" in the scroll down list.

Hope that helps
 
Well The triger is enabled now because i made the same variables in darkys map to mine but when i cast the spell nothing happens.......

I checked the import manager and in darkys map it says it uses 5
and in my map it says it uses 2
Does that mean that it is only using 2 variables?? instead of 5???
that would be this path file
ReplaceableTextures\CommandButtons\BTNVolcano.blp

how can i get this file to use all variables i guess...
i checked everything and it is same as darkys map.

is there any easyier way to have import all of his spefications to my map to get this spell to work..
plz
 
I figured out that line and got it to say 5 because i needed 3 custom wisps that was in his map ...i guess to make volcano effect.
but still no volcano when spell is cast. just units get silenced.
can someone download his volcano spell and tell me how to sucessfully transefer it to another map do it will work.
PLZ
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • A Andyoyo:
    Thank you for the hard work over the years. It did not go unnoticed.
  • U Uberplayer:
    Thanks for everything!
  • XXXconanXXX XXXconanXXX:
    And we JUST got a new warcraft 3 campaign after 20 years! Bummer lol. Thanks for building and maintaining such an awesome community over the years TheHelper! Forums like these are definitely a relic of their time, and in its heyday it really was the place to be in its niche. Hopefully the discord community stays active!
  • WildTurkey WildTurkey:
    All the best helper
  • WildTurkey WildTurkey:
    Thanks for what you have done for me and my family
  • WildTurkey WildTurkey:
    I wish you all the best and am saddened to say goodbye
  • The Helper The Helper:
    That is fantastic WildTurkey I am so happy to hear that! Bless you and your family!
  • The Helper The Helper:
    and i dont think I am going to close the site it is just likely to change drastically but I am working on something for the interim still fleshing it out. Most of the forums are going to be gone though and the NUON site and Warcraft sites will probably to to different hosts. I might keep the news forum though :)
    +1
  • The Helper The Helper:
    So I paired down the forums to what is going to be in the interim
  • The Helper The Helper:
    I might also just go for one news forum and make it Headline News only all that sub forum stuff was busy work on my part i think :)
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    I know right
    +1
  • Varine Varine:
    It's been great guys, I appreciate you having kept it up for so long! I feel like this has been a big part of my growing up in life, and I do very much appreciate everything that this forum has been able to give to me. So thank you.
    +2
  • Varine Varine:
    If there's bits still around I am willing to bet I will be, but I honestly wouldn't be too upset if some of my teenager posts were to no longer be around. I was a little fucking problem back then
    +1
  • Varine Varine:
    I'm going on a backpacking trip pretty soon. I've been trying to do it for a few years now and it just couldn't happen. I'll be by myself, and I think it'll be really good for me. My pack is already too heavy so I can't bring alcohol, and that might be a benefit to me. Like had that probation and couldn't drink, but it's a bit different when you can't do something voluntarily versus threat of literal imprisonment
    +1
  • Varine Varine:
    The trail is 40 miles altogether, but I'm planning on cutting cross country a bit because I want to camp on top of this mountain. I'm bringing a little telescope, if there's still a place for it I'll post some pictures when I get back!
    +2
  • jonas jonas:
    honestly there's nothing on that trip that would become better by drinking
  • jonas jonas:
    looking forward to those pictures
  • The Helper The Helper:
    Happy Thursday people! I think I have come up with a new direction for the site. One that will never fizzle out because a game is not popular anymore. I think I am going to try to make TheHelper.net a place that helps people with real stuff as much as it did with game technical support back in the day. Stay tuned...
    +3
  • The Helper The Helper:
    Happy Tuesday!
    +1
  • The Helper The Helper:
    Happy Thursday! Hope everyone has a Fantastic Day!
    +2
  • The Helper The Helper:
    Happy Thursday everyone. I hope everyone has a blessed day!

The Helper Discord

Members online

No members online now.

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top