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 > SLIC Template Processor
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
J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:22
  Old Post 26-09-2002 02:26 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
SLIC Template Processor Suffering from ads?

In response to a request by Pedrunn (sort of..) and because I'd been intending to do something like this I have written a program to process templates intended to duplicate sections of SLIC code. This is not as powerful as I had hoped at present, but to go any further I'd have to incorporate the system into CTPEd (something I intend to do, but people would probably want a seperate program).

The basic intent is to generalize the program that I previously wrote for helping with the advance with city capture code for other purposes.

This amounts to generating repetetive code based of the contents of the data files.

Now you can make template files (I suggest .slt) which are processed into complete and final .slc files, removing the intermediate copy-paste step that there was before. I have also added further functionality to access the fields within the entries (in a limited way) and supply the number of the entry for use with array indicies and such like.

Attached is the executable, zipped with a sample template file including details of how to use this and the processed SLIC file which should be output from the sample template.

Any feedback welcome - there are no doubt some things I could quickly add if they are desired but haven't thought of.

Here's a short sample of output, based on something Pedrunn was wanting:

code:
PEDRUNN_PILLAGED_IMPROVEMENT[0] = TerrainImprovementDB(TILEIMP_ADVANCED_FARMS); PEDRUNN_PILLAGE_BONUS[0] = 500; PEDRUNN_PILLAGED_IMPROVEMENT[1] = TerrainImprovementDB(TILEIMP_ADVANCED_MINES); PEDRUNN_PILLAGE_BONUS[1] = 800; PEDRUNN_PILLAGED_IMPROVEMENT[2] = TerrainImprovementDB(TILEIMP_ADVANCED_UNDERSEA_MIN ES); PEDRUNN_PILLAGE_BONUS[2] = 1000; PEDRUNN_PILLAGED_IMPROVEMENT[3] = TerrainImprovementDB(TILEIMP_AIR_BASES); PEDRUNN_PILLAGE_BONUS[3] = 1000; PEDRUNN_PILLAGED_IMPROVEMENT[4] = TerrainImprovementDB(TILEIMP_AUTOMATED_FISHERIES); PEDRUNN_PILLAGE_BONUS[4] = 1400;

Attachment: slctp.zip
This has been downloaded 11 time(s).

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:22
  Old Post 26-09-2002 06:57
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Help yourself to an AD-FREE life

Will start playing with it now
I dont think i need to say it will be very useful

-Thanks

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:22
  Old Post 10-12-2002 04:27 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

I've just had a quick go at this for hex's LOTR scenario, and I can't seem to get it working. I'm using this as a template, and hex's LOTR_units.txt:

code:
elseif(tmpUnit.type == UnitDB(@)) { ~@Unit = tmpUnit; }

(The ~ is just there so I can do a search/replace for ~UNIT_ later on.)

But it doesn't seem to work. It goes to the first unit, then hangs there for ages. Possibly forever.

??

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:22
  Old Post 11-12-2002 00:03 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

The syntax is different in this version - you need to use something like the following:

code:
SlcTP SlcTPSource LOTR_Units.txt SlcTPTemplate if(tmpUnit.type == UnitDB(@Name*)) { ~@Name*Unit = tmpUnit; } SlcTPBetween else SlcTPEnd


That will give the output:

code:
if(tmpUnit.type == UnitDB(UNIT_SAURON)) { ~UNIT_SAURONUnit = tmpUnit; } elseif(tmpUnit.type == UnitDB(UNIT_SHELOB)) { ~UNIT_SHELOBUnit = tmpUnit; } elseif(tmpUnit.type == UnitDB(UNIT_BALROG)) { ~UNIT_BALROGUnit = tmpUnit; } elseif(tmpUnit.type == UnitDB(UNIT_WATCHER)) { ~UNIT_WATCHERUnit = tmpUnit; } [and so forth...]

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:22.
Apolyton Time is 00:22.
    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.0312 seconds (85.64% PHP - 14.36% 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