I have the latest newXeditor and the latest somenewtriggers, and I need to know how to do a something with the triggers. (or how to make a new trigger/condition to do it)
I need a condition along the lines of "Is Dead by Type", so I can have it give a reward for each kill of any enemy unit of a kind (like 50 gold for each Minotaur kill, etc.).
There are a couple other "Is Dead" conditions, but I'd either have to do a new trigger for every monster on the level, or group them up in to like 3 or 5 of each (and still do a lot of triggers). There is also the "Is Dead by Name", but that doesn't seem to work (the same way).
Author
Replies:
PrplPplEater Mortal
posted 23 July 2006 10:40 PM
EDT (US)
1 / 10
This should be in the modding section, although it is scenario design, it's a request for a new trigger.
I'll write it just a sec...
Ok here it is. I'm very new to trigger creation (started today) so it might not work right. I haven't tested it but if I'm wrong, could someone tell me please? I am trying to introduce a few new triggers to the database (Disable Trigger by Select, Fire Event by Name...).
<Condition name="Is Dead by Protounit"> <Param name="ProtoUnit" dispName="$$22449$$ProtoUnit" varType="protounit">Villager</Param> <Command>trUnitSelectClear();</Command> <Command loop="" loopParm="SrcObject">trUnitSelect("%ProtoUnit%");</Command> <Expression>trUnitDead()==true</Expression> </Condition>
Put that in right before </Conditions>
If it doesn't show up, it's because of the numbers. I can't figure out what I should make them.
ps. Are there any good guides for trigger modding? Just curious.
Change the 'unit cost gold' of the unit by using the 'modify protounit' effect. Every time the player makes a kill, the unit cost of the defeated foe will be added to the player's stat 'Units killed cost'. This stat can be monitored with use of the 'QV stat value' condition.
I read Dr. Nick's guide. I learned about some new varTypes but that's about it. I already code a lot of sites with XML so that might be why I learned some of it. But I missed that...wow. I'm really kindof embarassed. Ok none of you say that ok?
I guess I just f*cked that one up...LOL
I guess I'll go fix it. It's a whole lot easier to use than QVs I'm sure.
I got it all implemented and working, I just have one tiny problem... The values display as something like "20.000000" instead of "20" in the messages ("You got a reward of 20.000000 gold from killing an enemy!"), is there a way to get it to only display the numbers before the decimal point?
Edit: I've been looking around and apparently there's no real way to fix it. But I've also saw one or two mention to make a QV as an integer, and try giving it the value from the other QV to convert it... Would this be possible, and if it is, how do I do it?
[This message has been edited by Phoenixx86 (edited 07-24-2006 @ 11:37 PM).]
TrituateXH53 Mortal
posted 25 July 2006 00:44 AM
EDT (US)
8 / 10
Quote:
Thanks for the catch!
No problem.
Quote:
I guess I'll go fix it. It's a whole lot easier to use than QVs I'm sure.
Just curious, but did you get it to work? Because everytime I make an effet involving ProtoUnit, it doesn't seem to work. I mean, everything shows up in the editor, but the effect itself doesnt work on the selected protounit.
greyshark Mortal
posted 25 July 2006 07:00 AM
EDT (US)
9 / 10
Hi again!
I'm afraid that I don't know of a way to display QV values without the decimal points. I don't think there is one!
(Also, may I politely enquire as to whose method you are using? Mine, or PrplPplEater's??)
[This message has been edited by greyshark (edited 07-25-2006 @ 07:02 AM).]
Phoenixx86 Mortal
posted 25 July 2006 07:27 AM
EDT (US)
10 / 10
Yours, the other way didn't work (with "srcObject" replaced with "ProtoUnit", killing the enemy didn't do anything).
I have it set up so the enemies give 1/2 the experience also as gold, 1/4 as food, and 1/20 as favor. So an enemy that only gives 20 experience will also reward the player with 10 gold, 5 food, and 1 favor. An big enemy that gives 100 experience would give 50 gold, 25 food, and 5 favor, etc. I have the kill message to just display the experience gain/total, since the game automatically displays the resources received.
(For wood, besides buying it at the Market, things like the siege units, ships, and buildings will have a seperate trigger that gives wood in addition to what the experience trigger gives of the other resources.)