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 > Civilization: Call To Power > CtP-Creation > Some more slic questions.
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!
12.Sep: `CTP CHALLENGE LADDER` - SEPTEMBER UPDATE
09.Sep: EARLY BUILD SPRITE EDITOR
02.Aug: `SUPERLEAGUE` SIGN-UP

bottom of page
  - CIVILIZATION: CALL TO POWER @ GAMESTOP $9.99 - CIVILIZATION: CALL TO POWER @ AMAZON $9.99
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
gemini is offline gemini
Settler

Jan 1970
time: 05:13
Unhappy  Old Post 30-04-2000 08:25
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Some more slic questions. Support Apolyton, buy Galactic Civilizations

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

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:13
Post  Old Post 30-04-2000 18:11 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Support Apolyton, buy Civilization 2

gemini,

Let me answer your questions:

1. I haven't actually tested this but I pretty sure variables are handled globally even over multiple files. The way I suspect it works is that all SLIC-files are read into memory first and then processed. Once loaded into memory the program can't see which code comes from which file, so all code is handled as if it comes from one file. So if you don't want variables interfering with each other you'll must give them different names.

2. I wanted something like this myself for flat-map support as well (to store the map-edge locations) but as far as I know that isn't possible. I *have* found some sort of a workaround this, although my code still has some bugs (if it wasn't for those bugs we would have had flat-map support a month ago) and I don't know if something like this will work for your situation. Here it is anyway:
For existing maps I created a location-variable for every location I want to store. I then placed a dummy-unit (created just for this purpose) on every location I wanted to store through the cheat menu. So this doesn't work for random maps, you'll have to manually put the unit(s) into place. When you click on a dummy-unit you get a message box asking you if you want to kill the dummy-units again and store their locations (and in my case the place the map-edge at those locations). So once you do this you your old map back and the locations are stored (if you need different locations for different things you could create different types of dummy units). All you have to do now is click on Clear LOS in the cheat menu and save your scenario. I think this should work although, as I said, I'm still having some trouble with this myself (but I'm not sure where the problem is exactly so it might work fine for you).
If you don't know how to implement this idea in SLIC-code I'm willing to send you my files for flat-map support as an example or even help you create the code for your specific situation.

Locutus

gemini is offline gemini
Settler

Jan 1970
time: 05:13
Talking  Old Post 01-05-2000 09:46
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Support Apolyton, pre-order Civilization IV

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 is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:13
Unhappy  Old Post 03-05-2000 00:07 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Increase Your PM Length

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 is offline gemini
Settler

Jan 1970
time: 05:13
Wink  Old Post 04-05-2000 09:31
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Lose 30 kilos (of popups)

Hey Locutus, I found something that may help the both of us.

typelocation bliz;
trigger 'move' when (IsHumanPlayer(g.player)){


Makelocation(bliz, 46,44,0);
createunit(g.player, unittype("UNIT_SETTLER"), bliz,0);

message (g.player, 'whoiswho');}

Ah yes!!!! The Makelocation function works like a charm. You can pass in hex cooridinates into location variables. I tested it. It works, as you can tell I had it build a settler everyturn on the coordinates held in the bliz location variable. I also sent myself a message displaying the value of the variable bliz just to double check things and it seems to work!!!

So I hope this helps you out a bit as well.

------------------
Gemini

Dogmatrix is offline Dogmatrix
Chieftain
Moama, N.S.W, Australia (+11 GMT)
Apr 2000
time: 05:13
Question  Old Post 07-05-2000 13:04 Visit Dogmatrix's homepage!
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Support Apolyton, buy Alpha Centauri

Hey gemini,
I think it was you who said that you can use slic to make an advance available, eg Majanic Assembly. Could you tell me how to do it please?. The reason I don't know is that I've not had time to stuff around with slic over the last few weeks and it requires a bit of getting used to all the functions.

Later,
Dogmatrix

P.s. The reason I've had time to write all of my replies is because I do it at school and we don't have CTP at school so mods are at home, a pitty . See ya!

gemini is offline gemini
Settler

Jan 1970
time: 05:13
  Old Post 08-05-2000 08:22
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

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

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:13
Thumbs up  Old Post 09-05-2000 15:49 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Support Apolyton, buy Civilization 2

gemini,

Great! I've been looking for a function like that for a long time Thanks a lot for finding that out! I think that makes flat-map support a lot easier although there are also some complications (but I think they can be solved).

Again, thanks man, great job.

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:13.
Apolyton Time is 00:13.
    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.0336 seconds (89.83% PHP - 10.17% MySQL) with 30 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