Welcome! Please Login or Register!
September 20, 2020, 09:42: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!VR Jetpack Game Trailer and Music(Jul 29, 2019)
Pages: 1 ... 5 6 [7] 8 9 10 Print
Author Topic: Capture the Flag  (Read 31920 times)
River_God
Member
*****
Offline Offline



Posts: 189

« Reply #90 on: November 06, 2007, 06:54:32 PM »

ya except how do I work set players of the other team defeated, make a loop if (rmGetTeam(1)!=rmGetTeam(2){ Set Player Defeated  ?  damn how will I be able to place the object definition using a trigger effect?
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: 4130

WWW
« Reply #91 on: November 06, 2007, 07:00:17 PM »

Yes you have the defeated correct.

Object definition as in the variable (just as you did in the previous effects).
Logged
River_God
Member
*****
Offline Offline



Posts: 189

« Reply #92 on: November 06, 2007, 07:11:30 PM »

but the trigger effect was deploy army, not place object definition. Also I am having trouble making a trade route. here is what I used.

int mytrade=rmCreateTradeRoute("Forest Path");
rmAddTradeRouteWaypoint(mytrade, 1, 1);
rmAddTradeRouteWaypoint(mytrade, 0, 0);
rmBuildTradeRoute(mytrade, "dirt");
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: 4130

WWW
« Reply #93 on: November 08, 2007, 08:11:19 AM »

Previous condition then
Logged
River_God
Member
*****
Offline Offline



Posts: 189

« Reply #94 on: November 10, 2007, 10:41:03 PM »

ok what would you do to create a trade route that went from the top of the map to the bottom. I don't want any sockets jsut the route
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: 4130

WWW
« Reply #95 on: November 11, 2007, 05:32:18 AM »

Not sure what you confused on... Did you read over Monty's tutorial? Basically 3 steps:

1) Create the route (as in assign a variable and define it)
2) Set waypoints
3) Build it.

Kind of like areas.
Logged
River_God
Member
*****
Offline Offline



Posts: 189

« Reply #96 on: November 11, 2007, 10:41:40 AM »

ok, simple mistake. For functions, how exactly would I type out a function with a return. What I want to do exactly is have a function that will look to see if a unit is close to one of four other units, then tell me which one. How would I do that?
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: 4130

WWW
« Reply #97 on: November 11, 2007, 05:22:28 PM »

It's the same as PHP and Java.

You just have at the end of the function:

return <value>;

(no <>s)

It might help if you showed me the exact function you're trying to make.
Logged
River_God
Member
*****
Offline Offline



Posts: 189

« Reply #98 on: November 11, 2007, 06:07:45 PM »

If I could make it then I wouldn't have asked. It would be something like this:

void USItrig(int USIplayer=0, int USIunit=0){

int USIselectTrig=rmCreateTrigger("Unit Selection Island select Trigger"+riv);
rmSwitchToTrigger(USIselectTrig);
rmAddTriggerCondition("Units in Area");
rmSetTriggerConditionParamInt("DstObject", USIunit);
rmSetTriggerConditionParamInt("Player", USIplayer);
rmSetTriggerConditionParam("UnitType", "IGCHarbormaster");
rmSetTriggerConditionParamInt("Dist", 5);
rmSetTriggerConditionParam("Op", "==");
rmSetTriggerConditionParamInt("Count", 1);
rmAddTriggerEffect("

riv=riv+1;

Because I don't know much about PHP, and I am working with triggers, I am not sure where to put the return value. and what exactly would I type in the first void, would it be if I wanted an integer just   int USIselectTrig(){ or int something=0; USIselectTrig(){   ??
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: 189

« Reply #99 on: November 11, 2007, 06:09:02 PM »

Version I am testing and working with. It works so far...

* Capture the FlagXS.txt (23.56 KB - downloaded 21 times.)
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: 4130

WWW
« Reply #100 on: November 11, 2007, 10:00:11 PM »

What exactly do you want to return though? riv?

Would the function's only purpose be to return that value?

You could do something like:

int riv_update() {
 return riv+1;
}

You could then treat riv_update() as an integer variable:

1+riv_update would be 1+1+riv
Logged
River_God
Member
*****
Offline Offline



Posts: 189

« Reply #101 on: November 12, 2007, 07:16:01 PM »

I would want to return a bool, saying that it is true that Harbormaster is close to USIunit, or false. I would later on in the main have 
if (USItrig(1,  USIhandcav)=true){
HCadd=5;}

with maybe loops for player or unit type depending on what works. I was just wondering how I would make it only return "true" if Harbormaster is close to USIunit, and if the code I just made up would make HCadd actually equal 5
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: 4130

WWW
« Reply #102 on: November 13, 2007, 06:52:30 AM »

Well unless you want to get into custom effect making, you can't exactly do that with triggers just like that.  If you were to use custom effects, variable from triggers stay in triggers only - they do not mix into regular scripting.

In that case you might as well (to avoid custom effects) just have one trigger with that condition, and for its effect, have it fire the triggers you want (and those triggers would have their own unique conditions as well).
Logged
River_God
Member
*****
Offline Offline



Posts: 189

« Reply #103 on: November 13, 2007, 01:21:14 PM »

Hmmm.... is there any way to have that without triggers? like go opposite what you suggested?
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: 4130

WWW
« Reply #104 on: November 14, 2007, 09:30:06 AM »

? Putting regular variables into triggers - that's what you've been doing already.

Just try the second method - have one trigger which has the condition, fire the rest of the other triggers.
Logged
Pages: 1 ... 5 6 [7] 8 9 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.371 seconds with 21 queries.