You must be logged in to post messages.
Please login or register

Scenario Design
Moderated by Yeebaagooon, TAG

Hop to:    
Welcome! You are not logged in. Please Login or Register.6 replies
Age of Mythology Heaven » Forums » Scenario Design » Player Defeated Trigger not working correctly?
Bottom
Topic Subject:Player Defeated Trigger not working correctly?
Nilex
Mortal
posted 20 February 2019 07:19 PM EDT (US)         
I am currently making a scenario map and i have a trigger that grants a god power once one of the enemies is defeated.

But when the enemy surrenders and you accept their surrender you don't get the God power how can i fix this issue
AuthorReplies:
Izalith
Mortal
(id: Lilitu)
posted 21 February 2019 11:20 AM EDT (US)     1 / 6       
Are you asking for the correct player to be defeated?

Maybe resign doesn't count as defeat. You could try for "Player Active", but dunno if that'll work. :/

Azarath Metrion Zinthos

Steam: Order of Azarath
Twitch: twitch.tv/orderofazarath
Discord: Azarath @ https://discord.gg/3ENKJeb
nottud
Mortal
posted 21 February 2019 01:33 PM EDT (US)     2 / 6       
I think some trigger packs contains Player Resigned which might do the trick.

Player active triggers if you are playing as that player.

[This message has been edited by nottud (edited 02-21-2019 @ 01:34 PM).]

Nilex
Mortal
posted 21 February 2019 03:13 PM EDT (US)     3 / 6       
I tried the player aktiv one but (i might be doing something wrong) it didn't work because i also use a second timer trigger so you get the ability recharged every 500 sec.
So when i do the not tag for the triggers it changes all
making the timer not work at least i think.

Also where can i find these trigger packs
Izalith
Mortal
(id: Lilitu)
posted 21 February 2019 09:30 PM EDT (US)     4 / 6       
Ooh, rite, active was that o_o


I found some codes in the code reference which should help.
https://mythicfreak.github.io/aomcodereference/
inside xs.kb

kbHasPlayerLost(int playerID)
kbIsPlayerResigned(int playerID)
kbIsPlayerValid(int playerID)


This Condition should return true if the player is invalid, resigned or has lost: (I haven't tested it yet though, maybe I should ... o.o)


<Condition name="Player is Invalid or Resigned or Lost">
<Param name="Player" dispName="$$22301$$Player" VarType="player">1</Param>
<Command>for(criterion=0;>1){}</Command>
<Command>if(kbIsPlayerValid(%Player%) == false){ criterion = 1;}else{</Command>
<Command>if(kbIsPlayerResigned(%Player%) == true) criterion = 1;</Command>
<Command>if(kbHasPlayerLost(%Player%) == true) criterion = 1;}</Command>
<Expression>criterion == 1</Expression>
</Condition>


to install a condition you can add it to the typetest.xml conditions you already have, or make a new file.

A new file would be placed in your Aom/trigger2 folder and be named whatever.xml, make sure xml is the file type.

whatever.xml would have this content:

<?xml version = "1.0"?>
<trigger version="2">
<Conditions>
<Condition name="Player is Invalid or Resigned or Lost">
<Param name="Player" dispName="$$22301$$Player" VarType="player">1</Param>
<Command>for(criterion=0;>1){}</Command>
<Command>if(kbIsPlayerValid(%Player%) == false){ criterion = 1;}else{</Command>
<Command>if(kbIsPlayerResigned(%Player%) == true) criterion = 1;</Command>
<Command>if(kbHasPlayerLost(%Player%) == true) criterion = 1;}</Command>
<Expression>criterion == 1</Expression>
</Condition>
</Conditions>
<Effects>
</Effects>
</trigger>

feel free to indent properly.
In case you know about xml/coding a bit, the "for-loop" is just to create a variable criterion = 0.

Azarath Metrion Zinthos

Steam: Order of Azarath
Twitch: twitch.tv/orderofazarath
Discord: Azarath @ https://discord.gg/3ENKJeb

[This message has been edited by Izalith (edited 02-22-2019 @ 00:00 AM).]

Nilex
Mortal
posted 22 February 2019 01:15 AM EDT (US)     5 / 6       
Thank you so much this fixes my problem.

Follow up question if i end up sharing the scenario do people who want to play the scenario also need this trigger installed or not?
scragins
Heretic of December
posted 22 February 2019 03:16 AM EDT (US)     6 / 6       
No, it is all saved in the scx file.
You must be logged in to post messages.
Please login or register

Hop to:    

Age of Mythology Heaven | HeavenGames