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 Question
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:18
  Old Post 11-04-2002 01:40 Visit Turambar's homepage!
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
SLIC Question Inflate your Upload Space

Hey everyone I've been lurking round this forum and trying out mods etc for a few weeks now and I've finally decided to join. Anyway I started learning SLIC today thanks to some of the guides here and it's alot easier than it looks but I've a question (and probably will have a load more soon):

Could somone tell me the expression to use in an if statement when a type of unit is attacked. e.g if an archer is attacked I want x to happen, I just don't know the expression to use in the if () bit.

Thanks!

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:18
  Old Post 11-04-2002 02:06 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Support Apolyton buy from Amazon

Well, welcome to the forums, I'm very glad to hear you decided to join and even gladder to see you're interested in SLIC

The answer to your question is simple. The type of a unit is a unit property and therefore, logically (but unfortunately SLIC isn't always this logical), it is a variable of the unit[0] array. So the expression to use in the if statement would be 'unit[0].type == UnitDB(UNIT_ARCHER)', assuming that you have the unit stored in unit[0].

Note that in this case (an unit in the attack), the logical event to use is 'Battle' (not sure if any others could be used as well). However, from 'Battle' you can't directly access each and every unit involved, you must use army[0] (the attacking army) instead. So you should use the GetUnitFromArmy function to extract the unit(s) from this army before you can check the type.

Let me know if you have any more questions, I love to help (especially with simple questions like this one ).

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:18
  Old Post 11-04-2002 03:31 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Support Apolyton, buy Civilization 2

Welcome to the wonderful world of SLIC

Using the event (Battle); if you want the defending army, you can't just use the army[0], as that will give the attacking army.

So...
You'll have to use the location of the battle (location[0] from the event) and then using a for loop, for the number of units in the cell (UnitsInCell(location[0]) do GetUnitFromCell(location[0], index, tmpUnit)
This will store each unit in turn in the defending army (at the location being attacked) as tmpUnit. THEN you can check whether it is an archer, and if it is, do the action.

Pain in the arse, no?

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:18
  Old Post 11-04-2002 04:30 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Support Apolyton buy from Amazon

D'oh! Misread the question, I thought Turambar said attacking...

quote:
Originally posted by Immortal Wombat
Pain in the arse, no?


Nah, that's what makes SLIC fun

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:18
  Old Post 11-04-2002 04:32 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Support Apolyton buy from Amazon

quote:
Originally posted by Locutus
Nah, that's what makes SLIC fun

You enjoy pains in your arse?

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:18
  Old Post 11-04-2002 04:33 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Support Apolyton buy from Amazon

quote:
Originally posted by Immortal Wombat
You enjoy pains in your arse?


No, I enjoy being creative...

Turambar is offline Turambar
Prince
England
Apr 2002
time: 05:18
  Old Post 12-04-2002 00:00 Visit Turambar's homepage!
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Increase the size of your Attachments

Thanks for the responses . I'll try it out soon. I'll probably have a load more questions for you soon anyway.

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