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 > Call To Power II > CtP2-Source Code Project > Design: New SLIC functions
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!
CivGroups
CTP2 Source Code Project (59): Not a Member - Join

bottom of page
  
Author
Thread   
Pages (3): [ 1   2   3   ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:16
Post  Old Post 25-01-2005 01:33 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#61 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

quote:
Originally posted by tombom
One problem I'm running into now is that I have no idea how to set the ACTIVISION_ORIGINAL thing in the .y files. Martin's changes have this around them with no problems, but I can't get it to work.


It is very simple, the *.y files don't create original code. They allow additional slic santax but that doesn't do anything. The stuff on the right side of the expression in braces is put into a source file and therefore you can only use preprocessor derectives within the braces, of course then you cannot put it into one line as you did.

Of course you should mark every change you do by ACTIVISION_ORIGNAL at least in source and header files, as long as our svn server is not running with the final version of all revisions. And of course as well take a look into the files that we have modified, they all have at the top a description about what we did. Please add a description of your alterations there, so that we know what you did to the file.

At least I would like know if you did anything with the slicif.h, as it seems that the SOP_EXP enum member was already there in the original source code.

quote:
Originally posted by J Bytheway
(I doubt we'll ever want bitwise XOR in SLIC, but then again, you never know...)


Are you sure, espeacilly if you consider that some unit properties are stored in integers, like CanSee and VisionClass, MovementType, and of course not only for units but also for armies.

-Martin

Last edited by Martin Gühmann on 25-01-2005 at 19:46

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:16
  Old Post 25-01-2005 19:35 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#62 Report this post to a moderator
Lose 30 kilos (of popups)

quote:
Originally posted by Martin Gühmann
Are you sure, espeacilly if you consider that some unit properties are stored in integers, like CanSee and VisionClass, MovementType, and of course not only for units but also for armies.


(Incidentally, you misattributed your quote)

I would say that it's probably not a good idea to expose such fields in their raw form in SLIC, but perhaps it is.

In any case, bitwise AND and OR are considerably more useful than XOR, but on the other hand it would be silly to include some but not all of the standard operations. But even if we do I'm sure we can find another symbol. I like '^' for exponentation, but I'm happy to be overruled.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:16
Post  Old Post 25-01-2005 19:52 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#63 Report this post to a moderator
Increase the size of your Attachments

quote:
Originally posted by J Bytheway
(Incidentally, you misattributed your quote)


Sorry, I fixed that.

quote:
Originally posted by J Bytheway
I would say that it's probably not a good idea to expose such fields in their raw form in SLIC, but perhaps it is.

In any case, bitwise AND and OR are considerably more useful than XOR, but on the other hand it would be silly to include some but not all of the standard operations. But even if we do I'm sure we can find another symbol. I like '^' for exponentation, but I'm happy to be overruled.


Well the were occasion, when I could use it. I mean it makes the code more compact and faster, of course harder to understand as well. But in order to expose these bit flags to slic it might be easier to expose then in raw form then in single bit form.

-Martin

tombom is offline tombom
Chieftain
Pining for the fjords
Oct 2004
time: 05:16
  Old Post 25-01-2005 23:14
Edit/Delete Message Reply w/Quote
#64 Report this post to a moderator
Put an end to popups!

quote:
Originally posted by Martin Gühmann
At least I would like know if you did anything with the slicif.h, as it seems that the SOP_EXP enum member was already there in the original source code.

I hadn't thought of checking for that already there as it wasn't in any of the other pieces of code. Odd.

Sorry for the rest. i was really just testing it out. I've attached a new version which should hopefully fix everything you've said, although I haven't been able to test it because I haven't downloaded DirectX 9.0b SDK yet. One thing though - even before adding these changes, I always get one shift/reduce conflict while yacc does this file. is this normal?

EDIT: Attachments are playing up. this attachment is for the post below.

EDIT2: Just uploaded a new one which includes a file I'd missed before.

Attachment: slic.zip
This has been downloaded 0 time(s).

Last edited by tombom on 26-01-2005 at 12:19

tombom is offline tombom
Chieftain
Pining for the fjords
Oct 2004
time: 05:16
  Old Post 26-01-2005 00:49
Edit/Delete Message Reply w/Quote
#65 Report this post to a moderator
Get a bigger avatar today!

Here is a version which uses ** instead of ^. No real reason, it just seemed more natural to reserve ^ etc for the same things they are in C. I had to make changes to the lexer too so now that is included. Comments added at the top of all files.

Last edited by tombom on 26-01-2005 at 02:22

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:16
  Old Post 26-01-2005 21:12 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#66 Report this post to a moderator
Remove this text

quote:
Originally posted by tombom
One thing though - even before adding these changes, I always get one shift/reduce conflict while yacc does this file. is this normal?


Yes, that's always happened. I had planned to investigate it, but I forgot about it...

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:16
Post  Old Post 30-01-2005 04:37 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#67 Report this post to a moderator
Support Apolyton, buy Alpha Centauri

Well The Big Mc obviously I should show you what I mean, here is my idea of the AddSlaves function based on the AddPops function:

code:
SFN_ERROR Slic_AddSlaves::Call(SlicArgList *args) { if(args->m_numArgs != 3) return SFN_ERROR_NUM_ARGS; Unit city; if(!args->GetCity(0, city)) return SFN_ERROR_TYPE_ARGS; sint32 count; if(!args->GetInt(1, count)) return SFN_ERROR_TYPE_ARGS; sint32 victim; if(!args->GetPlayer(2, victim)) return SFN_ERROR_TYPE_ARGS; MapPoint pos; city.GetPos(pos); sint32 i; if(count > 0) { for (i=0; iAddEvent(GEV_INSERT_Tail, GEV_MakePop, GEA_City, city.m_id, GEA_Player, victim, GEA_End); } } else { // Add code to convert count slaves to normal pops here later. for(i = count; i < 0; i++) { // Add pop remove code here later (KillPop event). } } sint32 delta_martial_law; CityData *cd = city.GetData()->GetCityData(); cd->GetHappy()->CalcHappiness(*cd, FALSE, delta_martial_law, TRUE); return SFN_ERROR_OK; }


I changed it so that the function expect three parameters.
I optimized the city retrieval code.
And I passed an additional GEA_Player argument to the MakePop event via the event manager.

And as we know that the MakePop event works also with adding slaves, I can hope that this works without a crash. But now it's your turn to test the code. I don't all the work for you.

-Martin

The Big Mc is offline The Big Mc
King
Of the universe / England
Oct 2001
time: 05:16
  Old Post 30-01-2005 05:34 Visit The Big Mc's homepage!
Edit/Delete Message Reply w/Quote
#68 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

martin the code will not work as you will still have the problem I have. my add slave function works fine for a human player however the ai changes something stupid with it that cases it to crash. However it does seam to.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:16
Post  Old Post 30-01-2005 22:14 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#69 Report this post to a moderator
Support Apolyton buy from Amazon

Obviously I have to test it on my own, but rather next weekend than this one. By the way if it crashes it must generate a crash log espeacilly a debug version should write into its log asserts. So what are these asserts?

-Martin

The Big Mc is offline The Big Mc
King
Of the universe / England
Oct 2001
time: 05:16
  Old Post 31-01-2005 04:45 Visit The Big Mc's homepage!
Edit/Delete Message Reply w/Quote
#70 Report this post to a moderator
Support Apolyton, buy Civilization: The Boardgame

here

Attachment: logs.zip
This has been downloaded 1 time(s).

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:16
Post  Old Post 31-01-2005 21:51 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#71 Report this post to a moderator
Support Apolyton

These two stack traces aren't very helpful, I can see that the problem is related to the number of workers you have in the city. My guess is that something wasn't registered at all, and therefore my idea to use the event. And the event solution really doesn't work?

code:
c3debug.cpp@300 : Assertion (WorkerCount() >= delta) Failed in File:C:\Program Files\Activision\CTP2code\ctp2_code\gs\gameobj\Cit yData.cpp, Line:5226 c3debug.cpp@303 : Stack Trace: ' 0x00451a30 [(unknown) + 0x0] 0x0044c7f4 [(unknown) + 0x0] 0x0055ac1c [(unknown) + 0x0] 0x00a895be [(unknown) + 0x0] 0x00a88cda [(unknown) + 0x0] 0x00a97567 [(unknown) + 0x0] 0x005b86bb [(unknown) + 0x0] 0x006c15f1 [(unknown) + 0x0] 0x006c14b8 [(unknown) + 0x0] 0x006c2e83 [(unknown) + 0x0] 0x006bf038 [(unknown) + 0x0] 0x006c2a55 [(unknown) + 0x0] 0x006c2919 [(unknown) + 0x0] 0x006c27c5 [(unknown) + 0x0] 0x006c25a6 [(unknown) + 0x0] 0x004adc11 [(unknown) + 0x0] 0x004a3d94 [(unknown) + 0x0] 0x004a144a [(unknown) + 0x0] 0x00468222 [(unknown) + 0x0] 0x0046877e [(unknown) + 0x0] 0x0045c422 [(unknown) + 0x0] 0x0045ba52 [(unknown) + 0x0] 0x00abea63 [(unknown) + 0x0] 0x77e814c7 [(unknown) + 0x0] ' civ3_main.cpp@1629: Exception: 'Breakpoint' thrown. civ3_main.cpp@1634: Exception Stack Trace: 0x0044c843 0x0055ac1c 0x00a895be 0x00a88cda 0x00a97567 0x005b86bb 0x006c15f1 0x006c14b8 0x006c2e83 0x006bf038 0x006c2a55 0x006c2919 0x006c27c5 0x006c25a6 0x004adc11 0x004a3d94 0x004a144a 0x00468222 0x0046877e 0x0045c422 0x0045ba52 0x00abea63 0x77e814c7


Two things are wrong here first the assert line is not line number 5226 but it is 5570, so your version of CityData.cpp must be hopless outdated. And the stack traces just contain numbers, not actual the paths from where the problematic code was called. And as the log tells me that you copied it to the following position: C:\Program Files\Activision\Copy of Call To Power 2\ctp2_program\ctp\CivCTP_dbg.exe
even if the code lies there: C:\Program Files\Activision\CTP2code\ctp2_code\ means that you don't execute the program from the VC++ IDE directly, that means that you don't use the debugers full potential. Not a very good idea. So next time execute the program from C:\Program Files\Activision\CTP2code\ctp2_code\ctp\ at best from the VC++ IDE to do this just press Ctrl+F5 and the program is compiled if necessary and executed.

-Martin

tombom is offline tombom
Chieftain
Pining for the fjords
Oct 2004
time: 05:16
  Old Post 12-02-2005 13:28
Edit/Delete Message Reply w/Quote
#72 Report this post to a moderator
Support Apolyton, buy Call to Power 2

Here is the power of operator. It works, but I get an assert when quitting the game in one of the aui files. I doubt this was caused by this though.

If it's OK, I'll put it in the altered sources thread.

tombom is offline tombom
Chieftain
Pining for the fjords
Oct 2004
time: 05:16
  Old Post 12-02-2005 14:11
Edit/Delete Message Reply w/Quote
#73 Report this post to a moderator
Support Apolyton, buy Civilization: The Boardgame

I forgot the file

Attachment: pow_op.zip
This has been downloaded 5 time(s).

Fromafar is offline Fromafar
Prince

May 2003
time: 06:16
  Old Post 16-02-2005 23:41
Edit/Delete Message Reply w/Quote
#74 Report this post to a moderator
Remove this text

Did you consider the precedence of the operator? What do you want (2 * 10 ** 2) to evaluate to?

tombom is offline tombom
Chieftain
Pining for the fjords
Oct 2004
time: 05:16
  Old Post 19-02-2005 13:13
Edit/Delete Message Reply w/Quote
#75 Report this post to a moderator
Enter the AD-FREE zone

Suddenly the code has started getting asserts in SlicSymTab.cpp. It was working fine before so i don't know what's happened. If anybody else has tried it could they say if this is happening to them?

Precedence: haven't thought of that much. I think it should come after all the numeric operators so that would evaluate to 20 ** 2.

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:16
  Old Post 19-02-2005 15:11 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#76 Report this post to a moderator
Support Apolyton, pre-order Civilization IV

quote:
Originally posted by Martin Gühmann
Well The Big Mc obviously I should show you what I mean, here is my idea of the AddSlaves function based on the AddPops function:

Is it required that there be a victim? Or rather, is it possible to write code to add a slave without there being a source city?
Leaving the third argument optional would make it much more flexible I think.

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

no you don't need a victim.

the code to add a slave works unfortunately the ai does something that screws up the function.

 
Pages (3): [ 1   2   3   ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:16.
Apolyton Time is 00:16.
    top of page
Rate This Thread:
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.0565 seconds (91.17% PHP - 8.83% MySQL) with 36 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