pftq.com
Welcome! Please Login or Register!
November 23, 2024, 01:54:49 AM
Home Login Register
pftq Forums  |  Game Design  |  Age of Empires III  |  Capture the Flag 0 Members and 1 Guest are viewing this topic. « previous next »
Latest News!Lunar Trigger(Aug 27, 2023)
Pages: 1 2 [3] 4 5 ... 10 Print
Author Topic: Capture the Flag  (Read 46697 times)
River_God
Member
*****
Offline Offline



Posts: 184

« Reply #30 on: July 17, 2007, 07:22:17 AM »

Thanks for your help, I got most of it working, except I could not get the players to place properly, and ran out of time. It's a 1v1 observer map now with a few embellishments and the look of a basic map.
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 Offline



Posts: 184

« Reply #31 on: August 30, 2007, 01:05:04 PM »

OK I am back from my break and ready to script again.

I would love it if you took a look at this trigger. What it is supposed to do is cause a player to win if they have 2 cows in a certain area.

   for (plflag=1; <=cNumberNonGaiaPlayers){
   rmCreateTrigger("FlagsCaptured"+plflag);
   rmSwitchToTrigger(rmTriggerID("FlagsCaptured"+plflag));
   rmAddTriggerCondition("Units in Area");   
   rmSetTriggerConditionParam("Player", plflag, true);   
   rmSetTriggerConditionParam("UnitType", "Cow", true);
   rmSetTriggerConditionParam("Count", 2, true);   
   rmAddTriggerEffect("Set Player Won");
   rmSetTriggerEffectParam("Player", plflag, true);
   rmAddTriggerEffect("Shake Camera");
   rmSetTriggerEffectParam("Duration", 5.0, true);
   rmSetTriggerEffectParam("Strength", 0.25, true);
   rmSetTriggerActive(true);
   }

I know I havn't the code that sais the area becuase I havn't decided the whole map yet. I was just wondering if this code makes any sense or am I just typing random words.
Logged

"I am not sure why people are so afraid of new ideas, I am afraid of the old ones"   :p
pftq
Administrator
*****
Offline Offline



Posts: 4204

WWW
« Reply #32 on: August 30, 2007, 05:48:32 PM »

I don't believe you need the last parameter (true) in any of those.  Just waste of typing.

The code looks okay though.
Logged
River_God
Member
*****
Offline Offline



Posts: 184

« Reply #33 on: September 13, 2007, 05:00:00 PM »

OK I have a trigger I think should work, but it is causing the map to fail. It is a trigger that ships reinforcements every 3 minutes. Here is the code:

int playa=0;
for (playa=1; <=cNumberNonGaiaPlayers){
   int RTimer=rmCreateTrigger("ReinforcementsCountdown");
   rmSwitchToTrigger(RTimer);
   rmAddTriggerCondition("Timer");
   rmSetTriggerConditionParam("Param1", 180);
   rmAddTriggerEffect("Unit Create Multi");
   rmSetTriggerEffectParam("PlayerID", playa);
   rmSetTriggerEffectParam("ProtoName", "Cow");
   rmSetTriggerEffectParam("Location", rmAreaID("Player"+playa));
   rmSetTriggerEffectParam("Count", 5);
   rmSetTriggerLoop(true);
   rmSetTriggerActive(true);
   }

The area ID Player does exist in the test code I am working with. Anything in the storage is out of date. Just tell me there is something obvious I am missing.
Logged

"I am not sure why people are so afraid of new ideas, I am afraid of the old ones"   :p
pftq
Administrator
*****
Offline Offline



Posts: 4204

WWW
« Reply #34 on: September 13, 2007, 07:19:38 PM »

rmSetTriggerConditionParam("Param1", 180);

ParamInt - you're using integer values (not " "s)

You do the same mistake a few times.
Logged
River_God
Member
*****
Offline Offline



Posts: 184

« Reply #35 on: September 14, 2007, 12:52:46 PM »

So something like this?

int playa=0;
for (playa=1; <=cNumberNonGaiaPlayers){
   int RTimer=rmCreateTrigger("ReinforcementsCountdown");
   rmSwitchToTrigger(RTimer);
   rmAddTriggerCondition("Timer");
   rmSetTriggerConditionParamInt("Param1", 180);
   rmAddTriggerEffect("Unit Create Multi");
   rmSetTriggerEffectParamInt("PlayerID", playa);
   rmSetTriggerEffectParam("ProtoName", "Cow");
   rmSetTriggerEffectParamInt("Location", rmAreaID("Player"+playa));
   rmSetTriggerEffectParamInt("Count", 5);
   rmSetTriggerLoop(true);
   rmSetTriggerActive(true);
   }

I had a feeling it was one of those fundamental flaws I miss out on when self-teaching.
Logged

"I am not sure why people are so afraid of new ideas, I am afraid of the old ones"   :p
pftq
Administrator
*****
Offline Offline



Posts: 4204

WWW
« Reply #36 on: September 14, 2007, 05:17:26 PM »

Areas are not defined that way... you have to use Param and input 3 values (x, y, z).

See the scripting section on the site: Misc/Advanced Scripting (Trigger Locations)
Logged
River_God
Member
*****
Offline Offline



Posts: 184

« Reply #37 on: September 15, 2007, 11:27:22 AM »

so are the input values in metres or in fraction?
Logged

"I am not sure why people are so afraid of new ideas, I am afraid of the old ones"   :p
pftq
Administrator
*****
Offline Offline



Posts: 4204

WWW
« Reply #38 on: September 15, 2007, 04:44:20 PM »

"rmSetTriggerEffectParam('Location', rmXFractionToMeters(#)+',1,'+rmZFractionToMeters(#));"

Meters.
Logged
River_God
Member
*****
Offline Offline



Posts: 184

« Reply #39 on: September 15, 2007, 05:40:40 PM »

just so I get this right the first time it is the fraction I write as the # right, and the 1 in the middle is the height should that change at all or will it auto place at the right height?
Logged

"I am not sure why people are so afraid of new ideas, I am afraid of the old ones"   :p
pftq
Administrator
*****
Offline Offline



Posts: 4204

WWW
« Reply #40 on: September 15, 2007, 06:02:51 PM »

Why do I get the feeling you read nothing from that page? Tongue

"Y is supposedly the height, but doesn't appear to affect anything. I generally leave it at 1. Perhaps units that do not snap to the terrain will benefit, but I've yet to see that."

Yes, # is a fraction of the map (0.0-1.0).
Logged
River_God
Member
*****
Offline Offline



Posts: 184

« Reply #41 on: September 16, 2007, 07:57:01 AM »

so will this put it in the player's area?

rmSetTriggerEffectParam("Location", rmXFractionToMeters(rmPlayerLocXFraction(playa)),1, rmZFractionToMeters(rmPlayerLocZFraction(playa)));

Logged

"I am not sure why people are so afraid of new ideas, I am afraid of the old ones"   :p
pftq
Administrator
*****
Offline Offline



Posts: 4204

WWW
« Reply #42 on: September 16, 2007, 05:19:49 PM »

I would think so... did you try it?
Logged
River_God
Member
*****
Offline Offline



Posts: 184

« Reply #43 on: September 17, 2007, 11:25:30 AM »

I did it is the only line of the code that makes it fail. It is in the Test Map in the pftq file storage, I have that one line of code out and it works fine. I was wondering wether or not that trigger alone should bring up a timer box, like the one in FW for reinforcements?
« Last Edit: September 17, 2007, 11:29:19 AM by River_God » Logged

"I am not sure why people are so afraid of new ideas, I am afraid of the old ones"   :p
pftq
Administrator
*****
Offline Offline



Posts: 4204

WWW
« Reply #44 on: September 18, 2007, 06:34:26 PM »

The timer is known as a counter - that's a seperate effect.
Logged
Pages: 1 2 [3] 4 5 ... 10 Print 
pftq Forums  |  Game Design  |  Age of Empires III  |  Capture the Flag « 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.125 seconds with 21 queries.