pftq.com
Welcome! Please Login or Register!
November 23, 2024, 02:08:14 AM
Home Login Register
pftq Forums  |  Game Design  |  Age of Empires III  |  Need help creating a ?Flare Unit? Effect 0 Members and 2 Guests are viewing this topic. « previous next »
Latest News!Lunar Trigger(Aug 27, 2023)
Pages: 1 2 3 [4] 5 6 Print
Author Topic: Need help creating a ?Flare Unit? Effect  (Read 33704 times)
MosheLevi
Member
*****
Offline Offline

Posts: 28

« Reply #45 on: June 18, 2008, 02:12:42 PM »

Quote
Depending on how your scenario is set up, you'd have to develop a trick/system to determine whether the player is still active.  If the current "Player Defeated" does not work, you're unlikely to find another command for it.

When a player resigns from the game "Player Defeated" is NOT being set.

Did you have the same problem with AOM?
If so, what did you guys use to determine if the player is still active?

Quote
#1: QV Set Unit OBJECT ID in Area (Center Unit) to detect the Janissary and save the unit's ID (NOT unit type ID) to a QV
#2: XS - Units in Area and plug the QV ID in as the center unit.
so basically #1 finds your janissary and #2 uses the janissary as the center for Units in Area.

Makes sense.
How would this work if there are two or more units in the area?
Would only the first unit work?
How do I run this in a loop? Just a simple ?Loop? in the first trigger and firing the second trigger after that?

For lag reducing purposes, would it be better if I split the map to several zones and have separate triggers for each area? or can I just do this for the entire map?
Logged
pftq
Administrator
*****
Offline Offline



Posts: 4204

WWW
« Reply #46 on: June 18, 2008, 05:23:32 PM »

Entire map.

There is an index feature iin the QV Set - the index determines if it's the first unit found etc.  You can have it loop and the index increase by one each time.

That's what I meant for the player defeated; you would have to come up with an alternative (ie.. find something unique to the player that stops working once resigned and attach a trigger to that).
Logged
MosheLevi
Member
*****
Offline Offline

Posts: 28

« Reply #47 on: June 19, 2008, 10:08:39 AM »

Quote
There is an index feature in the QV Set - the index determines if it's the first unit found etc.  You can have it loop and the index increase by one each time.

Is that mean that I need to create a new effect for this?
Or can I still use the 2 effects you mentioned above?

Random22,

I think this is a task for you. Lol.
My knowledge about this script language is still limited.

Can this task be performed via ONE customized effect?

Quote
That's what I meant for the player defeated; you would have to come up with an alternative (ie.. find something unique to the player that stops working once resigned and attach a trigger to that).

The only way I can check that is if there was a condition that checks if all units are Idle (villagers and Military), but I don?t think we have a condition for that.

Can such Condition be created?
Can we check if units are idle?
Logged
pftq
Administrator
*****
Offline Offline



Posts: 4204

WWW
« Reply #48 on: June 19, 2008, 10:36:09 AM »

No new effect.  Just add in QV Modify (Add 1 to the QV each time you loop)

Then for the index field, you'd put trQuestVarGet("Name of your QV")

Of course, to stop the loop, you'd want the condition to be QV Check (make sure your QV is never higher than the number of times you want to loop)

There is no point to creating a new customized effect if it can be done in 3 or so existing effects.


As for checking whether units are idle, you can use "XS - QV Set Distance to Unit".  Wait a few seconds and if the QV # is the same (ie distance hasn't changed) then you can assume it hasn't moved.
Logged
MosheLevi
Member
*****
Offline Offline

Posts: 28

« Reply #49 on: June 19, 2008, 11:20:23 AM »

Quote
Your second request is already do-able with existing triggers from the Advanced Triggers Set:

#1: QV Set Unit OBJECT ID in Area (Center Unit) to detect the Janissary and save the unit's ID (NOT unit type ID) to a QV
#2: XS - Units in Area and plug the QV ID in as the center unit.

so basically #1 finds your janissary and #2 uses the janissary as the center for Units in Area.

There is an index feature in the QV Set - the index determines if it's the first unit found etc.  You can have it loop and the index increase by one each time.

Just add in QV Modify (Add 1 to the QV each time you loop)

Then for the index field, you'd put trQuestVarGet("Name of your QV")

Of course, to stop the loop, you'd want the condition to be QV Check (make sure your QV is never higher than the number of times you want to loop)

I am not following you.
I am not sure I am familiar with the index feature in the QV Set.
I never used QV with an index before.

Do you have an example for that?

Quote
As for checking whether units are idle, you can use "XS - QV Set Distance to Unit".  Wait a few seconds and if the QV # is the same (ie distance hasn't changed) then you can assume it hasn't moved.

But I don?t know what units the player has and where he has them.

Do you know if the condition ?Player Active? works and what it is for?

What about resources.
I can check how much resources the player has every 15 seconds and store them into a QV.
If the amount of resources hasn?t change then the player must be idle.

Logged
pftq
Administrator
*****
Offline Offline



Posts: 4204

WWW
« Reply #50 on: June 19, 2008, 11:33:24 AM »

Yup that's what I meant - use other conditions to "guess" whether the player is resigned.

There is no index feature in the QV.  The index feature is in the QV Set Unit OBJECT ID in Area (Center Unit).  You use the QV (a number) to determine the index of the Area effect.

Set up the trigger as I have shown and you'll have a better understanding of it (test it to figure out what's going on).
Logged
Random22
Member
*****
Offline Offline



Posts: 33

WWW
« Reply #51 on: June 20, 2008, 08:32:09 AM »

I will be able to make it!!!!!

Its Random22  Tongue
Logged

-Random22^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Thats Right More Random22 Signature Wink
MosheLevi
Member
*****
Offline Offline

Posts: 28

« Reply #52 on: June 20, 2008, 09:45:13 AM »

Quote
Your second request is already do-able with existing triggers from the Advanced Triggers Set:

#1: QV Set Unit OBJECT ID in Area (Center Unit) to detect the Janissary and save the unit's ID (NOT unit type ID) to a QV
#2: XS - Units in Area and plug the QV ID in as the center unit.

so basically #1 finds your janissary and #2 uses the janissary as the center for Units in Area.

There is an index feature in the QV Set - the index determines if it's the first unit found etc.  You can have it loop and the index increase by one each time.

Just add in QV Modify (Add 1 to the QV each time you loop)

Then for the index field, you'd put trQuestVarGet("Name of your QV")

Of course, to stop the loop, you'd want the condition to be QV Check (make sure your QV is never higher than the number of times you want to loop)

There is no index feature in the QV.  The index feature is in the QV Set Unit OBJECT ID in Area (Center Unit).  You use the QV (a number) to determine the index of the Area effect.

Set up the trigger as I have shown and you'll have a better understanding of it (test it to figure out what's going on). .

I still don't follow how the Index plays out here.

These are the parms for "XS - QV Set Unit OBJECT ID in Area" effect.

Code:
  <Effect name="XS - QV Set Unit OBJECT ID in Area (Center Unit)">
  <Param name="QVName" dispName="QV" varType="string">QV1</Param>
  <Param name="index" dispName="Index (first unit is 0)" varType="string">0</Param>
  <Param name="Object" dispName="Center Unit OBJECT ID" varType="string">0</Param>
   <Param name="FromPlayer" dispName="Player (99 for ALL)" varType="string">99</Param>
   <Param name="UnitId" dispName="Unit Type ID (Optional)" varType="string">-1</Param>
   <Param name="actionid" dispName="Action ID (Optional)" varType="string">-1</Param>
   <Param name="Dst" dispName="Radius (-1 for ALL)" varType="string">10</Param>

Are you saying that the QV in this effect is actually an array because of the associated Index?
Do I run it once or do I put it in a loop according to the number of units on the map?
If so, how do I bump the index by 1 every time? Shouldn't I change the Index parm from a "String" to QV?
But that requires modifying the effect itself.

Then how do I make the 'XS - Convert/Change Units in Area' effect work?
After all the QV here has no Index.
I am assuming I need to pass the value from the QV with the index to the QV without the index but I don't have an "Effect" for that.

Also the "Center Unit OBJECT ID" here is a string NOT a QV which means that I need to modify this effect.

Code:
<Effect name="XS - Convert/Change Units in Area (Center Unit)">
<Param name="Object" dispName="Center Unit OBJECT ID" varType="string">0</Param>
<Param name="Dst" dispName="Radius" varType="string">10.0</Param>
<Param name="UnitId" dispName="Unit Type ID (Optional)" varType="string">-1</Param>
<Param name="FromPlayer" dispName="From Player or 99 for ALL" varType="string">99</Param>
<Param name="ToPlayer" dispName="To Player" varType="string">0</Param>
<Param name="ChangeUnit" dispName="Change Protounit Type" varType="string">Do Not</Param>
<Param name="Booler" dispName="Include Center Unit" varType="bool">false</Param>
« Last Edit: June 20, 2008, 09:57:36 AM by MosheLevi » Logged
pftq
Administrator
*****
Offline Offline



Posts: 4204

WWW
« Reply #53 on: June 21, 2008, 08:21:45 AM »

Don't modify any effect.  Just set this up in the scenario editor.

#1:
QV Set Unit OBJECT ID in Area (Center Unit)
- QV: QVID (The QV Name you want to save the UNIT ID to.  Nothing to do with index!)
- Index: trQuestVarGet("IndexQV")
- etc
Fire Event #2
#2:
XS - Units in Area.
- Center Unit: kbGetBlockID(""+1*trQuestVarGet("QVID"))
QV Modify: QVID +1
Fire Event #1

Understand now? Set it up that way and play with it.
« Last Edit: June 21, 2008, 08:23:56 AM by pftq » Logged
Random22
Member
*****
Offline Offline



Posts: 33

WWW
« Reply #54 on: June 21, 2008, 06:22:23 PM »

Help, Im lost...

Embarrassed  Shocked Random22  Shocked Embarrassed
Logged

-Random22^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Thats Right More Random22 Signature Wink
MosheLevi
Member
*****
Offline Offline

Posts: 28

« Reply #55 on: June 24, 2008, 02:36:14 PM »

I think we misunderstand each other, lol.

I have 50 horses around the map that can be mounted by various units.
So if I bring any Janissary next to any one of these horses I want to change the horse to Mameluke and destroy the Janissary creating the "Mounting" effect.

I can do that with 50 triggers of "Change/Convert Units in Area" with the horse as the center unit.

Now I want to take this further and have 1 trigger that can handle all these horses.
Bumping the Unit Type by 1 every time via the "QV Modify: QVID +1" doesn?t help me because I want to allow horse mounting only for specific units (e.g. Janissary).

So I need to have one trigger that runs in a loop 50 times and that finds out the 50 Object Id's (for the horses) and stores them into one QV with an index (1-50).
I then need to fire the "Change/Convert Units in Area" 50 times, where every time I will bump the index by 1 (with the same QV) in order to fire this trigger with a different Object Id.

So, can I do it that way?
Can I utilize Indexes in triggers?

Logged
pftq
Administrator
*****
Offline Offline



Posts: 4204

WWW
« Reply #56 on: June 24, 2008, 05:22:22 PM »

You're not bumping the Unit Type up by one.  You're bumping the search index by one.  So it'll do use Horse 1 as center, Horse 2, Horse 3, etc.

Have you tried it yet?
Logged
MosheLevi
Member
*****
Offline Offline

Posts: 28

« Reply #57 on: June 25, 2008, 11:27:17 AM »

Quote
You're not bumping the Unit Type up by one.  You're bumping the search index by one.  So it'll do use Horse 1 as center, Horse 2, Horse 3, etc.

Have you tried it yet?

OK, Now I got you lol.

Quote
#1:
QV Set Unit OBJECT ID in Area (Center Unit)
- QV: QVID (The QV Name you want to save the UNIT ID to.  Nothing to do with index!)
- Index: trQuestVarGet("IndexQV")
- etc
Fire Event #2
#2:
XS - Units in Area.
- Center Unit: kbGetBlockID(""+1*trQuestVarGet("QVID"))
QV Modify: QVID +1
Fire Event #1

I thought that - QV: QVID (The QV Name you want to save the UNIT ID to) and the - Center Unit: kbGetBlockID(""+1*trQuestVarGet("QVID")) is the same QV.

So if I understand it right it should look like this:
Code:
Trigger #1: "Find OBJECT ID for all horses"
Effect: "XS - QV Set Unit OBJECT ID in Area (Center Unit)"
Param name="QVName" dispName="QV" varType="string">QVH
- QV: QVH (The QV Name to store the Object id?s for the horses)
Param name="index" dispName="Index (first unit is 0)" varType="string">QVI</Param>
- Index: trQuestVarGet("IndexQVI") (QVI is the index for QVH)
- Fire Event #2

Trigger #2: "Change/Convert the Horse to a Mameluke".
Effect name="XS - Convert/Change Units in Area (Center Unit)
Param name="Object" dispName="Center Unit OBJECT ID" varType="string">QVH

But in trigger #2 we are missing the QVI Index.
This trigger has no index so bumping up the QVI index won?t do any good.

I need a trigger to copy QVH(QVI) into another QV to make this trigger work.

Any idea how to do that?

I will test these triggers when it all makes sense to me.
There is no use to do this otherwise.
« Last Edit: June 25, 2008, 11:29:22 AM by MosheLevi » Logged
pftq
Administrator
*****
Offline Offline



Posts: 4204

WWW
« Reply #58 on: June 25, 2008, 05:19:12 PM »

Test the triggers first and you'll see... Tongue

QVI has no reason to stray to Trigger 2.  QVI is just a number.. an index.

QVH is the UNIT that Trigger 2 uses.  QVI in Trigger 1 decides WHICH UNIT is saved to QVH, which is then used in Trigger 2.
Logged
MosheLevi
Member
*****
Offline Offline

Posts: 28

« Reply #59 on: June 30, 2008, 10:22:51 AM »

Hi pftq,

I spent many hours this past weekend trying to solve several issues that came up in the scenario I am working on now.
All these issues are as a result of CSO bugs.

It appears that none of the ?Move? effects work for Gaia units online.
They only work for single player scenarios.

In addition to that I had problems with the ?Change/Convert Units in Area (Center Unit).
This effect changed all the units in the entire map ignoring the radios specifications.
After several hours I realized this happened when the center unit died.
Once I added ?Is alive? conditions that one got fixed.

So I didn?t have time to test your triggers suggestions.
I need them for my next scenario (if I ever find the strength to continue working with this buggy Editor).

I found a way around the ?Gaia Move? triggers but I wasted the entire weekend trying to solve these two issues.

I still have one issue left:
?Change/Convert Units in Area (Center Unit)? works for one Unit ID at a time or all of them.
I would like to use it but to exclude buildings.
Either that or find a way to use it only for Military units.
Any idea how I can do that?

I don?t think there is a Unit Id for Military units, is there?
Logged
Pages: 1 2 3 [4] 5 6 Print 
pftq Forums  |  Game Design  |  Age of Empires III  |  Need help creating a ?Flare Unit? Effect « previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2006-2007, Simple Machines | RSS Feed Valid XHTML 1.0! Valid CSS!
Page created in 0.128 seconds with 21 queries.