|
River_God
Member
Offline
Posts: 184
|
|
« Reply #76 on: November 01, 2007, 02:18:33 PM » |
|
OK I have been playing around in scenario editor to get better with triggers. This is the trigger I planned on using for the Victory trigger. It is for player one only(once I get it working I wil copy it for all other players), and it is not working properly.
int Victory1=rmCreateTrigger("Victory Trigger1"); rmSwitchToTrigger(Victory1); rmAddTriggerCondition("Units In Area"); rmSetTriggerConditionParam("DstObject", "Teepee"); rmSetTriggerConditionParamInt("Player", 1); rmSetTriggerConditionParam("UnitType", "cow"); rmSetTriggerConditionParamInt("Dist", 10); rmSetTriggerConditionParam("Op", "=="); rmSetTriggerConditionParamInt("Count", 2); rmAddTriggerEffect("Set Player Won"); rmSetTriggerEffectParamInt("Player", 1); rmSetTriggerRunImmediately(true);
I think its the DstObject that is nto working. The map loads, and before I changed the operator from <= to == it won pretty quick (because you can have 0 cows near the Teepee to win) but now I have 2 cows near the teepee and it does not win!?! Is it because it does not realise that the Teepee is the center, or is it something else?
|
|
|
Logged
|
"I am not sure why people are so afraid of new ideas, I am afraid of the old ones" :p
|
|
|
|
River_God
Member
Offline
Posts: 184
|
|
« Reply #78 on: November 02, 2007, 08:14:31 AM » |
|
You are absolutely right, thanks. For this trigger, what do you think it would need to work, I mean should I have it loop? or run immediately? or the SetTriggerActive?
int Victory1=rmCreateTrigger("Victory Trigger1"); rmSwitchToTrigger(Victory1); rmAddTriggerCondition("Units In Area"); rmSetTriggerConditionParamInt("DstObject", StartTP1); rmSetTriggerConditionParamInt("Player", 1); rmSetTriggerConditionParam("UnitType", "cow"); rmSetTriggerConditionParamInt("Dist", 10); rmSetTriggerConditionParam("Op", "=="); rmSetTriggerConditionParamInt("Count", 2); rmAddTriggerEffect("Set Player Won"); rmSetTriggerEffectParamInt("Player", 1);
|
|
|
Logged
|
"I am not sure why people are so afraid of new ideas, I am afraid of the old ones" :p
|
|
|
|
|
|
|
|
|
River_God
Member
Offline
Posts: 184
|
|
« Reply #85 on: November 04, 2007, 02:36:02 PM » |
|
Ok, when you deploy a building in a Deploy Army trigger, how would you deploy it built?
int TParmy=rmCreateArmy(TPlayer, "Teepee Army"+TPlayer); int TPREA=rmCreateTrigger("Teepee ReAnimation"+riv); rmSwitchToTrigger(TPREA); rmAddTriggerCondition("Player Unit Count"); rmSetTriggerConditionParamInt("Player", TPlayer); rmSetTriggerConditionParam("ProtoUnit", "Teepee"); rmSetTriggerConditionParam("OP", "=="); rmSetTriggerConditionParamInt("Count", 0); rmAddTriggerCondition("Timer"); rmSetTriggerConditionParamInt("Param1", 60); rmAddTriggerEffect("Army Deploy"); rmSetTriggerEffectParamArmy("SrcArmy", TPlayer, TParmy); rmSetTriggerEffectParam("Clear", "true"); rmSetTriggerEffectParam("ProtoName", "Teepee"); rmSetTriggerEffectParamInt("Count", 1); rmSetTriggerEffectParam("Location", rmXFractionToMeters(rmPlayerLocXFraction(TPlayer))+",1,"+rmZFractionToMeters(rmPlayerLocZFraction(TPlayer))); rmSetTriggerActive(true); riv=riv+1;
|
|
|
Logged
|
"I am not sure why people are so afraid of new ideas, I am afraid of the old ones" :p
|
|
|
River_God
Member
Offline
Posts: 184
|
|
« Reply #86 on: November 04, 2007, 04:18:14 PM » |
|
Also, this group of triggers is not working. I am pretty sure the "Activate Trigger" effect of the third trigger is not wroking, am I right?
int TPREA=rmCreateTrigger("Teepee ReAnimation"+riv); int TPpreA=rmCreateTrigger("Teepee preActivation"+riv); int TPrepreA=rmCreateTrigger("Teepee repreActivation"+riv);
int TParmy=rmCreateArmy(TPlayer, "Teepee Army"+TPlayer); rmSwitchToTrigger(TPREA); rmAddTriggerCondition("Player Unit Count"); rmSetTriggerConditionParamInt("Player", TPlayer); rmSetTriggerConditionParam("ProtoUnit", "Teepee"); rmSetTriggerConditionParam("OP", "=="); rmSetTriggerConditionParamInt("Count", 0); rmAddTriggerEffect("Army Deploy"); rmSetTriggerEffectParamArmy("SrcArmy", TPlayer, TParmy); rmSetTriggerEffectParam("Clear", "true"); rmSetTriggerEffectParam("ProtoName", "Teepee"); rmSetTriggerEffectParamInt("Count", 1); rmSetTriggerEffectParam("Location", rmXFractionToMeters(rmPlayerLocXFraction(TPlayer))+",1,"+rmZFractionToMeters(rmPlayerLocZFraction(TPlayer))); rmAddTriggerEffect("Activate Trigger"); rmSetTriggerEffectParamInt("EventID", TPrepreA); rmAddTriggerEffect("Disable Trigger"); rmSetTriggerEffectParamInt("EventID", TPpreA); rmSetTriggerActive(false);
rmSwitchToTrigger(TPpreA); rmAddTriggerEffect("Counter:Add Timer"); rmSetTriggerEffectParamInt("Start", 60); rmSetTriggerEffectParamInt("Stop", 0); rmSetTriggerEffectParam("Msg", "Teepee returns in"); rmSetTriggerEffectParamInt("Event", TPREA); rmAddTriggerEffect("Disable Trigger"); rmSetTriggerEffectParamInt("EventID", TPrepreA); rmSetTriggerActive(false);
rmSwitchToTrigger(TPrepreA); rmAddTriggerCondition("Player Unit Count"); rmSetTriggerConditionParamInt("Player", TPlayer); rmSetTriggerConditionParam("ProtoUnit", "Teepee"); rmSetTriggerConditionParam("OP", "=="); rmSetTriggerConditionParamInt("Count", 0); rmAddTriggerEffect("Activate Trigger"); rmSetTriggerEffectParamInt("EventID", TPpreA); rmSetTriggerActive(true);
|
|
|
Logged
|
"I am not sure why people are so afraid of new ideas, I am afraid of the old ones" :p
|
|
|
|
River_God
Member
Offline
Posts: 184
|
|
« Reply #88 on: November 05, 2007, 01:10:39 PM » |
|
ok for "Change Unit Type" the SrcObject would be the unit I placed, but would it be a unit type so if I placed a skirmisher, would it change all skirmishers into teepee's, or would I have to have an object Definition like before and use that?
Also for "Fire Event", that change is easy enough, but would it just fire then turn off on it's own or stay active? if it stays active could I still use "Disable Trigger" to stop it?
Also, for "Set Player Won", it does not end the game. The other team gets "You have been defeated" and your team gets "You Win" but I still have to resign. Is there something else I can use?
|
|
« Last Edit: November 05, 2007, 02:42:42 PM by River_God »
|
Logged
|
"I am not sure why people are so afraid of new ideas, I am afraid of the old ones" :p
|
|
|
|