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 > Knee-Deep in SLIC
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
Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:25
  Old Post 02-02-2003 05:15 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Knee-Deep in SLIC Put an end to popups!

I have a question.

Whilst testing out some of the deeper workings of the BattleAftermath event (damn I'm cool), I messaged myself all the values that the event called.

The following results were from a battle where the attacking army lost.

So for BattleAftermath, we have from the docu:

code:
BattleAftermath(army_t, location_t, unit_t, unit_t, int_t, int_t, int_t)

So not having a string for army, I passed in the army[0].size in, and unit[0].type and unit[1].type, the location as {.x},{.y} and the player numbers.
The attached picture is the result.

army[0].size = 97970400 ?? erm... hows that then?
location coords are correct.
units: 1st one is a mystery even to the game apparently, but it brings up a message I've never seen before... (would this be the type of the unit in the attacking army that got wiped out?)
2nd one comes out as 87 (which was the .type of one of the defenders)
player[0] comes out fine - me
player[1] doesn't work at all
and the int at the end is 1. Maybe this means "attackers lost" and 0 is "attackers won"

But the army size thing is a mystery...

Attachment: battleaftermath.jpg
This has been downloaded 122 time(s).

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:25
  Old Post 02-02-2003 11:29
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Re: Knee-Deep in SLIC Increase Your PM Length

quote:
Originally posted by Immortal Wombat
But the army size thing is a mystery...


I have seen this bug with other event. I have tested the ArmyClicked(army_t).
As i figured out you cant know the size of another civ unit in string form.

In my testing with the army[0].size revealed in a message. If you own the unit it gives the correct number but if the owner is another cive big crazy numbers show up like the one you got.

Last edited by Pedrunn on 02-02-2003 at 19:57

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

Ben could you give us the exact string that you used in the message box I think you forgot something concerning player[1].

-Martin

Peter Triggs is offline Peter Triggs
Prince
Gone Fishin, Canada
Jan 2000
time: 05:25
  Old Post 02-02-2003 20:03
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

Weird stuff. I tried:

code:
int_t armysize; int_t armyowner; HandleEvent(BattleAftermath) 'BattleAftermathTestpre' pre { setstring(0,ID_pre); armysize=army[0].size; armyowner=army[0].owner; message(1,'BattleAftermathTestM'); } HandleEvent(BattleAftermath) 'BattleAftermathTestpost' post { setstring(0,ID_post); armysize=army[0].size; armyowner=army[0].owner; message(1,'BattleAftermathTestM'); } messagebox 'BattleAftermathTestM' { show(); Text (ID_BattleAftermathTestTxt ); }


with strings:
code:
BattleAftermathTestTxt "{action[0].text}: armysize= {armysize}, armyowner={armyowner}, 0={player[0].civ_name_plural}, 1={player[1].civ_name_plural}, \n unit0={unit[0].type}, unit1={unit[1].type}" pre "pre" post "post"


The resulting data is the same whether reported pre or post and just depends on who won the battle.

army[0] is the attacking army: if it loses the battle, it ceases to exist. It looks like unit[0] is some attacking unit and unit[1] is some defending unit. Depending on who won the battle, one of these will be the invalid unit and we get that strange error message.

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:25
  Old Post 02-02-2003 23:43 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Suffering from ads?

quote:
Originally posted by Martin Gühmann
Ben could you give us the exact string that you used in the message box I think you forgot something concerning player[1].

Oh yeah, looks like I screwed up the opening brace { I can't give you the exact string, I removed it when I used the tester message for something else.

What I wondered was whether since army[0] does not exist (a pain in the arse btw), army[0].size returns the address of the army size?

Dale is offline Dale
King
Sir! Why do you keep clicking on me?
Dec 2000
time: 15:25
  Old Post 03-02-2003 01:47
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

That large number could be the memory address location of the army. A lot of programmers use this shortcut so they don't need to pass the entire class data into new functions, as it causes multiple copies to be in memory.

The Big Mc is offline The Big Mc
King
Of the universe / England
Oct 2001
time: 05:25
  Old Post 05-02-2003 14:43 Visit The Big Mc's homepage!
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Remove this text

why where you testing this out is there a mod on its way.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:25
Post  Old Post 05-02-2003 22:16 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Get a bigger avatar today!

quote:
Originally posted by The Big Mc
why where you testing this out is there a mod on its way.


I don't know if Ben used it for a new mod possible it is some LOTR stuff or something else. The main information of this thread is how you can test event handlers check the values of the build in variables that are usefull for debugging and that you should extract information from invalid objects. Yeah this will give you sometimes DebugSlic=Yes errors.

So testing this stuff has the purpose of getting information and to satify our curiousity. To get ideas for new stuff.

-Martin

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:25
  Old Post 05-02-2003 23:37 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Suffering from ads?

Battle tracking in the LOTR scenario.

The Big Mc is offline The Big Mc
King
Of the universe / England
Oct 2001
time: 05:25
  Old Post 06-02-2003 16:02 Visit The Big Mc's homepage!
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

I would like to see it when it is done

MrBaggins is offline MrBaggins
King

May 1999
time: 05:25
  Old Post 06-02-2003 17:52
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Suffering from ads?

Out of curiousity, do we know for a fact that *this*

quote:
Quote by MrOgre
Important note! As this documenation is being prepared, the first patch for CTP2 is about to be released. Unfortunately a bug with functions was discovered too late to fix. Specifically, in some cases, using members of unit, army, city, and location variables that are function parameters may not always work as expected. There is, however, a workaround. Copy the function parameter to a local variable and use that variable instead.


was fixed, in every case?

The Big Mc is offline The Big Mc
King
Of the universe / England
Oct 2001
time: 05:25
  Old Post 06-02-2003 18:08 Visit The Big Mc's homepage!
Edit/Delete Message Reply w/Quote
#12 Report this post to a moderator
Increase the size of your Attachments

Could be a lazy activsion thing. But you have a cat in hells chance of getting anything out of the puddle of eternal wisdom(activsion) I remember the war which was designated as a partial victory as the activsion staff got very offensive and would not talk to me.

MrBaggins is offline MrBaggins
King

May 1999
time: 05:25
  Old Post 06-02-2003 18:13
Edit/Delete Message Reply w/Quote
#13 Report this post to a moderator
Help yourself to an AD-FREE life

ahh... I'm not saying that there is any chance of knowing for sure... or getting it fixed if it is... but just maybe its a good idea to copy non int arguments to a local var, just in case... so that we don't get unforseen bugs?

The Big Mc is offline The Big Mc
King
Of the universe / England
Oct 2001
time: 05:25
  Old Post 06-02-2003 18:32 Visit The Big Mc's homepage!
Edit/Delete Message Reply w/Quote
#14 Report this post to a moderator
Increase the size of your Attachments

We could try that.

I would love to know what enemies I am attacking for my hero unit.

MrBaggins is offline MrBaggins
King

May 1999
time: 05:25
  Old Post 06-02-2003 18:42
Edit/Delete Message Reply w/Quote
#15 Report this post to a moderator
Increase the size of your Attachments

I still think you'll have the problem of a non-existent (due to the fact that the designers delete the army/unit after it ceases to exist) defeated army...

The best way of dealing with this is knowing what is being attacked before the battle happens....

using, for instance...


Battle(army_t, location_t)
An army attacks a location

The Big Mc is offline The Big Mc
King
Of the universe / England
Oct 2001
time: 05:25
  Old Post 06-02-2003 19:01 Visit The Big Mc's homepage!
Edit/Delete Message Reply w/Quote
#16 Report this post to a moderator
Tired of ads?

yes that code could work

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:25
  Old Post 06-02-2003 20:48 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#17 Report this post to a moderator
Inflate your Upload Space

quote:
Originally posted by The Big Mc
I would like to see it when it is done

Patience, little grasshopper

I should be done this month unless any bugs show up in testing that passed me by so far.

The Big Mc is offline The Big Mc
King
Of the universe / England
Oct 2001
time: 05:25
  Old Post 06-02-2003 20:55 Visit The Big Mc's homepage!
Edit/Delete Message Reply w/Quote
#18 Report this post to a moderator
Support Apolyton, buy Civilization 2

hoow wise master I have travelled many nights to try to find a slicer with my skill could you point me in the direction of a master slicer.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:25
Post  Old Post 06-02-2003 23:46 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#19 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

quote:
Originally posted by MrBaggins
Out of curiousity, do we know for a fact that *this*

quote:
Quote by MrOgre
Important note! As this documenation is being prepared, the first patch for CTP2 is about to be released. Unfortunately a bug with functions was discovered too late to fix. Specifically, in some cases, using members of unit, army, city, and location variables that are function parameters may not always work as expected. There is, however, a workaround. Copy the function parameter to a local variable and use that variable instead.


was fixed, in every case?


In that case I would recomment to read the small sentence under the code:

quote:

The author apologizes for this and promises that if there is another patch it will be fixed. But the above workaround should always work.


Most important here is the little word: if. They promissed to fix it if there will be another patch but as we all know there was no more patch therefore this bug isn't fixed.

-Martin

MrBaggins is offline MrBaggins
King

May 1999
time: 05:25
  Old Post 07-02-2003 00:01
Edit/Delete Message Reply w/Quote
#20 Report this post to a moderator
Get a bigger avatar today!

weren't there two patches?

1.1

and

1.11


Anyway... I guess its wise to be wary of the warning, and copy these non-ints locally, when you use them.

The Big Mc is offline The Big Mc
King
Of the universe / England
Oct 2001
time: 05:25
  Old Post 07-02-2003 00:28 Visit The Big Mc's homepage!
Edit/Delete Message Reply w/Quote
#21 Report this post to a moderator
Support Apolyton or Terrorists Win

tipical for activsion.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:25
Post  Old Post 07-02-2003 01:00 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#22 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

quote:
Originally posted by MrBaggins
weren't there two patches?

1.1

and

1.11


Anyway... I guess its wise to be wary of the warning, and copy these non-ints locally, when you use them.


No there is just one patch v1.1 and v.1.11 are idential the only different is the installer. The installer of v.1.1 had some problems on non US/UK English OS versions IIRC. So the content is the same.

To the promisse again they said if and not when, so it was at this time already questionable if there would be another patch.

-Martin

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

Wired I should be the last person posted in this thread, but obviously the post wasn't registrated.

-Martin

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:25
Post  Old Post 07-02-2003 22:56 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#24 Report this post to a moderator
Support Apolyton, buy Civilization: The Boardgame

Well I just tried this and good a lot of sytax errors:

code:
HandleEvent(SendGood)'MG_GiveGoodASound'post{ message(1,'MGGoodMessage'); } MessageBox'MGGoodMessage'{ Text(ID_MG_GOOD_MESSAGE); } MG_GOOD_MESSAGE "Ressurce hat: {ressourceDB(value[0])}, {ressourceDB(value[0]).Sound}, {ressourceDB(value[0]).SpriteID}, {ressourceDB(value[0]).Gold}, {ressourceDB(value[0]).Food}, {ressourceDB(value[0]).Production}, {ressourceDB(value[0]).Probability}"


The errors were like this:

arguments not implemented
Function calls not implemented

Well I belive this as most of the fields in the Good.txt don't do anything. But this means the RessourceDB function is useless.

-Martin

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:25
Post  Old Post 07-02-2003 23:02 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#25 Report this post to a moderator
Get a bigger avatar today!

And again a not registered post.

-Martin

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:25
  Old Post 10-02-2003 15:11 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#26 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

I think it just means you can't call functions from the string files. You need to assign it to a global in the SLIC, and then pass that to the message box.
ResourceDB() is an int_f function that returns a number given a string, so it can't be used in the string files.

The Big Mc is offline The Big Mc
King
Of the universe / England
Oct 2001
time: 05:25
  Old Post 10-02-2003 22:27 Visit The Big Mc's homepage!
Edit/Delete Message Reply w/Quote
#27 Report this post to a moderator
Support Apolyton buy from Amazon

I had a problem at the week end to I put in some slic for my science victory and got an error. I tried to pass a player into a variable and then use that variable to find out the number of cities the player had.

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