Making a scenario I need help with

United States of America MoneyMan
Crossbow
Posts: 14
Joined: Dec 23, 2016

Making a scenario I need help with

Post by MoneyMan »

Hi! I'm trying to make it make code work. It won't work. I click a button that sends a tech. Here is the code:

<gadget name="churchmercantilismlabel" size1024="530 455 563 486" transparent="" textcentervert="" z="301" textcenterhoriz="" type="formatText" textcolor="255 255 255" textfontsize="12" textfont="Arial">
</gadget>
<gadget name="ChurchMercantilism" type="button" size1024="530 455 563 486" z="300" mouseovertext="Shipments available!" foreground="ui\techs\mercantilism\mercantilism" sound="UI_DefaultPregameClickSet" activateondown="">
<Effect name="Set ChurchMercantilism">
<Param name="PlayerID" dispName="$$22301$$Player" VarType="player">1</Param>
<command>if (trTechStatusActive(1, 389) trTechStatusActive(2, 389) trTechStatusActive(3, 389) trTechStatusActive(4, 389) trTechStatusActive(5, 389) trTechStatusActive(6, 389) trTechStatusActive(7, 389) trTechStatusActive(8, 389))
trTechSetStatus(1, 389, 2) trTechSetStatus(2, 389, 2) trTechSetStatus(3, 389, 2) trTechSetStatus(4, 389, 2) trTechSetStatus(5, 389, 2) trTechSetStatus(6, 389, 2) trTechSetStatus(7, 389, 2) trTechSetStatus(8, 389, 2);</command>
</Effect>
</gadget>

Sadly it still wont work if I click the icon!!! Can someone please help me???
User avatar
Malaysia Aizamk
Pro Player
ESOC WarChiefs Classic 2017
Posts: 1459
Joined: Feb 26, 2015
Location: ded

Re: Making a scenario I need help with

Post by Aizamk »

A majority of trigger commands cannot be called directly from UIs. This includes any command starting with kb, xs, or tr. Additionally commands in UI simply execute sequentially. 'if' statements and the like do not get processed, and there is no real syntax to it aside from completing the brackets.
oranges.
United States of America MoneyMan
Crossbow
Posts: 14
Joined: Dec 23, 2016

Re: Making a scenario I need help with

Post by MoneyMan »

Aizamk wrote:A majority of trigger commands cannot be called directly from UIs. This includes any command starting with kb, xs, or tr. Additionally commands in UI simply execute sequentially. 'if' statements and the like do not get processed, and there is no real syntax to it aside from completing the brackets.

Is there a way to fix that with a scenario?
User avatar
Malaysia Aizamk
Pro Player
ESOC WarChiefs Classic 2017
Posts: 1459
Joined: Feb 26, 2015
Location: ded

Re: Making a scenario I need help with

Post by Aizamk »

The majority of the code can be isolated to a custom trigger in the scenario, with the UI simply firing an event to which a handler is assigned. Refer to age of mythology forums for hotkey mappings to fire trigger-assigned events, and apply the same logic to UIs.
oranges.
United States of America MoneyMan
Crossbow
Posts: 14
Joined: Dec 23, 2016

Re: Making a scenario I need help with

Post by MoneyMan »

Aizamk wrote:The majority of the code can be isolated to a custom trigger in the scenario, with the UI simply firing an event to which a handler is assigned. Refer to age of mythology forums for hotkey mappings to fire trigger-assigned events, and apply the same logic to UIs.

Can you copy and past the code here? I'm trying to make where you can click a button and it happens.
User avatar
Netherlands edeholland
ESOC Community Team
Donator 01
Posts: 5033
Joined: Feb 11, 2015
ESO: edeholland
GameRanger ID: 4053888
Clan: ESOC

Re: Making a scenario I need help with

Post by edeholland »

I know @edehollandsbrother has a lot of experience with sending techs in scenario's
User avatar
Netherlands Mr_Bramboy
Retired Contributor
Donator 01
Posts: 8219
Joined: Feb 26, 2015
ESO: [VOC] Bram
Location: Amsterdam

Re: Making a scenario I need help with

Post by Mr_Bramboy »

Who is online

Users browsing this forum: No registered users and 21 guests

Which top 10 players do you wish to see listed?

All-time

Active last two weeks

Active last month

Supremacy

Treaty

Official

ESOC Patch

Treaty Patch

1v1 Elo

2v2 Elo

3v3 Elo

Power Rating

Which streams do you wish to see listed?

Twitch

Age of Empires III

Age of Empires IV