Thread Tools
Old April 11, 2002, 05:21   #1
The Big Mc
CTP2 Source Code Project
King
 
The Big Mc's Avatar
 
Local Time: 22:52
Local Date: October 31, 2010
Join Date: Oct 2001
Location: Of the universe / England
Posts: 2,061
new orders
I have opened this thread on the behalf of lacutos

Well the past few weeks I have been very busy on my scenario and in my scenario I have a unit called a siren (named after the ones who killed ships with there call in ancient mythology)

And I was trying to make some new orders so here is my first one
Code:
HandleEvent(AssassinateRulerOrder) 'supertremer' pre
{

location_t	tmploc;	// killsallland
int_t		i;
int_t           tmpplayer;
city_t          tmpcity;
int_t           tmpcitypop;
int_t 		T;
int_t 		numunits;
unit_t		tmpUnit;

	GetCityByLocation(location[0], tmpcity);
	    numUnits = GetUnitsAtLocation(tmpcity.location);
		    for (i = 0; i < numUnits; i = i + 1) {	// Kill all units
			    GetUnitFromCell(tmpcity.location, i, tmpUnit);
			    Event: DisbandUnit(tmpUnit);//should kill all units don’t work so good
			}
	AddEffect(location[0], "SPECEFFECT_CREATE_PARKS", "SOUND_ID_NANO_TERROR");
	tmpplayer = tmpcity.owner;
	Event:Killcity(tmpcity, 0, tmpplayer);
	Terraform(location[0], 23);		// Transform the city into sea
	for (i = 0; i < 7; i = i + 1) {
	t=i-1; 
	GetNeighbor(city[0].location, t, tmpLoc);
		Terraform(tmploc, 23);		// Transform sea
			}
			return STOP;
		}
its called super tremor which basically kills an enemy city and replaces it with a lake

it’s a work in progress and the one I have at home has evolved a bit more

the only problem is with the disbanding of units and if there is a river there

it basically hijacks the old assassinate order which I did not use much all you basically have to do after this is change the assassinate special effect and pics (using the read zfs program)

so locutos what do you think of that
__________________
"Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
The BIG MC making ctp2 a much unsafer place.
Visit the big mc’s website
The Big Mc is offline  
Old April 11, 2002, 05:41   #2
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 23:52
Local Date: October 31, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
Well now...

Firstly I would suggest using KillUnit(tmpUnit) instead of DisbandUnit. Disband only works if you own the unit I would think.

Up to there should then be fine.

Then in Event:Killcity(tmpcity, 0, tmpplayer); I think the integer in the middle woud be the city index, not sure. Try -1 to make sure the capitol doesn't get wasted by accident.

Terraforming the city tile, is that shallow water or beach?

Lastly, this for loop is a bit confused/confusing
Code:
for (i = 0; i < 7; i = i + 1) {
	t=i-1; 
	GetNeighbor(city[0].location, t, tmpLoc);
                Terraform(tmploc, 23);	// Transform sea
}
return STOP;
Why not do a loop in t?
Code:
for(t=0; t < 8; t = t + 1){
There are 8 tiles around the city, numbered 0 to 7, so that loop will get them all. Then use GetNeighbor, and Terraform.

Is the return STOP necessary to prevent the ruler actually being assassinated?
__________________
Concrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
Immortal Wombat is offline  
Old April 11, 2002, 05:47   #3
The Big Mc
CTP2 Source Code Project
King
 
The Big Mc's Avatar
 
Local Time: 22:52
Local Date: October 31, 2010
Join Date: Oct 2001
Location: Of the universe / England
Posts: 2,061
I fix the problem with the Terraform


And I will try the kill unit thanks for the advise

They are automatically killed when you Terraform but it’s just way to slow and it look ugly

The stop stops the action. it is what stops you disbanding armies in the magnificent samurai scenario

Why don’t you plug the code into a slic file and run it for your self so you can get to grips with it
__________________
"Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
The BIG MC making ctp2 a much unsafer place.
Visit the big mc’s website
The Big Mc is offline  
Old April 11, 2002, 08:47   #4
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 19:52
Local Date: October 31, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
So what you actually do is add new effects to the existent orders and/or remove the old effect.
This will open new horizons.
But cant we add totally new orders!
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old April 11, 2002, 09:09   #5
The Big Mc
CTP2 Source Code Project
King
 
The Big Mc's Avatar
 
Local Time: 22:52
Local Date: October 31, 2010
Join Date: Oct 2001
Location: Of the universe / England
Posts: 2,061
I have been looking in to this for some time now and the only way to get the orders to look like anything activson has done is to hijack one of theirs. The only other possible way is the civ 2 way by pulling up msg boxes with orders in but I could never get that to work with a unit that could attack and have a special order.
__________________
"Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
The BIG MC making ctp2 a much unsafer place.
Visit the big mc’s website
The Big Mc is offline  
Old April 12, 2002, 05:37   #6
The Big Mc
CTP2 Source Code Project
King
 
The Big Mc's Avatar
 
Local Time: 22:52
Local Date: October 31, 2010
Join Date: Oct 2001
Location: Of the universe / England
Posts: 2,061
Well I have addressed one of the problems with the order it now works for underwater citys.

In the week end I will adders the two other problems air units and navel units survival

And the destruction of tile imps under the sea

but here is the latest version anyway
Attached Files:
File Type: slc mc_neworders.slc (1.5 KB, 5 views)
__________________
"Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
The BIG MC making ctp2 a much unsafer place.
Visit the big mc’s website
The Big Mc is offline  
Old April 17, 2002, 05:47   #7
The Big Mc
CTP2 Source Code Project
King
 
The Big Mc's Avatar
 
Local Time: 22:52
Local Date: October 31, 2010
Join Date: Oct 2001
Location: Of the universe / England
Posts: 2,061
Well I thought as my thread slowly sinks I might tell you lot about some of the new ordes I am making.

Rob bank

Well does basically what it says

(every time I think of Thais I get this picture of Michael Kane saying “your only suppose to blow the ******* doors of)”

planet weather control devise

which basically covers the enemy civ city in a blanket of snow.

Terror hack

The concept found I the English folder provided

In the call to power 2 CD by activsion

The enemy civs research is set back and unhappiness happens in the city you targeted.

Planet gaia bomb

Basically the same as the create park but also cleans up any dead tiles

And burn

Which destroys what ever the enemy civ is making and there is a chance of the fire spreading and the city loses of population, buildings etc
__________________
"Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
The BIG MC making ctp2 a much unsafer place.
Visit the big mc’s website
The Big Mc is offline  
Old April 17, 2002, 18:52   #8
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 19:52
Local Date: October 31, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
What about ...

Bribe

As in civ2, when you use it in another civ unit this unit join your empire (also lows regard)

Suicide Bombing

The unit dies but kills all the army wich this order was used. Should also kill pop when using in a city.

Throw Party
This one already exists but what about redo all thing so that modders can have more control over how much will be spent and how regard will be increased.

Sell / Export
Just like sell indulgence but used by coporate branchs to give gold.
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand

Last edited by Pedrunn; April 17, 2002 at 19:02.
Pedrunn is offline  
Old April 18, 2002, 05:30   #9
The Big Mc
CTP2 Source Code Project
King
 
The Big Mc's Avatar
 
Local Time: 22:52
Local Date: October 31, 2010
Join Date: Oct 2001
Location: Of the universe / England
Posts: 2,061
now that’s more like what this thread was set up for here what i think may be good wrong with you orders

Bribe

Makes the game a bit to easy

but would probably work OK easy enough

Suicide bombing

I had this idea a while back using one of the planes as a demolition plane then I got to sept 11 and thought twice about it.

Throw party

Could be good like bronze, silver , and gold party use 100, 200 or 300 gold easy to do if you ask me.


Sell/ export

Is this not done with the trade manger
Could be a good way of stimulating an underground dark goods trade.

I am very interested in the throw party idea expect the code soon.
__________________
"Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
The BIG MC making ctp2 a much unsafer place.
Visit the big mc’s website
The Big Mc is offline  
Old April 19, 2002, 09:15   #10
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 19:52
Local Date: October 31, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
Throw Party,
I wont use it kwon but for sure i will use it for sure. If have time i would love this code to my almost released mod (Absolute State v2.0).

Bribe,
i love the idea of civ2 but for sure we would have to add some difficulties like percent of chance of achiving (lows regard if fails), cant do if a unit belongs an army and costs a lot of money. It is something great that i will for sure use it.

Sell/Export,
Economy is the main column of a civ/nation. I just love if we have more emphasis on it even the the field. I think will be nice to have a little discussion about it before make the code.

Suicide Bombing,
Cool to make a terrorist type of unit. And civs with it would have really low regard towards others civ.
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old April 19, 2002, 09:21   #11
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 19:52
Local Date: October 31, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
Really cool idea!!!!!

Rush Improvement
Like workers of civ3, while a tile improvement is being buit, you could geta a unit to stand over the imp and use this order wich will cost PWs (or money) to have the tile imp ready in the next turn. See IW's rush tile improvements code.
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand

Last edited by Pedrunn; April 19, 2002 at 09:26.
Pedrunn is offline  
Old April 19, 2002, 09:26   #12
Martin Gühmann
staff
Call to Power II Democracy GameCall to Power Democracy GameCTP2 Source Code Project
Super Moderator
 
Martin Gühmann's Avatar
 
Local Time: 00:52
Local Date: November 1, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
Quote:
Originally posted by Pedrunn
Suicide Bombing,
Cool to make a terrorist type of unit. And civs with it would have really low regard towards others civ.
Actual this is already in the game see nukeswhy not giving such a suicide unit to the Barbarians and see what happen, another idea would be givinglet pop up a message if you meet a Barbarian unit for a small deal you give them some money for an attack on a forign civ, you have to pay the costs for the trip for to the target and maybe for some additional mercenaries. Whenever an AI meets an Barbarian they would pay them, too. Of course the deal will only happen if you have enough money and if the Barbarians might think you paid to less than they will make a surprise attack on you instead of your enemy.

-Martin
__________________
Civ2 military advisor: "No complaints, Sir!"
Martin Gühmann is offline  
Old April 19, 2002, 09:43   #13
Martin Gühmann
staff
Call to Power II Democracy GameCall to Power Democracy GameCTP2 Source Code Project
Super Moderator
 
Martin Gühmann's Avatar
 
Local Time: 00:52
Local Date: November 1, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
Quote:
Originally posted by Pedrunn
Really cool idea!!!!!

Rush Improvement
Like workers of civ3, while a tile improvement is being buit, you could geta a unit to stand over the imp and use this order wich will cost PWs (or money) to have the tile imp ready in the next turn. See IW's rush tile improvements code.
Actual it would be easier to code if tile improvement would be finished once instaed of next turn.

By the way I would create new orders by using some of the obsolete slic events. For example look on this:


PHP Code:
ORDER_BUILD_FORT {
  
Gold 0
  Move 100
  EventName 
"UseSpaceLadderOrder"
  
GLHidden

  LocalizedName str_ldl_order_move
  StatusText str_ldl_order_move

  TargetPretest
:None
  UnitPretest_None

  CPIcon 
"upsi26.tga"
  
ButtonLocation 0
  DefaultIcon ICON_ORDER_MOVE
  
  Cursor 1
  InvalidCursor 2

Everytime when this order is called the UseSpaceLadderOrder event occurs in the game. Actual it does nothing but with this slic code it will build at the army location a fort:

PHP Code:
HandleEvent(UseSpaceLadderOrder)'MG_BuildFort' pre {
Event:CreateImprovement(army[0].owner,army[0].location8,);

Now a new goal for the AI like this one, for the goals.txt:

PHP Code:
GOAL_BUILD_FORT {
  
NoTransport  

  SquadClass
:CanAttack
  SquadClass
:CanDefend
  SquadClass
:HasZoc

  TargetType
:ChokePoint
  TargetType
:Border
  TargetOwner
:Self
  TargetOwner
:Neutral

  Execute    ORDER_BUILD_FORT

  ThreatBonus          100
  EnemyValueBonus            0
  AlliedValueBonus            0
  PowerBonus                0
  DistanceToHomeBonus      
-10 //WW from -100
  
DistanceToEnemyBonus       -1
  ChokePointBonus           10
  UnexploredBonus         
-999999
  ObsoleteArmyBonus          
-50
  TreaspassingArmyBonus      500

  ThreatenType
:None
  ThreatenBonus 0

  ForceMatch
:Defensive

Now add the proper lines to all strategies in the strategies.txt something like this:

PHP Code:
GoalElement Goal GOAL_BUILD_FORT          Priority   100000  MaxEval   3  MaxExec   2 //MG added 
So now the AI is able to build some forts on the map with the notion that it is doing something for its defence. By the way as a side product it makes possible that the player can put forts over the orders pad on the map of course only if you change the button location in the orders.txt note that the current version should be added in front of the whole code of the orders.txt so that the button lies under the button for move in this example so that the button doesn't lie on more improtant orders.

-Martin
__________________
Civ2 military advisor: "No complaints, Sir!"
Martin Gühmann is offline  
Old April 19, 2002, 11:38   #14
TheArsenal
Apolyton University
Prince
 
TheArsenal's Avatar
 
Local Time: 15:52
Local Date: October 31, 2010
Join Date: Mar 2002
Location: Sunny Southern California
Posts: 900
What about conscription? (if it doesn't exist already in a Mod I'm not playing), the concept being similar to creating slaves, but forcing the captured units/pop to become your military units.
__________________
"Guess what? I got a fever! And the only prescription is ... more cow bell!"
TheArsenal is offline  
Old April 26, 2002, 04:07   #15
The Big Mc
CTP2 Source Code Project
King
 
The Big Mc's Avatar
 
Local Time: 22:52
Local Date: October 31, 2010
Join Date: Oct 2001
Location: Of the universe / England
Posts: 2,061
Well I am back thanks to the wombat

Looks like there are some good ideas floating around

I got the bank raid working in my small absents (college banned apolyton but I got around it)
Expect it Monday

And I almost got the throw party to work problem is I am having a hard time pulling up the need stuff in a text box. All I need to get it working is directions on getting the target city owner up in my mc_msg.slc box.
__________________
"Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
The BIG MC making ctp2 a much unsafer place.
Visit the big mc’s website
The Big Mc is offline  
Old April 26, 2002, 10:05   #16
hexagonian
The Courts of Candle'Bre
Emperor
 
hexagonian's Avatar
 
Local Time: 17:52
Local Date: October 31, 2010
Join Date: Jun 1999
Location: Smemperor
Posts: 3,405
Quote:
Originally posted by TheArsenal
What about conscription? (if it doesn't exist already in a Mod I'm not playing), the concept being similar to creating slaves, but forcing the captured units/pop to become your military units.
Wombat created a code (part of Cradle, btw) that does this exact thing with defeated forces.
__________________
Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
...aisdhieort...dticcok...
hexagonian is offline  
Old April 26, 2002, 15:27   #17
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 19:52
Local Date: October 31, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
BigMc, Where have you been?

Hey, I wanna know if you or anyone could make a order to me.

Get Pop
Just like enslave but instead of add a slave it adds a worker.
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old April 28, 2002, 08:36   #18
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 19:52
Local Date: October 31, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
Martin, How do i define wich unit will us the order?
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old April 28, 2002, 15:41   #19
Martin Gühmann
staff
Call to Power II Democracy GameCall to Power Democracy GameCTP2 Source Code Project
Super Moderator
 
Martin Gühmann's Avatar
 
Local Time: 00:52
Local Date: November 1, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
Take again a look on the example order there you find a line UnitPretest_None. This flag means that every unit can execute this order, this is ok for the build fort order, as you just have to move a unit to a certain location and than you can put a fort over the tile improvement menue on the location. If you use UnitPretest_CanSettle than the order will only be availabe for units with the settling ability. Here is a list of all UnitPretest flags, unfortunatly there are some missing so that every order that is in the Orders.txt can be used.

-Martin

UnitPretest_None
UnitPretest_CanAttack
UnitPretest_CanEntrench
UnitPretest_CanSueFranchise
UnitPretest_CanSue
UnitPretest_CanCreateFranchise
UnitPretest_CanInvestigateCity
UnitPretest_CanBombard
UnitPretest_CanSettle
UnitPretest_CanStealTechnology
UnitPretest_CanInciteRevolution
UnitPretest_CanAssassinateRuler
UnitPretest_CanExpel
UnitPretest_EstablishEmbassy
UnitPretest_ThrowParty
UnitPretest_CanCauseUnhappiness
UnitPretest_CanPlantNuke
UnitPretest_CanSlaveRaid
UnitPretest_CanEnslaveSettler
UnitPretest_CanUndergroundRailway
UnitPretest_CanInciteUprising
UnitPretest_CanBioTerror
UnitPretest_CanPlague
UnitPretest_CanNanoInfect
UnitPretest_CanConvertCity
UnitPretest_CanReformCity
UnitPretest_CanSellIndulgences
UnitPretest_CanFaithHeal
UnitPretest_CanSoothsay
UnitPretest_CanCreatePark
UnitPretest_CanPillage
UnitPretest_CanInjoin
UnitPretest_CanInterceptTrade
UnitPretest_CanAdvertise
UnitPretest_CanNukeCity
UnitPretest_CanTransport
UnitPretest_CanBeTransported
UnitPretest_CanLaunch
UnitPretest_CanTarget
UnitPretest_Invalid
__________________
Civ2 military advisor: "No complaints, Sir!"
Martin Gühmann is offline  
Old April 29, 2002, 07:33   #20
The Big Mc
CTP2 Source Code Project
King
 
The Big Mc's Avatar
 
Local Time: 22:52
Local Date: October 31, 2010
Join Date: Oct 2001
Location: Of the universe / England
Posts: 2,061
Well pedrun just done it for you probably full of bugs like but just link it to the need order and then de bug should not take to long

Code:
Handleevent(someorder) ‘neworder2’ pre }
Int_t	 tmpcity;
Int_t        tmpplayer;


Getcitybylocation(location[0] , tmpcity);
Addpop(tmpcity, -1);
Tmpplayer = army[0].owner;
Addpop(tmpplayer.city[1] , 1);

}
__________________
"Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
The BIG MC making ctp2 a much unsafer place.
Visit the big mc’s website
The Big Mc is offline  
Old April 29, 2002, 07:34   #21
The Big Mc
CTP2 Source Code Project
King
 
The Big Mc's Avatar
 
Local Time: 22:52
Local Date: October 31, 2010
Join Date: Oct 2001
Location: Of the universe / England
Posts: 2,061
I just thought of something it for your scenario for the borg assimilation
__________________
"Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
The BIG MC making ctp2 a much unsafer place.
Visit the big mc’s website
The Big Mc is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 18:52.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team