Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Miscellaneous > Archive > CtP2-Creation/AI/Mods/Scenarios-Archive > Finish Improvement Order
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:19
  Old Post 28-04-2002 21:56
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Finish Improvement Order Suffering from ads?

I am giving a try in Slic writting. My first slic was to add the rush improvements using Entrench order for a new kind of Special Unit: The Worker.
I want to know if its correct and bug free.

code:
HandleEvent(EntrenchOrder) 'FinishImprovementsOrder' pre { unit_t tmpUnit; GetUnitFromArmy(army[0], i, tmpUnit); unit[0] = tmpUnit; if ((unit[0].type == UnitDB(UNIT_WORKER))) { FinishImprovements(unit[0].location); } }

My biggest problemcomes when i wanted to make the AI to knows how to use it. But the best i could do was make the unit finish improvent as it goes over tiles for the AI.
There is some function to trigger the code if the tile has an unfinished imp? Can someone help me with this issue?
I want to make the AI always entrench if this units pass by an tile with unfinished imp.
code:
HandleEvent(MoveToOrder) 'AIUsingFinishImprovement' post { unit_t tmpUnit; if(!=IsHumanPlayer(player[0])){ GetUnitFromArmy(army[0], i, tmpUnit); unit[0] = tmpUnit; if ((unit[0].type == UnitDB(UNIT_WORKER))) { FinishImprovements(unit[0].location); } } }

Last edited by Pedrunn on 28-04-2002 at 22:11

Peter Triggs is offline Peter Triggs
Prince
Gone Fishin, Canada
Jan 2000
time: 05:19
  Old Post 29-04-2002 00:13
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Enter the AD-FREE zone

I'd suggest using the MoveOrder event:

code:
HandleEvent(MoveOrder) 'FinishImprovementsOrder' post { unit_t tmpUnit; int_t i; for (i=0;i < army[0].size;i=i+1 ){ GetUnitFromArmy(army[0], i, tmpUnit); if (tmpUnit.type == UnitDB(UNIT_WORKER)) { FinishImprovements(tmpUnit.location); } } }


You put the improvement down as normal and then move your Worker (whose on an adjacent tile) on to it. The next turn, you move the Worker off the tile and, presto, there's the improvement. (I tried it using a Hoplite to stand in for your Worker.) This works fine for the Human and it should 'work' for the AI, too, in the way you described. To get the AI to actually try to do this would be much more difficult, if possible at all.

Note: You don't need "unit[0]=tmpUnit". Once you've declared "tmpUnit" to be a unit type variable you can access the members of the unit array in the same way as with a builtin variable.

The Big Mc is offline The Big Mc
King
Of the universe / England
Oct 2001
time: 05:19
  Old Post 01-05-2002 14:19 Visit The Big Mc's homepage!
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Suffering from ads?

you tried picking up the slic files on the apolyton ctp2 page

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:19.
Apolyton Time is 00:19.
    top of page
Rate This Thread:
archivepost
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0379 seconds (85.86% PHP - 14.14% MySQL) with 31 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net