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 problem
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
Turambar is offline Turambar
Prince
England
Apr 2002
time: 05:22
Question  Old Post 09-09-2002 00:45 Visit Turambar's homepage!
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
SLIC problem Tired of ads?

Ok here's a little problem for everyone. Basically when the code below runs the game stops/slows down for a couple of minutes and then returns to normal.

quote:
HandleEvent(CreateCity) 'HomeCity' post {
city_t tmpCity;
unit_t tmpUnit;
location_t cityloc;
tmpCity = city[0];
int_t homecity[];
int_t tmpPlayer;
tmpPlayer = player[0];
cityloc = location[0];
CreateUnit(player[0], UnitDB(UNIT_WAR_CHIEF), cityloc, 0);
homecity[tmpUnit] = tmpCity.name;
message(tmpPlayer, 'five');
}


Basically what I want the SLIC to do is when a city is built, for my War Chief unit to be built with it and for the city the unit is built in to be stored so that I can find out the units home city in the future.

The line that is messing things up is:

quote:
homecity[tmpUnit] = tmpCity.name;


I don't think this part even works so what am doing wrong? (I haven't been using SLIC very long if you haven't already guessed)

All I want to be able to do is get the home city of the unit when I want.

I hope some of that made sense .

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:22
  Old Post 09-09-2002 02:37 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Support Apolyton or Terrorists Win

tmpCity.name is a string.
homecity[tmpUnit] is an integer.
The one cannot be stored in the other.

If you are doing what I think, that is, assign the unit's home city to the homecity[] array, then you need homecity[] to be a city_t array.

You also need to change

code:
homecity[tmpUnit] = tmpCity.name;

to
code:
homecity[tmpUnit] = tmpCity;


And that should sort it.

Its great to see you SLICing Turambar

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:22
  Old Post 09-09-2002 02:43
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Support Apolyton, buy Call to Power 2

Why would you want homecity[tmpUnit] to equal tmpCity.name ?

If it is for the message. just write {tmpCity.name} or {city[0].name}in the message it will read as the city name. It does not have to be in the code so delete this part.

Last edited by Pedrunn on 09-09-2002 at 03:08

Dale is offline Dale
King
Sir! Why do you keep clicking on me?
Dec 2000
time: 15:22
  Old Post 09-09-2002 07:25
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Inflate your Upload Space

IW:

Just the programming coming out of me, but why store the entire city (and filling a lot of RAM if you have MANY units) if you can just store the city location? A lot less RAM hungry. Just a thought. Another benefit is if you want your unit to go home, just pass homecity[tmpUnit] into it's movement path.

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:22
  Old Post 09-09-2002 22:54 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Inflate your Upload Space

Yeah, I guess. Depends why Turambar's doing it I guess.

Turambar is offline Turambar
Prince
England
Apr 2002
time: 05:22
  Old Post 09-09-2002 23:58 Visit Turambar's homepage!
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Increase the size of your Attachments

Thanks for the responses I'll try them out soon.

The idea behind this is:

A War Chief unit (these upgrade the more they win) is created in each city and I want to store where it comes from so that, for example if another civ takes London then the war chief from there who may be in a 12 stack army (being the leader of it) might (I'm going to give them personalities) then disobey your orders (if you order him not to retake the city) and go and try to retake his home city.

Also if he dies then a replacement can be built in that city.

I'll also want to use it in messages.

I've a few other half developed ideas in addition to this too.

More questions to follow .

Iroquois is offline Iroquois
Settler

Sep 2002
time: 08:22
  Old Post 11-09-2002 17:29
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Tired of ads?

Hi, all
Does anybody know what mean BombRounds and BombardRange strings in Units.txt? Is it active or disabled?

Is it possible to write SLIC's for Civ-specific units and Run after bombard (if Unit have enough move point after bombard action)?

Regards.

  < 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.0317 seconds (89.16% PHP - 10.84% 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