 |
|  |
 |
|
Martin Gühmann
|
 |
Berlin, Germany
Mar 2001 time: 06:16
|
|
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
|
|
|  |
 |
|
tombom
|
|
Pining for the fjords
Oct 2004 time: 05:16
|
|
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
|
|
Pining for the fjords
Oct 2004 time: 05:16
|
|
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
|
|
|  |
 |
|
Martin Gühmann
|
 |
Berlin, Germany
Mar 2001 time: 06:16
|
|
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
|
|
|  |
 |
|
tombom
|
|
Pining for the fjords
Oct 2004 time: 05:16
|
|
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.
|
|
|  |
 |
|
Fromafar
|
|
Did you consider the precedence of the operator? What do you want (2 * 10 ** 2) to evaluate to?
|
|
|  |
 |
|
tombom
|
|
Pining for the fjords
Oct 2004 time: 05:16
|
|
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.
|
|
|  |
All times are GMT. The time now is 05:16. Apolyton Time is 00:16. |
top of page
|
|
|
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
|
|
|
|
|
|