 |
|  |
 |
|
gemini
|
|
Hey, got some questions about slic.
1. I know it says that all the variables are global but are they global only throughout that one file or multiple files. For example.
If I had two files slic.slc and gem.slc and I declared x as a variable in both files would each one interfere with each other or are they isolated from each other??
Sorry if the way I questioned this above seems a bit crude but I'm quite new to any kind of programming.
2. Also, is there any way in slic to store hex locations. I know it should be possible to do this with something like unit.location and city.location but I have been unable to store just plain old hex locations in some type of typelocation variable, I've tried almost everything and have almost come to the conclusion that it is not possible. So for example,
If you wanted to build a unit on a certain hex location that is not a city and the coordinates for the hex were something like this 46,44,0, can this be done, can you pass 46,44,0 those hex numbers into some sort of variable so you can script a unit to be built on that hex.
------------------
Gemini
|
|
|  |
 |
|
gemini
|
|
Hey Locutus, Thanks man!!!!
Yes, regarding question 1, that kinda what I thought.
Your solution to question 2 is something that I never thought of doing and it should work theoritically. But I tried this little test and didn't produce a very good ending. This is just a simple little trigger.
trigger 'move' when (IsHumanPlayer(g.player)){a = 1;
bliz = bliz + a;
message (g.player, 'whoiswho');}
Just a simple trigger that increments the variable bliz every turn and sends a message to me so I can make sure the value of bliz changes each turn.
Anyway, the reason I tried this cos I wanted to test to make sure that the variable would retain it's value if the game was saved and loaded again.
For example if after 20 turns the value of bliz was 20 and the game was saved by the user and then the user exits the game, when he returns would bliz equal 20 again or start over at 1.
So that's what I did. I played for 20 turns everything was going fine and I recieved a message everyturn and I confirmed the value of bliz was being incremented with every turn. I then saved a game. Exited ctp. Restarted ctp. Then I tried to load the game again it immediately crashed and gave me this page fault error thingy.
I tried this several times after rebooting the computer and still produced the same result.
Have you run into anything like this before??
Is this maybe what your trigger for your flat map support is doing.
So I'm not sure if I build dummy units on my map to store the locations into location variables if it will retain it's value after a person has loaded a save game. Hmmm
Maybe,,,do you have to save it as a scenario, cos I just saved as a normal savegame.
Thanks for your quick responses by the way Locutus!!!!
Also thanks for the offer of help on this subject.
------------------
Gemini
|
|
|  |
 |
|
Locutus
|
|
ACS CTP1/2 Manager & Civ4 Co-Manager
|
 |
Hengelo, The Netherlands
Nov 1999 time: 06:13
|
|
I never investigated why I had problems loading saved games because I had plenty of other problems to take care of first but I guess you found the source of the problem for me. Mayor bummer That means unit-locations can't be stored for long times, and limits me with flat-map support (it will still work, but less elegant) and probably make whatever you're trying to do impossible. The only way to do whatever you want now is to place a unit as a placeholder at the location you need to store or something like that. If you tell me what exactly you want I can think about a possible solution but I really need some specifics. The solution, if it exists at all, will probably be an ugly hack specific for your situation, such as we're using for flat-map support (we use units for that instead of terrain-types).
Well, thanks for finding out that problem anyway, probably saves me many hours of frustration solving this and other flat-map related problems.
BTW I saved it as a normal game as well, but if it doesn't work with normal savegames it doesn't really matter if it works as a scenario: you want players to be able to save a game.
Locutus
[This message has been edited by Locutus (edited May 02, 2000).]
|
|
|  |
 |
|
gemini
|
|
Hey Dogmatrix, Well no it wasn't me who told you about that I think it was Locutus but let me answer your question anyway.
Use this Function
GrantAdvance(player, advance)
I think the advance is the index in advance.txt. But I am not 100% sure about that.
For example.
GrantAdvance(g.player, 10);
Hope that helps.
------------------
Gemini
|
|
|  |
All times are GMT. The time now is 05:13. Apolyton Time is 00:13. |
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
|
|
|
|
|
|