PDA

View Full Version : Modding questions



The Pixie
4th Nov 2003, 13:04
I guess I came to this game a bit late, when I bought it seven weeks ago. And when I first played it I was not much impressed. Looked flash, but that annoying VAL and the first mission does not require you to actually think, you just do as you are told. Then I had another try (for one thing I was impressed this forum was still running), and I got hooked., and last week finished the last mission. So now I am wondering about writting my own missions...

So how do you place rooms? Placing crates is easy, the software puts them as close as possible to the given co-ordinates if you try to pile them on top of each others. Placing rooms wrong gets a complaint from VAL, or just no room and everything going very slowly. But it is possible; it happens in mission 1.

I have established that the co-ordinate system starts from 1,1 in the top-left corner from the initial view when you start the mission. The x-direction is around the ring, each segment is 16 squares. The y-direction is the width of the ring, 32 squares. The lifts take up 4x3 squares, the bulkhead locks 2x2, so avoid them. Are there any other things to avoid? Can you put rooms right up against bulkheads, outer walls or each other?

How do you set the cost for opening a bulkhead?

How do you set the player colour?

How do you set the player starting segment? It defaults to 0, but one of the early missions has this as 8. I cannot see how to do this with unlock as segment 0 is already unlocked.

I have plans for three missions. If they ever come together I will put them on StarPost.

Pixie

DMA57361
4th Nov 2003, 19:57
Originally posted by The Pixie
So how do you place rooms? <snip>

How do you set the cost for opening a bulkhead?

How do you set the player colour?

How do you set the player starting segment? It defaults to 0, but one of the early missions has this as 8. I cannot see how to do this with unlock as segment 0 is already unlocked.

<snip>

Pixie

General comment - get the modding FAQ before the MF site dies or from the Post. It's pretty useful for finding the code for simple things like "bulkhead cost" etc. Remember I've not done thi in about a year . . . v rusty knowledge. :)
In the order of your questions . . .

- Don't know, I never did try this. Look at the file for mission one and you should be able to work it out!

- I'm pretty sure you can do this with a command in an auto-running block. Not sure of the command off the top of my head - check the games mission files again.

- I don't think you can.

- You can I'm sure, as you don't start in segment 0 on later missions. You don't HAVE to unlock segment 0 you know, and drop starting stuff somewhere else.

Hope that helps.
If not wait for someone who not quite so rusty to help. :)

Hand-E-Food
4th Nov 2003, 22:48
Welcome to the forums! Yay for more modders!

Just some quick answers:

So how do you place rooms?
Place_Room <X Y> [<Width Height>] <Deck> <Room_Type> [<Orientation>]

the bulkhead locks 2x2, so avoid them. Are there any other things to avoid? Can you put rooms right up against bulkheads, outer walls or each other?
There is also a 1x1 square adjoining the lock and the door that becomes locked when you open the door. You can place things here, but it can be annoying if you need to replace the room as the square is now unavailable.
You can place rooms as close as you like to walls and doors. Furniture must be one square away from walls and closed doors.

How do you set the cost for opening a bulkhead?
How do you set the player starting segment?
In the Builder Changers In.txt file.

How do you set the player colour?
You can't. It's random.

I cannot see how to do this with unlock as segment 0 is already unlocked.
The starting segments begin unlocked. You can unlock additional segments with the Unlock command or unlock the entire station in the Builder Changers In.txt file.

I have plans for three missions. If they ever come together I will put them on StarPost.
<jitters with anticipation>

Definately get the Mod Guide. I don't know if there is a current link available. If you'd like to PM me your e-mail address, I can send it to you.

Lots of luck! We look forward to it!

The Pixie
5th Nov 2003, 12:22
Thanks for the replies. I have already got the modding guide from mucky foot; it is very useful but does not (as far as I can tell) answer the questions above. I do not think I would be trying without it. I had not even looked in the Builder Changers In.txt file. The cost to open sections and the starting segments are both there, thanks for that. Some more questions:
How does the mission numbers relate to the directory numbers? I have established it is not the obvious way. I know I could go through them, but it is not that easy to tell from the mish.txt file as the VAL texts are all stored elsewhere. If someone has already got a list made, could they give it?
Another question. Many missions have .csv files with, say, trader data, and corresponding .csv.vsh (I think) files. What are the latter? My guess they are the unpatched versions, so are not required.
And a more obscure one. If I create my own mission, play it and save it, then edit the mission, will I be able to load in the saved game? Are there circumstances when I would not, eg if I have added a new variable. I appreciate that changing the autorun block will not work as they has already been run.

Overmind
5th Nov 2003, 22:19
The Text file has all the text in, as you would expect. Until you learn the mission numbers off by heart, refer to this folder for your information. It is pretty straight-forward - just match up the double-digit numbers to those in the folders. I don't know what the CSV.ISH files are - my guess is that MF (RIP) used them as low-size, formatted CSV files. So you can see all the text in the cells at once, donchaknow. Mark has included some with the Yetucyun Guild, so perhaps he knows. Oh, Mark is Hand-E-Food, by the way.

If you edit the mission, then you can restore with new stuff, but it is generally a good idea to start afresh. The variable reloaded is set to 1 whenever a Mish file is, well, reloaded, so you'll need to use this skeleton:

:reloader
if
reloaded = 1
(any other conditions)
then
(setup whatever you've added, set another variable so that this does not happen every reload {hence other conditions}).

This will, unfortunately, mean that every time you add stuff to the mission you will need a new element; this will build up and will be a pain to keep track of. It will only be valid with your save file unless you add lots of variables to :Autorun. And you will have to delete it all afterwards if you want your scipt to look neat.

Don't be put off by all this - I started off with no modding knowledge myself until I got in regular contact with Mark, making the Yetucyun Guild. (The wonders of modern technology - he's in Sydney, I'm in Britain!) You'll learn, I promise. If you get stuck, ask me, Hand-E-Food, DMA57361 who did a lot of missions in days gone by, or Exitium (who I'm pretty sure has done some too). Then there are probably many others I've neglected to mention.

Above all, know that I personally give my support. Now MF is gone, we need to stick together more than ever!

Hand-E-Food
6th Nov 2003, 02:12
I really should be working, but this is much more interesting (and important! :p)

How does the mission numbers relate to the directory numbers?
Pretty much randomly. I suggest going through the StarTopia\text\English\ folder and look at each numbered file. They'll have the mission titles in them.

Another question. Many missions have .csv files with, say, trader data, and corresponding .csv.vsh (I think) files. What are the latter? My guess they are the unpatched versions, so are not required.
The .ish are created by StarTopia when you run the mission. They are temp files and may be deleted. The .csv files store the original data.

And a more obscure one. If I create my own mission, play it and save it, then edit the mission, will I be able to load in the saved game?
I doubt it. I haven't tried, but I think it saves the compiled script and variables into the save game. I had a problem that all my text would disappear after reloading because it was stored in another file. Even if it did load, it would probably corrupt the game because the elements would be in the wrong order. Try adding Incoming messages that can be used to skip ahead in the game to a key point in the plot at any time.

If you edit the mission, then you can restore with new stuff, but it is generally a good idea to start afresh. The variable reloaded is set to 1 whenever a Mish file is, well, reloaded, so you'll need to use this skeleton:

I've checked some of the reloaded code in the StarTopia sandbox. It tends to be for loading external files like Builder Changers In.txt and Moods In.txt. It might have other uses. I haven't experimented with it.

(The wonders of modern technology - he's in Sydney, I'm in Britain!)
Melbourne, actually. (Just nit-picking :p)

You'll learn, I promise. If you get stuck, ask me, Hand-E-Food, DMA57361 who did a lot of missions in days gone by, or Exitium (who I'm pretty sure has done some too). Then there are probably many others I've neglected to mention.
It's a shame Slink isn't here anymore. She knew a lot.

Again, lots of luck!

Exitium
6th Nov 2003, 02:16
Originally posted by Hand-E-Food
You'll learn, I promise. If you get stuck, ask me, Hand-E-Food, DMA57361 who did a lot of missions in days gone by, or Exitium (who I'm pretty sure has done some too). Then there are probably many others I've neglected to mention.
It's a shame Slink isn't here anymore. She knew a lot.

Again, lots of luck!

Actually, I didn't do much editing par se. Although I did screw with the code (not figuratively or near literally), I did manage to find out how StarTopia really works. Although it may appear primitive, it's better than having to deal with special editing programs that more games are using these days. If anyone ever needs to know why Sirens don't like Zedem Monks in the code, and why Space-Vermin are interesting to converse with, I'm the man. Level editing? I'm sure VAL would be full of disdain afterwards. . .

Thank you for mentioning me though!

The Pixie
6th Nov 2003, 08:32
Thanks for the replies and the support
I have now looked in the build changers in.txt file, and found where to change the segment unlocking cost and the start segment. Some interesting other stuff in there too. A tried to make the sun bluey-green, but when I ran the mission could not find the sun...

I seem to have got my room placements sorted. Part of the problem was the naming; I used recharger instead of charger.

So what about furniture? This is from the modding guide:
place_furniture 38 15 sub_deck litter_bin south
It crashed StarTopia to desktop (it was in a block of its own apart from a say command, so I know it is to blame). The position puts it outside the start segment, and I think that was the reason, although I had realised and unlocked the segment. Changing the position to somewhere in the start segment stopped the crash, but no bin.

I will have a look through StarTopia\text\English\ tonight.

I saw the reload variable in the mod guide. Does this reset itself, so it is only run once per reload or is something like this required:
if
reload = 1
then
[stuff]
reload = 0
end

Pixie

Hand-E-Food
6th Nov 2003, 21:39
A tried to make the sun bluey-green, but when I ran the mission could not find the sun...
The sun is an invisible light source. You can see the effects refleting off the station when you go outside the bio-deck. You can also change the colour of ambient space. I've seen shots of the Universe being white!

I seem to have got my room placements sorted. Part of the problem was the naming; I used recharger instead of charger.
Look them up in the guide. Dry_Dock is Star Dock. Collector_Node is Power Booster. And sometimes technology names are different from the room names.

So what about furniture? This is from the modding guide:
place_furniture 38 15 sub_deck litter_bin south
I've read elsewhere that you need to own a furniture crate first. Try placing one in the same element. If that doesn't work, try placing one a fracton of a second earlier.

I saw the reload variable in the mod guide. Does this reset itself, so it is only run once per reload or is something like this required:
if
reload = 1
then
[stuff]
reload = 0
end
I think you do have to reset it. Do it anyway to be safe. Remember to use: Set reload 0 instead of reload = 0

The Pixie
7th Nov 2003, 10:01
I played around with the sun colour, and realised the sun is invisible, as you say. I think I will leave furniture; its not worth the bother. And I keep doing "reload = 1" when I mean "set reload 1"

Pixie

Overmind
7th Nov 2003, 11:35
Heh heh, I remember making similar mistakes in my own early days of modding. You'll get into the swing of it in time. And furniture is worth the bother. If you want to set up an AI station with rooms and furniture for a skirmish mission, for example, it is essential.

There is one Space.ssm that actually does have a sun in it. Browse through them, it's one with a bluey-green nebula.

Hand-E-Food
9th Nov 2003, 10:11
Yeah, but it's just a graphical sun. You can't change it at all.

Overmind
9th Nov 2003, 11:26
Who cares? It looks cool. That's more than enough for me.

The Pixie
10th Nov 2003, 09:06
Well, I have a mission written. I just have to test it. I know Microsoft just publishes software as soon as it is written, but how much debugging do you guys do? I have tested each bit of code as it was put in. I was planning to play the mission through once, saving at strategic points to cover every win or lose situation.

Do I then e-mail it to StarPost?

Another question. What does room_count count? I naively imagined it was the number of rooms, but it seems to be the number of room plus two times the number of deck-segments.

Pixie

EvilLordWolfie
10th Nov 2003, 09:34
I had to reinstall the game when, while messing randomly with mission folders and such, every peep entering the station was automatically in the last 2 or 3 secons of blastosekephalis (is that the right spelling? Overmind lost my copy of ST so I'm working on a replacement) Anyway, it was very pretty, if rather messy. The scuzzers were busy for quite a while. Once, before i reinstalled, I offed the "Pay money to the family of the deceased" rule, and oh, I had some evil, sadistic fun! If anyone can figure out just how I did this, tell me please!

Overmind
10th Nov 2003, 14:50
I can set that up for you if you want. You just disable the death fines and give them Blastocaphelis, setting their moods to the final stages. It'd take some fine-tuning to get them to do it at just the right moment, though.

And I didn't lose your copy at all. I left it in the basement overnight and the pixies spirited it away. (Current theories point towards the pixies being careless members of staff working at Four Winds.)

Room_Count does count rooms. The TurboLift is a room.

This has caused me and Hand-E-Food problems in the past. The Yetucyun Guild has just got its first industry standard mission, by the way. Well, almost!

EvilLordWolfie
10th Nov 2003, 15:18
How dare you insult my intelligence so! Why, are you inciting that I am a foolish musclehead with no retorts but violence and inane cliches? I'm gonna kick your ass for that!

Overmind
10th Nov 2003, 15:19
Thereby proving my point.

EvilLordWolfie
10th Nov 2003, 16:55
No it doesn't. . . think about this. . . have you got it yet? no? well, if you have well done, and if you haven't, then be quiet and lie down before you hurt yourself.

The sixth sick shiek's sixth sheep's sick. Try saying that five times!

muahahahahahaha! they will now become totally preoccupied with the world's hardest tongue twister and therefore not notice when I take over their respective quadrants! THE UNIVERSE IS MINE! *shut up mr jelly, I anm NOT going to give you your own planet!* They are all DOOMED!

The Pixie
11th Nov 2003, 08:17
"Room_Count does count rooms. The TurboLift is a room. "
I guessed that might be the case, it is just not very obvious.

With cam_pos, how do you select what deck you want? I have used in on sub_deck, no problem, but then I wanted it on the bio_deck, and realised there is no deck parameter. It does not seem to be height, the manual says height is from 0 to 100, and 100 is sitill in the sub_deck (or is it 201 to 300 for the bio_deck and the manual is wrong?

Pix

Overmind
11th Nov 2003, 10:42
You can't. Just add a say command, telling the player to look wherever you need the player to look.

The Pixie
13th Nov 2003, 08:19
Another question. When do you need to use reloaded? I appreciate that reloaded is set to one when saved game is reloaded, but what sort of things might need to be set up after a reload? The manual suggests visual counters, but I found they are displayed properly anyway. Are there different degrees of reload, and if I quit StarTopia and restarted then different things might happen?

Pixie

Hand-E-Food
13th Nov 2003, 09:32
I know that external files are lost. People who load my mods after quitting lose all of the text as it's stored in a separate file. It works again if they start the mission a-new and then load their saved game.

I just had a look and it appears that reloaded is only required in Sandbox missions. Have a look at \missions\00\Reloaded00.txt. The first line states:

;This file fixes a bug where savegames used the current sandbox settings rather than those configured when the original game was started.

I've never heard of any problems with not using reloaded. I'd say forget about it unless something does go wrong.

Overmind
13th Nov 2003, 10:33
It'd be fairly simple coding a fix for that. I'll probably do some in my spare time.

The Pixie
14th Nov 2003, 10:16
I have finished my first mission (see here (http://forums.eidosgames.com/showthread.php?s=&threadid=27137) ), and not used reloaded, so I hope it is okay.

Pixie

The Pixie
4th Dec 2003, 09:02
Another question:

Using place_peep, can you position your peep at a random position?

place_peep peep 10 10 sub_deck 100

This puts the peep at the given coordinates, and the interpretor can cope with a variable name for peep.

place_peep peep (rnd%10) (rnd%10) sub_deck 100

place_peep peep peepx peepy sub_deck 100

These fail, I guess because the interpretor is looking for a keyword (mood, criminal, etc.) or a number. Anything else is taken as an error.

Does anyone know a way around this?

Pixie

Hand-E-Food
4th Dec 2003, 23:18
There was an official MuckyFoot mission released, The Targatelli (http://www.muckyfoot.com/startopia/downloads/Targatelli.zip) (Limited time only! On the MuckyFoot site.) I seem to remember that the peeps in this mission were placed next to specific rooms using the Find_Room command.

Here's an example:
place_peep ((rnd%4) + 5) assassin skill 5 mood body 10000 xthugcoorda ythugcoorda sub_deck 1024

So it selects a random super-warrior, to invade your station. The variables are set randomly in segment 1 every 100 seconds.

Perhaps all you need is one or more keywords before you use the variables.

The Pixie
5th Dec 2003, 08:20
I will try that and see what happens.

Thanks

Pixie

The Pixie
8th Dec 2003, 13:36
Not more questions...

If you have AI players on the station, there seems to be little you can do in the way of interactions between them. Is there anything besides:

enemy_count
multitrigger

Is there anyway to control what the AI player does, eg unlocking segments, attacking other players?

Pixie

Overmind
8th Dec 2003, 16:01
Yes, as a matter of fact. Just lock some of the segments, thereby forcing the AI to expand towards the player. You could also try increasing the territory bias for the AI too. It's in a Mood or Build file somewhere. You can even unlock the segments if the human player approaches them, to give the impression the AI was just being aggressive. This is used to great effect in the Kasvagorian Kingdom, where the AI to the East has less space.

Hand-E-Food
8th Dec 2003, 23:50
You can write scripts for the AI players by naming the files mish-2.txt, mish-3.txt and mish-4.txt. One trick can be to include more start-up crates for the AI or extra skilled personel.

You can place peeps in an enemy segment:
Place_Peep Gor Assassin Skill 5 Enemies
An emeny is anyone declared as a Foe in the management panel. Check \missions\00\spy00.txt for other examples.

If you want the three AI scripts to be the same, just use this line in the mish-3.txt and mish-4.txt files:
{missions\<mission name>\mish-2.txt}

The Pixie
10th Dec 2003, 09:28
Thanks for the replies.

What I was really asking about is whether the mish.txt file for one player can get and/or change variables in another players (eg find out how many residents another player has), and whether the status between players can be changed. You cannot, it seems, make an AI player attack at a certain time, for example.

Overmind
"You could also try increasing the territory bias for the AI too. It's in a Mood or Build file somewhere. You can even unlock the segments if the human player approaches them, to give the impression the AI was just being aggressive. "
I had not noticed the territory bias, I shall look at that. Does the AI occupy a segment as soon as it is unlocked, or wait until it needs the space (I guess you could force the issue anyway)?

Hand-E-Foot
"You can place peeps in an enemy segment:
Place_Peep Gor Assassin Skill 5 Enemies"
I did not know of that option, it does not appear in the modding guide. That should be useful too.

Pixie

Overmind
10th Dec 2003, 14:40
Use the Multitrigger command to change a variable across all the scripts. This is more flexible than it seems at first, because this variable could only affect one script or do different things in all the scripts... or anything of the nature. It's a trick we plan to use in the Guild.

Multitrigger triggers an already existing element, so you may want to leave the conditions null.

In the case of counting residents, you would use:

:Residentcounter
if
0
then
set Resident_Count peepstat gor grey targ salt_hog karmarama turakken siren zedem_monk resident roger
end

...with an element set to loop a timer so it has time to evaluate without triggering constantly, which could cause slowdowns.

There is a value somewhere that controls what the AI considers as 'needing space', for expansion.

If you use the Load_Moods/Builds/Class triggers, you can load seperate moods from those in your folder. I'm not completly certain, but I think it has to be a numeric file in your Missions folder, instead of the plain text used in most modding. I haven't tested it though, so the patch might have changed this. The practical upshot of this is if you isolate the values that control AI space management, then it is perfectly feasible that you could max out all those that promote expansion and minimise all those that don't. This would mean a rabid, scruple-less AI with no sense of moderation however, so be sure to supply it with some troops if neccessary. You can also turn it off by reloading your old moods/builds/class.

I'm actually quite surprised MF didn't capitalise on this more. I certainly know I would have. Oh, the possibilities...

EDIT: Whoops, don't forget this'd be a global thing. Controlling individual AIs is almost impossible... Wait. You can do this and turn off attacking particular AIs, meaning the AI will only attack in one direction. Just forget I mentioned it, ehem.

The Pixie
10th Dec 2003, 15:28
I had been thinking of the possibilities of multitrigger. The load builds command is very interesting, I had not thought about that, and it has a lot of possibilities.
Thank.

Pixie