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.1 reply
Age of Mythology Heaven » Forums » Scenario Design » Set player for condition "Unit Selected"
Bottom
Topic Subject:Set player for condition "Unit Selected"
Rusink
Mortal
posted 11 July 2019 06:40 AM EDT (US)         
Hi all.

I would like someone to help me.
I am creating a multiplayer map to play with my friends, and I want that when player 2 selects its city center, create X unit, but currently it is not possible since the "Unit Selected" condition works globally, but I do not want that player 1 create the units of player 2, it should not be like that.

What options are there?

I tried to edit the condition "Unit Selected" from the file 'typetest.xml' and it was as follows:


<Condition name="$$22337$$Unit Selected">
<Param name="SrcObject" dispName="$$22314$$Source Unit" VarType="unit">default</Param>
<Param name="Player" dispName="$$22301$$Player" VarType="player">1</Param>
<Command>trUnitSelectClear();</Command>
<Command>trUnitSelect("%SrcObject%");</Command>
<Expression>trUnitIsSelected(%Player%)</Expression>
</Condition>

When I did this and opened the editor, the condition now allowed me to choose the player, so I set it up and tried the scenario, but it just did not work. The engine that is responsible for firing the triggers broke completely and stopped working for all the triggers.

Please help!!

[This message has been edited by Rusink (edited 07-11-2019 @ 06:42 AM).]

AuthorReplies:
nottud
Mortal
posted 11 July 2019 08:19 PM EDT (US)     1 / 1       
Unit selected actually doesn't trigger global which can be the cause of sync errors. Yes you can't just add player to the command as the command with that version does not exist.

<Condition name="Player Current">
<Param name="info" dispName="Info" VarType="string">Use to apply effects only to a particular player in multiplayer</Param>
<Param name="Param1" dispName="Player" VarType="string">1</Param>
<Expression>trCurrentPlayer() == %Param1%</Expression>
</Condition>
This condition makes a trigger only occur for a player but should generally only be used for non gameplay changing things otherwise you can get a sync error.

My advice:
Use a shop style system instead for multiplayer which is the generally widely used way. Shop style systems work by having blue tiles which you send a unit to to "choose" the item adjacent to the square. People generally set aside a small area of the map to crease such an enclosed area and use a harmless unit like an old man as the chooser. For activating I usually put a cinematic block on the tile and then do a test that it contains an old man to trigger the effect.

[This message has been edited by nottud (edited 07-11-2019 @ 08:19 PM).]

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

Hop to:    

Age of Mythology Heaven | HeavenGames