 |
|  |
 |
|
Maquiladora
|
|
Downloaded and played some 50 turns of the new playtest. Nothing gone wrong yet, so thats good, but just a couple o things though.
Why is there such radical colours for the first 8 players? The bright green for player 3 is hard to look at. Fine if im playing with 32 i expect to get some strange colours, but not in the first 8. The dark blue for player 8 is hard to see on the graph too.
Of course its pretty easy to change the colors manually in the text file, but its not a good idea to have these as the default colours for someone new to the playtest.
Another thing you can see in the screenshot, the capital "C" on every window has a part missing from the font.
On the starting screen on map type select for Uranus it says, "Noth and South....".
Attachment: cs.gif
This has been downloaded 275 time(s).
|
|
|  |
 |
|
Maquiladora
|
|
quote: Also... if you order a unit to go somewhere pretty far, then the game thinks for several seconds before the unit starts moving. This was always the case, IIRC, but any way to work around that, perhaps? |
Im getting this too, it certainly wasnt always this long a pause. I press "m" and give the Knight a route along roads and it takes about 1-2 seconds to respond. The funny thing is, the first 5 or so turns after i loaded the game, there was no pause, like it always is, then from about 5 turns in it pauses long every time i give a route.
|
|
|  |
 |
|
Fromafar
|
|
In the way you are using it here, it will return true every time after the first valid city has been found.
You are using GetCityByLocation, but are not checking its return value. When GetCityByLocation returns 0, there is no valid city at the location. In this case, the tmpCity variable is not updated, so it will still have the - valid city! - value from the last successful call.
|
|
|  |
 |
|
BureauBert
|
 |
Vienna, Europe
Apr 2003 time: 06:36
|
|
quote: posted by Fromafar
In the way you are using it here, it will return true every time after the first valid city has been found.
You are using GetCityByLocation, but are not checking its return value. When GetCityByLocation returns 0, there is no valid city at the location. In this case, the tmpCity variable is not updated, so it will still have the - valid city! - value from the last successful call.
|
Thank you, this explains it, so there is no need for fixing. 
quote: posted by Martin Gühmann
From the source code the CityIsValid function is OK. And I think your problem is rather that you don't know how slic works.
|
You do believe me that I am not doing all this for getting rich and famous, dont' you? Like most of the people here I am researching SLIC for having some serious fun. Let me put it in other words: This is not my profession, and even in this case I could not be blamed for "not knowing how SLIC works", since this scripting language is not documented too well. I think it is not completely dull to assume that a function "GetCityByLocation(location_t, city_t)" would just fill city_t with the city if there is a city and leave the variable empty (assign 0, NULL, whatever) if there is no city.
If I knew how GetCityByLocation works I could have considered the fact that SLIC keeps the value of local variables, somehow. But I have to admit that I didn't know either what this *exactly* means until you provided this information in your above answer (if I am interpreting it correctly): "In SLIC, local variables keep their values inside the function they are declared in (when the function is called again)". I wonder what happens if two local variables have the same name: Will SLIC recognize them as different local variables? For being on the safe side, most modders seem to be careful about using different names for local variables ...
Anyways, I am trying to contribute to a proper documentation of SLIC and other modding stuff and I updated some information here for helping SLIC-ignorants like me to become SLIC-gurus one day.
I will still appreciate any information about how things *really* work.
|
|
|  |
 |
|
BureauBert
|
 |
Vienna, Europe
Apr 2003 time: 06:36
|
|
I know this is the playtest thread but I had a brief look at the descriptions for similar functions in the original documentation and, though they are all referenced to as int-functions, their description does not clearly state what this means. I would suggest the following:
- GetArmyByIndex(int-player, int-index, armyvar): Returns true if the indexed army of the given player exists and stores it into armyvar
- GetArmyFromUnit(unit, armyvar): Returns true if the given unit belongs to an army and stores the army into armyvar (AFAIK units always belong to an army, so this function would really always return true)
- GetCityByIndex(player-int, index-int, cityvar): Returns true if the indexed city of the given player exists and stores it into cityvar
- GetStopResearchingAdvance(player1, player2, intvar): Returns true if player1 wants player2 to stop researching an advance and stores the advance's index (-> Advance.txt) into intvar
- GetUnitByIndex(int-player, int-index, unitvar): Returns true if the indexed unit of the given player exists and stores it into unitvar
- GetUnitFromArmy(army, int-index, unitvar): Returns true if the army contains a unit given by index (from 0 up to number of units in the army - 1) and stores it into unitvar
- GetUnitFromCell(location, int-index, unitvar): Returns true if there is a unit given by index (from 0 up to number of units in the cell -1) at the given location and stores it into unitvar
Any comments/corrections on these descriptions? 
|
|
|  |
 |
|
kaan
|
|
Aarhus
Mar 2001 time: 05:36
|
|
quote: Originally posted by BureauBert
You do believe me that I am not doing all this for getting rich and famous, dont' you? Like most of the people here I am researching SLIC for having some serious fun. Let me put it in other words: This is not my profession, and even in this case I could not be blamed for "not knowing how SLIC works", since this scripting language is not documented too well.
|
Hi BureauBert
I would like you to understand something about Martin Gühmann. Although he is very good at english and have a large vocabulary he is still using German grammatics most of the time (and im using Danish grammatics most of the time).
This can sometimes have result that what he writes can be highly offensive if this is not taken into account.
Please do not take offence of his writings, I am sure that he is just pointing out the fact that the error isnt in the source code but in your understanding of SLIC.
Regards
Klaus Kaan
|
|
|  |
 |
|
BureauBert
|
 |
Vienna, Europe
Apr 2003 time: 06:36
|
|
Good morning, gentlemen!
Thank you, Fromafar, for your useful additional information. Although I am not a C-programmer (I used to work with "Clipper" a long time ago, if anyone remembers that and I have some experience with Perl, that's about it - and I did learn all I know about "programming" by doing) - anyways: Thanks to your explanation I now *do* understand for the first time how those local variables are handled in SLIC. And I am now able to add the above descriptions to the "knowledgebase".
Hi Kaan! Well I do understand that there are different people form all over the world in this forum and they all contribute some of their local habits, in most cases also their humor - this is what I always enjoyed here. I am afraid that I am contributing some of my Viennese habits, too. And I really don't mind if someone corrects me or even tells me my understanding of certain items in our "modding toolbox" is complete nonsense. If I am reporting a "bug" and someone tells me it's no bug at all but my own fault in using some SLIC-function, I am always glad to learn how to use SLIC correctly and I think there might be one or two other people out there who do not already know everything about SLIC, too (just as a sidenote: usually I *do* try and think about it myself before posting here , though the result might not always look like that).
As for grammatics and offense: I think I should eventually discuss this one with Martin himself in the first place (maybe via PM rather than via this thread). And yes: I am absolutely willing to take some minor differences between german and viennese language into consideration, too ... 
With my best regards to all of you
Bert
|
|
|  |
 |
|
Martin Gühmann
|
 |
Berlin, Germany
Mar 2001 time: 06:36
|
|
I'm sorry BureauBert if you felt being offended. However I think the cause of the missundarstanding wasn't a problem of grammer, but rather of word selection. Actual I wanted to say something about linkage, scope qand storage in slic. And also state this in the sentence, but I thought that you might not know these terms and actual more important I would have been in the need to look it up myself either to get it right. And my time this week is limited.
However slic in general is not uncomplicated, because it doesn't work as you expect, because of design, because of bugs. The storage duration you encountered is one example. IIRC I read somewhere that slic uses a c like syntax, for me that implies that local variables lose their values when the block of their declaration is left. It is not very nice to figuere out why a function does something else than expected, just because an array is not emptied when a function is left. In particular if you have to do it the hard way.
For the names of local variabled I don't know if you can use them in other block. At least I know that this gives an slic error:
code:
HandleEvent(BeginTurn)'Test_Name'post{
int_t i;
}
HandleEvent(ArmyClicked)'Test_Name'post{
int_t i;
}
Because i is defined twice in the Test_Name event handler. Both event handle blocks have the same name. But I don't know if you can use the i in both blocks if you just define it in one block.
Doing this would be very interested, because if you need a variable that should be used in more than one event handler, you don't need to make it global. Something that you don't like if you are used to program object orientated.
-Martin
|
|
|  |
 |
|
BureauBert
|
 |
Vienna, Europe
Apr 2003 time: 06:36
|
|
Good morning once again & Hi Martin!
quote:
I'm sorry BureauBert if you felt being offended. However I think the cause of the missundarstanding wasn't a problem of grammer, but rather of word selection.
|
OK, OK, it's OK for me and you are certainly right in your analysis about grammar/word selection.
This is such a small, nice community of people dealing with SLIC and CTP2-modding at all that I really don't want to "make a mountain out of a molehill" (that's what my dictionary suggests - it's about 20 years old ). Those viennese people can be so touchy at times .
quote:
And my time this week is limited
|
Ah, yes, at least some of us do have a life.
quote:
However slic in general is not uncomplicated, because it doesn't work as you expect, because of design, because of bugs.
|
... and the efforts and insights of the source code team will certainly help sorting these things - sometimes maybe even my "bug-" or bug-reports and questions ...
|
|
|  |
 |
|
Fromafar
|
|
quote: Originally posted by Martin Gühmann
[...]
Both event handle blocks have the same name. But I don't know if you can use the i in both blocks if you just define it in one block.
Doing this would be very interested, because if you need a variable that should be used in more than one event handler, you don't need to make it global. Something that you don't like if you are used to program object orientated.
|
Hadn't thought of this possibility. In C, non-static function names were supposed to be unique. However, the event handlers are never called explicitly, so multiple blocks having the same name is not an immediate problem.
If you define the variable (only once) in some block, it will be shared by all blocks with the same name. Defining it twice - as in your example - will result in an error.
I doubt this is an intended feature. Most likely it is a design flaw. While you may have a valid use for it, it will have a nasty consequence as well. When you (think you) are intentionally accessing a global variable in some function, you will end up accessing a completely different variable when someone else later adds an event handler with the same name as your function.
|
|
|  |
 |
|
Fromafar
|
|
quote: Originally posted by Martin Gühmann
It is not my intention to access an global variable. My intention is to access local variables in more then one context, and here lies the problem, because my goal is to encapsulate such a variable, so that it can only be used locally, and noone can change the value of my variable without modifing my code.
|
That's the problem exactly. There is no encapsulation of the variable at all. Without changing your code anywhere, I can still access your variable. I only have to define a new event handler with the same name. And worse, I may even do this while being completely unaware of your code. When I do not define the variable in my piece of code, I may think that I am accessing a global variable, but I am actually tricked into accessing your variable.
|
|
|  |
 |
|  |
All times are GMT. The time now is 05:36. Apolyton Time is 00:36. |
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
|
|
|
|
|
|