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 > D'oh questions
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
azalae is offline azalae
Chieftain

Nov 2001
time: 15:19
  Old Post 04-06-2002 18:20
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
D'oh questions Get a bigger avatar today!

This is my first time writing SLIC so bear with me and my silly questions .

Q1
How to add building(s) to a newly founded city? I thought Dale's WAW mod hase this feature, so I browse through the files but so far no luck. Probably I miss it somewhere.

Anyway, I tried to write my own SLIC (no pain no gain), and it didn't work (the pain).

code:
HandleEvent(CreateCity) 'The_Doh_Function' post { int_t thePlayer; location_t theLocation; city_t theCity; thePlayer = player[0]; // <= do I really need this? theLocation = location[0]; // and this? theCity = city[0]; Event:CreateBuilding(theCity, BuildingDB(IMPROVE_SHRINE)); }


Q2
The GrantAdvance() event has 3 arguments: GrantAdvance(player, int1, int2), right?. Which int argument is the advance? I wrote "GrantAdvance(player,AdvanceDB(SomeAdvance),0)" and it worked. Can I always leave the third argument or does it do anything?

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:19
Post  Old Post 04-06-2002 19:09 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Support Apolyton buy from Amazon

A1: Take a look into the unit.txt and search the for the the entry of the urban planer. You will notice that this unit has a list of SettleBuilding entries. So whenever an urban planer builds a city (also in the original game) than the specified buildings are added to the city. So actual no slic is here required. But one thing you have to consider is that if you get a city from a ruin than you won't get the extra buildings. For the original game it doesn't matter, because all ruins should be opened in the modern age already. BTW also the starting size of this city is dertermined in this unit entry.

A2: Actual I don't know, but I guess the first one is the advance and the second one might be the reason of giving the advance. You have to note there is an event called GrantAdvance and a function called GrantAdvance. From the official Activion slic documentation the event has tree arguments and the function has two. BTW did you really wrote:

"GrantAdvance(player,AdvanceDB(SomeAdvance),0)"

Or rather:

" Event:GrantAdvance(player,AdvanceDB(SomeAdvance),0
)"

If you used the first from then you called the function, if you used the second form then the event. It is interesting if you used the first form, because that would mean the GrandAdvance function has an undocumented optional third argument.

-Martin

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:19
  Old Post 04-06-2002 19:14
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Support Apolyton or Terrorists Win

Well will not give you Slic tips since i am just too green too.

But as a modder the best is to add this line in the settler data in the unit.txt.

code:
SettleBuilding IMPROVE_SHRINE

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:19
  Old Post 04-06-2002 19:22
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

You beat me for some minutes.
But now is my time to ak
How many reasons there are?
What they are?
And their respective numbers?

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:19
Post  Old Post 04-06-2002 21:56 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Full PM-box? Change here!

quote:
Originally posted by Pedrunn
You beat me for some minutes.
But now is my time to ak
How many reasons there are?
What they are?
And their respective numbers?


Hey stop I just guessed.

What are the possible reasons or better conditions to give a civ an advance.

The first one is the common one: You got enough science points to pay the advance with it so you gain it.

Another possibility to gain an advance is to enter a goody hut.

Next one is stealing it with a spy.

Then you can gain an advance during diplomacy negotiations.

And you can steal an advance if you conquered an city. (I think this is broken in CTP2 )

So that are five conditions to give an advance to an civ. Of course there is also the possebility to give it vea slic.

I can't you tell anything about the numbers, Presuming the third argument contains something usefull. In most cases these last arguments, especial these undocumented ones, do nothing. And if the third argument would be a reason to give the advance than it would doesn't matter if you use any number, because in the end it doesn't matter how the civ gained the advance, it only matters that the civ gained the advance.

-Martin

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:19
  Old Post 04-06-2002 22:42
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Support Apolyton or Terrorists Win

quote:
Originally posted by Martin Gühmann
Hey stop I just guessed.

(I hope )

There is also a reason in AddHappyTime and other slic functions. I thought there could exist some sort of known general list of reasons to use in slic.

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:19
  Old Post 04-06-2002 23:59 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Tired of ads?

A1. You don't need the lines you questioned

quote:

And you can steal an advance if you conquered an city.

It is possible to SLIC this, and I was considering it for a while. But because HasAdvance(...) has to use the advance name (as in ID_ADVANCE_...) then it makes it hugely long code to write, and my patience is not that generous...

azalae is offline azalae
Chieftain

Nov 2001
time: 15:19
  Old Post 05-06-2002 07:38
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
aahhhh Support Apolyton, buy Civilization 2

So, that's the way Thanks a lot guys.

Martin Gühmann,
This is the way wrote it: Event:GrantAdvance(thePlayer, AdvanceDB(ADVANCE_STONE_WORKING), 0);
I'll try the non-event function now, just to see what's the difference.

Hmm gain an advance when conquering a city. Interesting. Can't we just use integers instead of those constant strings? I mean AdvanceDB is just to convert strings (ADVANCE_SOMETHING) into its integer index (some number), isn't it. I thought it's just to make it easier to read (and write) the SLIC. But we don't really need to know the exact advance, we just want a random advance the enemy has that we don't.

First Draft:

code:
HandleEvent(CaptureCity) post { int_t currentPlayer; int_t losingPlayer; int_t theAdv; currentPlayer = g.player; losingPlayer = player[0]; // <= Q: refer to which player? for (theAdv = 0; theAdv < advance.#; theAdvance = theAdvance + 1) { if ((HasAdvance(losingPlayer,theAdv) && (!HasAdvance(currentPlayer,theAdv))) { GrantAdvance(currentPlayer,theAdv); // Next to do: MSG>"Your scientists managed to salvaged some interesting // research data after the occupation of the city, advance[theAdv].name". } } }

If we want a random one, we can always create a list of those qualifying advances (ones they have that we don't) and randomly select one from it.

Anyway, I haven't test the code, so don't sue me .

Q: Which player does player[0] refer to? The previous owner of the city OR the conquerer?

Edit: If player[0] refers to current player too, then can we try handling AttackCity event (or some other relevant events) to extract the previous owner?

Last edited by azalae on 05-06-2002 at 07:46

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:19
  Old Post 06-06-2002 01:44 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Tired of ads?

theAdv cannot be an integer, it doesn't work, otherwise it would be that simple. theAdv does have to be a string in the HasAdvance function.

azalae is offline azalae
Chieftain

Nov 2001
time: 15:19
  Old Post 07-06-2002 11:59
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Support Apolyton, pre-order Civilization IV

D'oh

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:19
  Old Post 07-06-2002 14:22 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Support Apolyton buy from Amazon

quote:
Originally posted by Immortal Wombat
theAdv does have to be a string in the HasAdvance function.


But that's only in the HasAdvance function, right? Not in any of the places where you use AdvanceDB.

Peter Triggs is offline Peter Triggs
Prince
Gone Fishin, Canada
Jan 2000
time: 05:19
  Old Post 07-06-2002 22:29
Edit/Delete Message Reply w/Quote
#12 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

quote:

Q: Which player does player[0] refer to? The previous owner of the city OR the conquerer?



player[0] is the player who captures the city. If you run the handler pre- before the in-game code that captures the city - you can get the player who's about to lose the city with city[0].owner. In a post CaptureCity handler, player[0] is city[0].owner.

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:19
  Old Post 08-06-2002 04:05 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#13 Report this post to a moderator
Remove this text

Only in HasAdvance is it neccessary, correct. It might not even work in the other functions, which need the DB index as an integer

  < 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.0568 seconds (88.49% PHP - 11.51% 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