New Modding Features

Talk about your new mod or map here

Moderators: bert_the_turtle, jelco

brice
level2
level2
Posts: 167
Joined: Fri Feb 23, 2007 6:04 am

Postby brice » Fri Mar 16, 2007 1:39 pm

... one more feature request and a possibly trivial bug fix.

1) It would be great if scripts could relink dishes in game. The particular scenario I'm interested in is when a static dish network is setup, like in the last level of Contagion. The user can select dishes, but they don't respond to commands. If a script could update the building link table, then the static network could be used for dynamic branching paths.

To be clear, these kinds of dish networks are best setup without control towers -- so the towers don't have to be hidden or protected. But I can think of scenarios where a static network might be taken over by a team, so sometimes CTs would be used. The hack that Contagion used is to set team=1, global=1 in map.txt and team=-1 (or 255),online=0 in the game.txt link table. If this is actually a dish bug, then the script function would of course need to tolerate it. Please don't fix this bug!

It might be useful if the script function also worked on non-static dish links... especially with multiple teams and multiwinia coming up. That could be used to disrupt the player's network at the worst possible moments.

It would also be useful if a dish could be linked to a special number which would randomize it's direction. Currently the special number -1 can be used to link a dish to it's current position (linking a dish to itself causes thrashing). This dummy link is useful because the game.txt reference will set the team to -1, and that turns off the blinking team light on the dish. If a dish is a leaf node in the network, then it would not normally get mentioned in the link table, and therefore would retain it's team 1 ID from the map file. Actually, any unused id can be use for this purpose -- the game does not crash -- so -1 could be taken for the randomize function as long as unused IDs remain valid.

Instead of randomizing the direction, the function could do a simple 180 deg turn, or revert to the dish's baseline position. Then you wouldn't have to check for cases where the new position doesn't break the link, or links to a different dish. Which ever is simplest to code.

And now that I think about it, this link disruption effect can probably be done with some of the other online/offline and team ID functions? But being able to make specific links by script would still be new, and very handy!


2) I'm sure you know about the squaddie antigrav bug -- where squaddies can scale sheer vertical walls. It's certainly not a high priority, but I think it might have a trivial fix. I can't honestly think of a use for that behavior, but plugging that loophole can be a drag if lots of mode 2 land tiles are in use. I don't think the beahvior would ever be useful because it's such an abnormal thing for squads to do.

I think the problem likely stems from the representation of the sheer vertical slope. It's probably stored as the largest negative number, -1, or a NaN like value which can also be interpreted as a large negative. Thus it fails the inequality: if local_slope > max_slope then stop (asuming uphill slopes are positive).

So the solution could be as simple as adding a second comparisson to the slope conditional. If it's any more complicated than that, then it's not worth fixing. But maybe when you're in that area of the code you can add in a check for the vertical value.
User avatar
The GoldFish
level5
level5
Posts: 3961
Joined: Fri Mar 01, 2002 9:01 pm
Location: Bowl / South UK
Contact:

Postby The GoldFish » Fri Mar 16, 2007 5:15 pm

That's an interesting and very useful bug which I wasn't aware of, and I could benefit from using! Your description of it wasn't particularly concise, however :P

Anyway I've (at some stage) asked that any dish controlled by an allied team give the entry crosshairs, however being able to (in real time) relink especially unctrollable radar dishes would indeed be a very nice and useful tool. There should be no major issue iwth this, as they successfully link themselves up from the link values in game.txt on map entry - really though it's just that you can use team neutral radars but not control them - which is common sense rather than a glitch as such.

Basically, simply being able to change game.txt building entries with scripts'd be great - in *theory*, patching the memory should send the building spinning around to its new target - it's a case of do it and see what happens.
brice
level2
level2
Posts: 167
Joined: Fri Feb 23, 2007 6:04 am

Postby brice » Fri Mar 16, 2007 9:15 pm

The GoldFish wrote:That's an interesting and very useful bug which I wasn't aware of, and I could benefit from using! Your description of it wasn't particularly concise, however :P


...sorry. I figured anyone interested in it would either already know, or would know their way around the files better than I. Plus I already use too many words as it is...

The last two levels of Contagion are broken. Its missing a script trigger in the mountain pass level, so the cutscene and the mission swap don't occur. And therefore you can't get to the final level which is Plateau. Just force plateau and you can see what the deal is.

Its very slick, except several dish doorways are on rough ground so some of the pathways don't work out. Nice layout though, especially the way it takes advantage of a dish's ability to do n:1 links, so you can have converging and diverging radar pathways. The plateau network has several possible pathways to the end, if the dish placements were tweaked a little.

That level has all the control towers being heavily guarded so the network of dishes stays locked. But the CTs are not needed -- I've built working networks without them. I guess that means there would be no way for anyone to reprogram the team setting on the dishes, doesn't it? Hadn't thought of that before... :) So the CT-less network is probably pretty secure.

"The hack that Contagion used is to set team=1, global=1 in map.txt and team=-1 (or 255),online=0 in the game.txt link table." I can't remember if the important part is the mismatched team vaues in game.txt and map.txt, or the team 1 offline combo. Any dish that gets reassigned to team -1 in the link table will also have it's team blinker turned off.

Any dish that doesn't link to a destination will need to be dummy linked or it's red blinker will go bllink blink blink and look out of place. I think you can also get the locked dish effect with all the blinkers going. I think Contagion has it that way.

(oh, and 255 == -1 since team is an 8 bit field I think... at least both values worked for me)
User avatar
The GoldFish
level5
level5
Posts: 3961
Joined: Fri Mar 01, 2002 9:01 pm
Location: Bowl / South UK
Contact:

Postby The GoldFish » Sat Mar 17, 2007 2:19 am

Uh, the exact hack is just using team -1 radars which are linked together in advance in game.txt, as these not being team 2 prevent you from redirecting them, but, unlike radars on team 0 and 1 (or any other team), it gives you the entry waypoint when you order units into them. Because team 0 and 1 radars don't give you that waypoint, it's nigh impossible to make units go in them, making them useless besides flashy effects!

The team mismatch is irrelivent, game.txt overules it. The online or offline doesn't matter either, the lights will blink if they're anything other than team -1 (team -1 is supposed to be unowned) - the only important parts are the link value (which radar building the one you're talking to should connect to), and the team (which must be -1 in game.txt, and probably -1 in the map for consistancy). I'm going to go out on a limb and guess that the ones which are blinking in Contagion are ones that are not linked up themselves, hence were not entered into game.txt and later tweaked, as the modder probably didn't discover this fact until they were playing around later.

As I;ve said, I'd like to see the entry cursor work on any aligned dish, or possibly only if it's controlled by any allied team.

Anywho that's how it works *right now* - what you would like to have changed, uh, well, I don't even really follow. The only thing I've gleaned is that it'd be important to seperate patching global building link values and team values, since you might overwrite team information trying to change the link. You can just set the radar dish to team -1 in the editor, it's not a hard task - you don't need to go out of your way to set that up. It seems like your entire request for having a 'special value' for links hinges on the fact that you can't put them in game.txt to change them to team -1 (which you could already do anyway) without linking them to another radar or playing with it's online/offline status.

A command to order a radar dish to face a particular rotation would be nice, as would a command to force it to link to another radar automatically.

edit - also, re Contagion, I'll have a look about this broken script trigger you mentioned and see if I can't work out how to fix it.
brice
level2
level2
Posts: 167
Joined: Fri Feb 23, 2007 6:04 am

Postby brice » Sat Mar 17, 2007 3:27 pm

The GoldFish wrote:Anywho that's how it works *right now* - what you would like to have changed, uh, well, I don't even really follow. The only thing I've gleaned is that it'd be important to separate patching global building link values and team values, since you might overwrite team information trying to change the link. You can just set the radar dish to team -1 in the editor, it's not a hard task...


No, no, no, I'm not asking for that. I filled my post with too many tangents.

The only scripting thing I wanted was: allow scripts to point dishes to new targets in game. Here "in game" can mean two different things:

a) while a level is running be able to disrupt a radar link, possibly setting up a new link or just breaking the old one somehow.

b) between levels alter the building link table in game.txt so that when the player next returns to that level the dish network has changed. This is similar to swapping mission files before re-entering a level.

My main interest is in b) since it would allow you to use a dish network to control the plot. The network could take the place of the global world map as a way of recording progress and providing forking paths. You wouldn't need to make a separate mission file for every case. And altering the game.txt between levels is likely to be much easier to code than in-level actions.

But a) is also very interesting since the player's decisions could cause immediate dynamic consequences. One of the ideas I had for a dish network was to put all the research on a bunch of linked islands. The links are all one-way so the player has to make choices about what research combo they want. Paths can converge since dishes can recieve many links. Outbound choices from any island would be permanent. (The main problem here is not the network, but how to handle level resets.)

If either a) or b) were available then things would be more flexible. You wouldn't have to advertise all the possibilities with pre-existing teleport beams. The player would have to discover how to activate the pathways, so there could be more depth. Contagion uses the beam network to form a kind of maze in-air. It's very hard to trace the paths around the map.

Sorry about the density of my posts. I'll try to focus on a single thought per post, rather than adding in all the maybe relavnt details and stream of consciousnes and and...
User avatar
The GoldFish
level5
level5
Posts: 3961
Joined: Fri Mar 01, 2002 9:01 pm
Location: Bowl / South UK
Contact:

Postby The GoldFish » Fri Mar 23, 2007 4:15 am

You can actually already do b), if you really want to. It's a little complicated but it can be completely transparent and keep the same mission file. OK it's more than a little annoying for the modder to set up, but it IS possible!

Regardless of that it IS possible, I agree it'd be nice to be able to tweak link values (or maybe any value in the global buildings list) - this command if added might also easily serve the purpose of *making* radar links inlevel without any major recoding.

SP wise, if I wanted to disrupt a radar link, I'd blow up one of the radar dishes! Being able to do this repeatedly however, yeah, you'd need some sort of funky command, which I'm unsure as to how useful would really be, but only because no one's ever done anything like that.
-- The GoldFish - member of former GIT and commander in chief of GALLAHAD. You could have done something, but it's been fixed. The end. Also, play bestgameever!
brice
level2
level2
Posts: 167
Joined: Fri Feb 23, 2007 6:04 am

Postby brice » Fri Mar 23, 2007 6:50 am

The GoldFish wrote:You can actually already do b), if you really want to. It's a little complicated but it can be completely transparent and keep the same mission file. OK it's more than a little annoying for the modder to set up, but it IS possible!


Can you point me to the info please? I'd really like to know. And convoluted is my middle name... Thanks!

...does it have something to do with stuffing the link table with extra entries and then somehow retiring one line at a time? Is there some sort of "last entry wins" rule for parsing repeat entries?

-brice
User avatar
xander
level5
level5
Posts: 16858
Joined: Thu Oct 21, 2004 11:41 pm
Location: Riverside, CA, USA
Contact:

Postby xander » Fri Mar 23, 2007 4:43 pm

brice wrote:
The GoldFish wrote:You can actually already do b), if you really want to. It's a little complicated but it can be completely transparent and keep the same mission file. OK it's more than a little annoying for the modder to set up, but it IS possible!


Can you point me to the info please? I'd really like to know. And convoluted is my middle name... Thanks!

...does it have something to do with stuffing the link table with extra entries and then somehow retiring one line at a time? Is there some sort of "last entry wins" rule for parsing repeat entries?

-brice

One way you could do it is like this:

Let us say that you have one radar dish that you want to connect to one of three dishes on other islands. You want dish A to connect to dish 1 in situation X, 2 in situation Y, and 3 in situation Z. So, create a map with dishes 1, 2, and 3. For the sake of simplicity, let us assume that these are the only buildings in the map, and that they have IDs 1, 2, and 3, respectively. Then, you need to create three different mission files. In mission file A, you have a radar dish with ID 100 (for instance), which is linked in game.txt to the radar dish with ID 1. In mission file A', you have dish ID 101, linked to ID 2. In mission file A'', you have dish 102, linked to ID 3. Dishes 100, 101, and 102 are all in the exact same place, but, because they are in different mission files, they will never appear on the map together. Then, when condition X occurs, you use a SetMission command to assign mission A to the map. When condition Y occurs, you SetMission A' to the map. Same thing with Z and A''. That should do it.

xander
brice
level2
level2
Posts: 167
Joined: Fri Feb 23, 2007 6:04 am

Postby brice » Fri Mar 23, 2007 6:54 pm

Thanks Xander! I'll experiment with that. But TGF also said there is a way that retains the "same" mission file. That's why I was guessing the gnarly idea of hijacking some under-the-hood engine rule. TGF?
Last edited by brice on Fri Mar 23, 2007 7:25 pm, edited 1 time in total.
User avatar
xander
level5
level5
Posts: 16858
Joined: Thu Oct 21, 2004 11:41 pm
Location: Riverside, CA, USA
Contact:

Postby xander » Fri Mar 23, 2007 7:23 pm

brice wrote:Thanks Xander! I'll experiment with that. But TGF also said there is a way that retains the mission file. That's why I was guessing the gnarly idea of hijacking some under-the-hood engine rule. TGF?

Ah, I missed the part about retaining the mission file. I am not sure how you would go about doing that.

xander
User avatar
The GoldFish
level5
level5
Posts: 3961
Joined: Fri Mar 01, 2002 9:01 pm
Location: Bowl / South UK
Contact:

Postby The GoldFish » Fri Mar 23, 2007 7:32 pm

Basically the same thing, but with map exchanges. That isn't written up anywhere and I don't know if anyone's ever done them but me - have a gander at Droughtwinia I suppose. In particularl, look at Core, and its radar connecting cutscene.

Basically you have 2 otherwise identical map files with the same mission file, ideally with different building ID'ed radars (or whatever), and just enter a different location via script (check out mission_stupidbrokengame#.txt for an example of transparecny from entering a location from the world map) - in game.txt you just have them appropriately linked in advance, then just chop and change to the other map file when you want an event to occur.

You need to be weary of ownership of control towers, other global buildings and (particularly) incubators when you move over - unless you level is particularly modular, you can have problems, as you have to (basically) know in advance what teams certain buildings will be on - although I think you ought to be able to get away with it by making them dynamic, I'm not entirely sure as it's been a while since I did this.
User avatar
xander
level5
level5
Posts: 16858
Joined: Thu Oct 21, 2004 11:41 pm
Location: Riverside, CA, USA
Contact:

Postby xander » Fri Mar 23, 2007 8:35 pm

The GoldFish wrote:--==<snip>==--

Oi. Of course. That makes sense. By the way, I use a little map swapping in Insurrection. After you finish a level, you cannot swap in a new mission file with new objectives, and replay the level. There is no option to reset the level, and the new objectives will be shown as complete. Thus, the level Backdoor gets map switch (though the mission changes, too). At any rate, that would work.

However, even dynamic buildings may have some trouble with ownership. If it is stored in game.txt, it is possible that the game.txt entries will override the mission entries. I think you are better off leaving the buildings static, where possible, and making sure that you know which buildings will be owned by whom when you enter the level.

xander
User avatar
Testrie
level3
level3
Posts: 486
Joined: Thu Aug 17, 2006 8:02 pm
Location: CA, United States
Contact:

Postby Testrie » Fri Mar 23, 2007 9:18 pm

Erm... i didn't understand TGF's post. can someone please explain it to someone as stupid as me?

eyra
User avatar
xander
level5
level5
Posts: 16858
Joined: Thu Oct 21, 2004 11:41 pm
Location: Riverside, CA, USA
Contact:

Postby xander » Fri Mar 23, 2007 10:07 pm

Testrie wrote:Erm... i didn't understand TGF's post. can someone please explain it to someone as stupid as me?

eyra

If you didn't understand it, then it is probably a technique that is a bit beyond you. That being said:

You need to have two identical maps. Any buildings that you want to have change need to be on the different maps. When you want the change to occur, leave the first map, and enter the second map, but use the same mission file. One of the two maps needs to be hidden from the world map, so you will have to use scripts to move from one map to the other. Hack Droughtwinia. TGF uses this technique quite a bit there. Take the files apart, and learn what they do. I am sure you can figure it out.

xander
User avatar
Testrie
level3
level3
Posts: 486
Joined: Thu Aug 17, 2006 8:02 pm
Location: CA, United States
Contact:

Postby Testrie » Fri Mar 23, 2007 10:32 pm

xander wrote:-=snip=-


Oh. I get it now. So... what prevents the person from leaving the level and coming back and seeing the first level?

I'll hack droughtwinia later...

eyra

Return to “Mod Projects”

Who is online

Users browsing this forum: No registered users and 1 guest