• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Victory/Defeat Contidion

Status
Not open for further replies.
Level 3
Joined
Apr 6, 2007
Messages
45
Coz of custom TownHalls I made, I had to remove "Melee Game - Victory/Defeat Conditions" coz it would reveal position to enemy...So now i need trigger that is allmost same to original trigger which i could change to recognize my townhalls and doesn't reveal me to enemy, and with conditions what needs to be done so you are Victorius or Defeated.

PLEASE HELP....
 
Level 9
Joined
Jul 27, 2006
Messages
652
I might be completely wrong here but if you base your townhall off an existing townhall it should work with using the defult Victory/Defeat conditions?
Or you could add the town hall classification to you unit (i think o_O)
Theres no need to recreate Victory/Defeat conditions IMO...
Hope this helps.
 
Level 7
Joined
Dec 26, 2006
Messages
303
Kixer, in the melee game if your town hall destroyed but there's some farm or tower left the building will revealed in next 3 minutes.. That's what he mean for
Anyway you're right, he don't need to change the victory/defeat condition

If you don't want the position revealed all you have too do is:
-Hide your minimap display
-Make all map into black mask when game beginning
-Set all of your buildings category into townhall

Really mess, don't know which one really needed for your request.. Try all of it should make it works but not all of it needed
 
Level 9
Joined
Jul 27, 2006
Messages
652
@Cool, i know how a melee game works, i play melee all the time and the best way to do what he wants and keep the game a melee is to add the town hall classification to his custom town hall. Thats all you need to do.
 
Level 7
Joined
Dec 26, 2006
Messages
303
No Kixer, you don't get it... If the custom town hall is destroyed it will reveal all buildings left, all he need is make all buildings as town hall

Off-Topic: I really fell better when we talk each other which one is better, we do this twice and this is the third time.. Can't wait the cahllenge section re-open
 
Level 9
Joined
Jul 27, 2006
Messages
652
Cool, in a melee game you are MENT to be revealed if you dont have a town hall, his problem is that he is revealed even whem his custom town hall is alive.
[Offtopic] You cant wait to lose?:wink: Never heard that one before! My spells are going to PAWN yours!
 
Level 7
Joined
Dec 26, 2006
Messages
303
Should stop this, each time we talk which one better in thread of some1 need help will only make him confuse and not help him.. Make it simple for him: the right one is post xx, or some look lik it...

Off-Topic: Keep in good mood Kixer, you can't even defeat my created 1 sec maps if you in bad mood.. Only in good mood you can defeat me.. Have any new news about the challenge section??
 
Level 9
Joined
Jul 27, 2006
Messages
652
Ok, all you need to know is in the 2nd post, the rest is slightly offtopic discussion.
[offtopic] No news yet...
 
Level 3
Joined
Apr 6, 2007
Messages
45
Guys thing i want is like this: I made Custom TownHall which is TempleOfTides, i made classification TownHall and i put him in gameplay constants...But again when i click on my Race Select system menu Naga i get their TempleOfTides and everything is normal but says for example "You will be revealed if u dont build Tree Of Ages".

I want to be revealed if i dont have townhall (TempleOfTides) but I do have it....i hope u understand my problem.

I want it to be just like Normal Melee only that it recognizes my townhall (Level1 - TempleOfTides, Level2 - WaterSanctuary, Level3 - CoralPalace)
 
Level 3
Joined
Apr 6, 2007
Messages
45
Tried that to...It is to complicated coz i would need to edit all 4 townhalls....not working.

EDIT: Looks like game only wants original techtree townhall..Please some ideas. I cant afford editing none of other townhalls coz i need them....And when i make new custom unit trought them it doesnt work.
 
Level 7
Joined
Dec 26, 2006
Messages
303
Well.. If you said about the townhall techtree actually you can edit it even to level 9 nine (they call it tier 1, 2 , 3..) at the database, maybe you should put your buildings right here??
 
Level 3
Joined
Apr 6, 2007
Messages
45
I have idea for trigger. But i am not so good with complicated triggers so i would appreciate help:

Something like this:
Event - A unit begins construction
Contitions - Type of Unit equal to TempleOfTides
Actions - (Somehow with custom script or variable) Set Number of townhalls +1


If anybody can make code PLEASE PLEASE PLEASE.
 
Level 6
Joined
Sep 19, 2006
Messages
130
Ok remove victory and defeat action in initilization and make a trigger that looks like this...

<Trigger>
Vitory Defeat
Events
Unit - A unit Dies
Conditions
And - All (Conditions) are true
Conditions
((Dying unit) is A structure) Equal to True
(Number of units in (Units owned by (Owner of (Dying unit)) matching ((Owner of (Matching unit)) Equal to (Owner of (Dying unit))))) Less than or equal to 1
Actions
Game - Defeat (Owner of (Dying unit)) with the message: Defeat!
</Trigger>
Then what ever elce you want to put in the trigger... this should work if you want a demo map of this just say so...
 
Level 15
Joined
Feb 15, 2006
Messages
851
The reason why Victory / defeat conditions doesn't work is because this action loads a set of functions and hidden triggers which by default detects how is the situation with all the players.

The Town hall issue is predefined there.

So you have only one solution: to trigger ALL the victory and defeat conditions. Which is a long code in JASS.

The other choice is to copy the JASS code of this action and modify the parts where is needed. That was my solution for my map project, and now it works perfectly.

To give you a short idea about the work involved in this, check the victory / defeat action code:

JASS:
function MeleeInitVictoryDefeat takes nothing returns nothing
    local trigger    trig
    local integer    index
    local player     indexPlayer

    // Create a timer window for the "finish soon" timeout period, it has no timer
    // because it is driven by real time (outside of the game state to avoid desyncs)
    set bj_finishSoonTimerDialog = CreateTimerDialog(null)

    // Set a trigger to fire when we receive a "finish soon" game event
    set trig = CreateTrigger()
    call TriggerRegisterGameEvent(trig, EVENT_GAME_TOURNAMENT_FINISH_SOON)
    call TriggerAddAction(trig, function MeleeTriggerTournamentFinishSoon)

    // Set a trigger to fire when we receive a "finish now" game event
    set trig = CreateTrigger()
    call TriggerRegisterGameEvent(trig, EVENT_GAME_TOURNAMENT_FINISH_NOW)
    call TriggerAddAction(trig, function MeleeTriggerTournamentFinishNow)

    // Set up each player's mortality code.
    set index = 0
    loop
        set indexPlayer = Player(index)

        // Make sure this player slot is playing.
        if (GetPlayerSlotState(indexPlayer) == PLAYER_SLOT_STATE_PLAYING) then
            set bj_meleeDefeated[index] = false
            set bj_meleeVictoried[index] = false

            // Create a timer and timer window in case the player is crippled.
            set bj_playerIsCrippled[index] = false
            set bj_playerIsExposed[index] = false
            set bj_crippledTimer[index] = CreateTimer()
            set bj_crippledTimerWindows[index] = CreateTimerDialog(bj_crippledTimer[index])
            call TimerDialogSetTitle(bj_crippledTimerWindows[index], MeleeGetCrippledTimerMessage(indexPlayer))

            // Set a trigger to fire whenever a building is cancelled for this player.
            set trig = CreateTrigger()
            call TriggerRegisterPlayerUnitEvent(trig, indexPlayer, EVENT_PLAYER_UNIT_CONSTRUCT_CANCEL, null)
            call TriggerAddAction(trig, function MeleeTriggerActionConstructCancel)

            // Set a trigger to fire whenever a unit dies for this player.
            set trig = CreateTrigger()
            call TriggerRegisterPlayerUnitEvent(trig, indexPlayer, EVENT_PLAYER_UNIT_DEATH, null)
            call TriggerAddAction(trig, function MeleeTriggerActionUnitDeath)

            // Set a trigger to fire whenever a unit begins construction for this player
            set trig = CreateTrigger()
            call TriggerRegisterPlayerUnitEvent(trig, indexPlayer, EVENT_PLAYER_UNIT_CONSTRUCT_START, null)
            call TriggerAddAction(trig, function MeleeTriggerActionUnitConstructionStart)

            // Set a trigger to fire whenever this player defeats-out
            set trig = CreateTrigger()
            call TriggerRegisterPlayerEvent(trig, indexPlayer, EVENT_PLAYER_DEFEAT)
            call TriggerAddAction(trig, function MeleeTriggerActionPlayerDefeated)

            // Set a trigger to fire whenever this player leaves
            set trig = CreateTrigger()
            call TriggerRegisterPlayerEvent(trig, indexPlayer, EVENT_PLAYER_LEAVE)
            call TriggerAddAction(trig, function MeleeTriggerActionPlayerLeft)

            // Set a trigger to fire whenever this player changes his/her alliances.
            set trig = CreateTrigger()
            call TriggerRegisterPlayerAllianceChange(trig, indexPlayer, ALLIANCE_PASSIVE)
            call TriggerRegisterPlayerStateEvent(trig, indexPlayer, PLAYER_STATE_ALLIED_VICTORY, EQUAL, 1)
            call TriggerAddAction(trig, function MeleeTriggerActionAllianceChange)
        else
            set bj_meleeDefeated[index] = true
            set bj_meleeVictoried[index] = false

            // Handle leave events for observers
            if (IsPlayerObserver(indexPlayer)) then
                // Set a trigger to fire whenever this player leaves
                set trig = CreateTrigger()
                call TriggerRegisterPlayerEvent(trig, indexPlayer, EVENT_PLAYER_LEAVE)
                call TriggerAddAction(trig, function MeleeTriggerActionPlayerLeft)
            endif
        endif

        set index = index + 1
        exitwhen index == bj_MAX_PLAYERS
    endloop

    // Test for victory / defeat at startup, in case the user has already won / lost.
    // Allow for a short time to pass first, so that the map can finish loading.
    call TimerStart(CreateTimer(), 2.0, false, function MeleeTriggerActionAllianceChange)
endfunction
 
Level 3
Joined
Apr 6, 2007
Messages
45
Hm i am not good with Jass....I would prefer this in simple triggers. But THX Moyack i will try to do something.
And thx again for that cool naga model.....perfect fit in my map.
 
Status
Not open for further replies.
Top