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 > I want to kill exactly 7 people. Volunteers?
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
Devil of Truth is offline Devil of Truth
Prince
Keep honking... I'm reloading.
Sep 2002
time: 07:24
Question  Old Post 04-12-2002 13:36
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
I want to kill exactly 7 people. Volunteers? Support Apolyton buy from Amazon

Ok, now that I have your attention...

I want to kill exactly 7 (or 7 percent) of my adoring citizens from one my cities using SLIC. Obviously, if I'm feeling less benevolent, I want to be able to edit the SLIC file and change this value to say 351, or whatever strokes my fancy at that time.

Don't ask me why I want to do this. Let's just say I don’t like their attitudes.

The bit of the code I'm using at the moment (stolen from IW; Peter Triggs et al - thanks guys ):

int_t tmpDead;
int_t tmpCounter;
city_t tmpCity;

city[0] = tmpCity;

tmpDead = city[0].population/10;

for (tmpCounter = 0; tmpCounter < tmpDead; tmpCounter = tmpCounter + 1) {
Event:KillPop(tmpCity);
}

This doesn't quite do what I'm looking for. Can anybody help?

The Big Mc is offline The Big Mc
King
Of the universe / England
Oct 2001
time: 05:24
  Old Post 04-12-2002 14:46 Visit The Big Mc's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

i dont thinck its posible because you are dividing integers. it wont work becase after division the number is rounded up to the nearest hole number so a city with a pop of 15 will lose .5 of the pop more then your 7%.

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:24
  Old Post 04-12-2002 14:57 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Support Apolyton, buy Call to Power 2

That should kill of 10% of the population, though you'd need to put it into an event handler, depending on when you wanted them to die. If it's every turn, you need a handler that fires every turn. For simplicity's sake, if you wanted to do every city, the line:

code:
HandleEvent(BeginCityTurn) 'kill10pcpt' pre{ // kill stuff code as above }

at the beginning would kill of 10% from every city in the game.

If you want a specific city (Don't know how you want to choose which one) you'll need either its name or its index. eg. for the capital, use this:

code:
HandleEvent(BeginCityTurn) 'kill10pcpt' pre{ if(IsHumanPlayer(player[0])) // the human city_t tmpCity; GetCityByIndex(player[0], 0, tmpCity); // store your capital if(tmpCity == city[0]){ // insert kill stuff code here } } }



If you want to kill 7 citizens, simply use your code, but replace
code:
tmpDead = city[0].population/10;

with
code:
tmpDead = 7;


To get 7%, use:
code:
tmpDead = city[0].population*7; tmpDead = tmpDead/100;

Done separately to avoid rounding errors when SLIC tries to do fractions (it can't).

hope this helps, and is comprehensible

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

* Immortal Wombat realsies there's a good chance you knew most of that, and are getting rounding errors*

The Big Mc is offline The Big Mc
King
Of the universe / England
Oct 2001
time: 05:24
  Old Post 04-12-2002 15:33 Visit The Big Mc's homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Help yourself to an AD-FREE life

wombat does this mean you are volunteering!

Devil of Truth is offline Devil of Truth
Prince
Keep honking... I'm reloading.
Sep 2002
time: 07:24
  Old Post 04-12-2002 18:35
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Tired of ads?

Thanks Big Mc and IW for your help and suggestions. As always, much appreciated.

Unfortunately, I still cannot wreak my revenge on exactly 7 lucky individuals. Here’s why:

* Create a SLIC with the code as suggested, and set tmpDead to 7 (tmpDead = 7;
* Add the SLIC to script.slc blah-blah-blah;
* Create a new game;
* Build a city and cheat it to population size 10 (just so we’re clear - when I say population size, I mean the number below the city name.)

You should now be the proud owner of a city with 100 000 inhabitants! (Even though I suck at math), the city should grow by: 100 000 + growth - 7;

Right?

Wrong. (End the turn.)

Whoa! The city now has +/-30 000 people! Where have 69 993 folks disappeared to?

Instead of inflicting my benevolent rule on exactly 7 people - I’ve now slaughtered them and their entire family and all their friends and all their friends’ family and their bank managers and their family and the guy that delivers the paper and his family and the dude that tries to wash your car at a red light and his family and their neighbours and their family and their neighbours’ neighbours and their families and… you get the picture.

It seems Event:KillPop(tmpCity); doesn’t use the city population, instead, it uses the population number. (If I’ve just said something that everybody else already knew - ignore it.)

Nevertheless, the question still stands. How do I kill exactly 7 people?

child of Thor is offline child of Thor
Emperor
UK
Jan 2002
time: 05:24
  Old Post 04-12-2002 18:48
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Support Apolyton or Terrorists Win



DoT i sure hope you can sleep easy at night. I suppose you could put it down to a catastrophic government mistake......some experiment gone wrong, either way i wouldn't want to be one of your citizens during this experiment, I have a feeling more may perish

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

code:
(...) for(i=0; i > 7; i = i + 1) { Event:KillPop(tmpCity); } (...)


or

code:
(...) AddPops(tmpCity, -7); (...)


Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:24
  Old Post 04-12-2002 18:49 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Got spare money?

quote:

It seems Event:KillPop(tmpCity); doesn’t use the city population, instead, it uses the population number.

Yes... 'fraid so.

So 7 people rather than 7 pop points? That's much harder. Very little SLIC deals with the actual population. Um...

Probably the best way is to plant some sort of tile improvement to fine tune the actual growth of the city. I don't know if it would work properly.

Can I ask why you would wish to?

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:24
  Old Post 04-12-2002 18:52
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Put an end to popups!

quote:

The city now has +/-30 000 people! Where have 69 993 folks disappeared to?


I just saw this
sorry it is impossibe (I think)

The Big Mc is offline The Big Mc
King
Of the universe / England
Oct 2001
time: 05:24
  Old Post 04-12-2002 19:39 Visit The Big Mc's homepage!
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Increase the size of your Attachments

it is possible but only in a msg box.

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:24
  Old Post 04-12-2002 19:42
Edit/Delete Message Reply w/Quote
#12 Report this post to a moderator
Increase Your PM Length

how???

The Big Mc is offline The Big Mc
King
Of the universe / England
Oct 2001
time: 05:24
  Old Post 04-12-2002 19:44 Visit The Big Mc's homepage!
Edit/Delete Message Reply w/Quote
#13 Report this post to a moderator
Support Apolyton, buy Call to Power 2

very easy indeed but i have to run for the bus now sea you tomorrow after 2.30pm gmt.

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:24
  Old Post 04-12-2002 19:49
Edit/Delete Message Reply w/Quote
#14 Report this post to a moderator
Remove this text

HuangShang is offline HuangShang
King
USA, SoCal, L.A.
Jul 2002
time: 21:24
  Old Post 05-12-2002 05:33
Edit/Delete Message Reply w/Quote
#15 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

the title really tight but i dont uderstand anything u guy said

Devil of Truth is offline Devil of Truth
Prince
Keep honking... I'm reloading.
Sep 2002
time: 07:24
  Old Post 05-12-2002 13:56
Edit/Delete Message Reply w/Quote
#16 Report this post to a moderator
Support Apolyton buy from Amazon

Thanks again everybody.

coT, I sleep the peaceful sleep of the righteous at night. My citizens understand the importance of the "Grand Experiment." They realise it’s for the "Greater Good." Their "Grandiose Patriotism" will always be remembered. And those that don’t agree with me – die ! So, everybody wins!

quote:
Very little SLIC deals with the actual population.

IW, I was afraid of that. I had a feeling that SLIC wouldn’t let me do it!

The reason for all this bloodshed: A friend of mine remarked that he’d like something like Cancer or Bubonic Plague or Smallpox or Cholera or Whatever to affect the citizens of his cities. Every turn a very small number of people in every city dies – not enough to be irritating - but enough to hamper growth a tad. This would be triggered by an advance or an age, and would continue until either a cure is discovered, or a wonder is built (Cure for Cancer in Civ2). I think it makes a nice little sub-plot. A race within a race. I also thought it wouldn’t be too difficult...

Pedrunn - NO ! You cannot possibly say "impossible" so flippantly! You’re one of my CTP2 heroes! Don’t let me down. (Besides – I have a rather embarrassing Pedrunn quote on impossibility right here.)

Big Mc, the wilful decimation of my population is on your shoulders now. No pressure.

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:24
  Old Post 05-12-2002 16:47
Edit/Delete Message Reply w/Quote
#17 Report this post to a moderator
Support Apolyton buy from Amazon

quote:
Originally posted by Devil of Truth
Pedrunn - NO ! You cannot possibly say "impossible" so flippantly! You’re one of my CTP2 heroes! Don’t let me down. (Besides – I have a rather embarrassing Pedrunn quote on impossibility right here.)

Ooops!


At least thanks to Big Mc we know how meanless this word is around here.
No matter what this doesnt mean that the effect you want cant be work around. We can always remove the people with invisible TI's or unamed buildings with food penalties. Not as accurate but efficient.

Last edited by Pedrunn on 05-12-2002 at 16:57

The Big Mc is offline The Big Mc
King
Of the universe / England
Oct 2001
time: 05:24
  Old Post 05-12-2002 19:25 Visit The Big Mc's homepage!
Edit/Delete Message Reply w/Quote
#18 Report this post to a moderator
Browse Apolyton AD-FREE

The only way to do it if may reasoning is right is to model the civs growth. This is to mean that the word estimate is put in front of the pop in the city view windows. And then use msq boxes to say that “7 people have been killed in the great experiment today”. Then using the INT CityFoodDelta(city) function one can model the citys growth pattern then minus a pop point or so when the dead of the exsperimant = 501 or greater. every turn you would add the regular new pop so the 501 would becom 491 if ten people are added per turn then you would minus the dead of the experiment. So the city growth is reduced.

if you think I wont to program it I suggest you turn to some one else.

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