The Hazardous Realm
The Hazardous Realm

Campaign Coop

All topics related to the game 'Die by the Sword' and it's add-on 'Limb from Limb' go into this board!

Campaign Coop

Postby temp6666666 » 10 Nov 2012 20:47

Is it possible to get the campaign maps to work like the encounter coop?
temp6666666
Newbie
Newbie
 
Posts: 3
Joined: 10 Nov 2012 20:36

Re: Campaign Coop

Postby Hazard » 10 Nov 2012 21:53

In theory, yes. One problem is that the SCN files used to define enemies and their positions in singleplayer maps don't work in multiplayer. We'd have to create all actors with add_actor commands in the EVT script files instead. Doing this in the current map folders would probably break the singleplayer maps, though. You'd have to make a copy of the entire map with a different name to prevent any conflicts. Apart from that you'll probably only need to create a *_spec.lst file for the map to work.
There would still be a lot of issues with scripted events, though. All events happining in the levels are coded with ony one player in mind. Having two players will cause issues. Like a door closing and blocking one player from progressing and stuff like that. Fixing all those problems would probably take quite a lot of work.
I may try to add a teleport console command that only works in coop games, allowing a player to warp to the position of the other player when he's stuck somewhere. This would at least allow players to get around those issues.
Link
- < !!! Be Hazardous !!! > -
User avatar
Hazard
Hazardous Code Monkey
 
Posts: 185
Joined: 05 Jan 2006 19:49

Re: Campaign Coop

Postby Blinn » 10 Nov 2012 23:58

A temporary workaround for this is to bring up the command console in DBTS and:

1: Type in spawn (creature)\(creature variation)@(type 1-3).

NOTE: Replace (creature) with the name of the creature, such as the_hero or dworker. Replace (creature variation) with the name of the variation of the creature you want. For example the_hero\the_herom or dworker\dworkerb. Lastly, you can add what color or look the creature has by using 1-3, or just leaving it blank for the default look. So, in this case, type in the_hero\the_herom@1 and you'll get what I call "Red Enric" with a mace.

2: Select actor# - # being the number ID of the creature on the map. It may help to type in "show actors" so you can count how many creatures are on the map and which creature is which. Select actor also specifies where the creature will spawn, but be warned, if you (actor0) is selected, the creature you want to spawn will appear exactly where you are, so make sure you don't leave the console until you use the next step.

3: set team # - # being the team that the creature sides with. A creature on team 0 will be allies with you on Single Player mode. If you plan on spawning multiple creatures, make sure you select all of the spawned creatures and set team to 0. Then wreak havoc on the maps using your own self-spawned army. You can even summon creatures in the original campaign that don't appear until the Expansion game, or even custom-made creatures. ^_^

Hope this helps. :)
Blinn
Skeleton
Skeleton
 
Posts: 48
Joined: 10 May 2011 23:04

Re: Campaign Coop

Postby temp6666666 » 11 Nov 2012 16:57

I managed to get the first level of the campaign to work in arena and also in multiplay, but there are some problems...

But first things first; what I did (assume in order):

(I assume that the format used is self-explanatory)

Copy game_lv1.atd to test.atd

(test.atd){

Rename game_lv1.evt to test.evt

Rename game_lv1.ter to test.ter

(test.ter){

Append string "test" //Not sure if this makes sense. enc1.ter ends wth "game_lv1" though

}

Copy enc1.atd:enc1_spec.lst to test_spec.lst

Copy enc1.atd:enc1_thumb.bmp to test_thumb.bmp

Rename traps\game_lv1 to traps\test

}

(misc.atd){

Copy game_lv1 to test

}

(options.atd){

Copy game_lv1 to test

}

(overlays.atd){

Copy game_lv1 to test

}

(scenes.atd){

Copy level1.evt to test.evt

(test.evt){

Add code {

startup {

//Actors as in game_lv1.atd:game_lv1.scn

actor_add(1,"kobold\kobold",0,<3895,1380,5290>);
actor_add(2,"kobold\kobaxe",0,<3910,1380,5125>);
actor_add(3,"kobold\kobaxe3",0,<3427,1100,7200>);
actor_add(4,"kobold\kobaxe3",0,<3427,1100,7200>);
actor_add(5,"kobold\kobold",0,<4295,1160,7217>);
actor_add(6,"kobold\kobold",0,<740,650,5600>);
actor_add(7,"orc\orc",0,<2080,1140,8240>);
actor_add(8,"orc\orc",0,<-547,625,10389>);
actor_add(9,"kobold\kobold",0,<-717,521,9137>);
actor_add(10,"kobold\kobold",0,<-800,521,9200>);
actor_add(11,"kobold\kobold",0,<4137,1372,5530>);

}

}

Replace "game_lv1\" to "test\"

Replace "traps1.evt" to "trapstest.evt"

}

Copy traps1.evt to trapstest.evt

(trapstest.evt){

Replace "game_lv1\" to "test\"

}

}

Minor problems:

1) It cannot be played without xtended; it crashes without error.
2) After completing the map, game crashes with error "File read error in none.atd: none.act"
3) The placement of bots are not all correct.


Major problems:

1) There seems to be a problem with actor IDs.
The first actor is actually the bot/player joining the game, so after you enter the cave, you see for example, the bot orc pulling the lever (this is so funny to watch :P)
Also, in multiplay after the player pulls the lever. he becomes AI controlled!


Don't get me wrong, I started looking for how to mod this game yesterday so I don't know much of its inner workings.

Some actors do not have their position set explicitly by actor_set(), so I used the coordinates found along "WAIT_FACING" objectives.

I suspect that the problem with IDs can be fixed if all IDs are increased by 1 (and fixed as appropriate in the script) to "make room" for the coop player.
temp6666666
Newbie
Newbie
 
Posts: 3
Joined: 10 Nov 2012 20:36

Re: Campaign Coop

Postby Hazard » 11 Nov 2012 18:00

Wow, you managed to do a hell of a lot in the short time. Congrats! :)

The Actor IDs 1-3 are used for the other players in the arena. I'd suggest to change the IDs of enemies 1-3 to something else like 21-23 or whatever. Finding all points where their IDs are referenced may be a bit of work, but there isn't really any way around it.

I'm not sure about the "File read error in none.atd: none.act" error message. My guess is that the actors 2 and 4 are at fault here. none.atd is a dummy ATD file used for empty player slots in the arena. In a two player map slots 2 and 3 have none.atd assigned to them. This may lead to such errors when the actor IDs 2 and 3 are used in the scripts. It probably goes away when you free the actor IDs 1-3.

Xtended includes many changes that make modding of maps easier. Without it the map's files are scattered all over the place, making modding and installation of the map painful as hell. That's why all my mods are Xtended-only.
It is possible that one of those automations prevents the crash that happens when you try to start it without Xtended. I am not sure what exactly may cause the crash, though. It seems to me that you already found and copied all those files scattered in other ATDs.
Xtended, however, allows you to have all modded files contained solely in your map's folder. Here is how to do it (it definitely becomes Xtended-only, though):

- Copying subfolders in misc.atd, options.atd and overlay.atd shouldn't be requied with Xtended. It should work without them.
- The scenes.atd\test.evt file can be copied to your map folder and named "levelsetup.evt"
- Copy the scenes.atd\trapstest.evt to your map folder too. Maybe name it traps1.evt again.
- In your levelsetup.evt change "#include scenes\trapstest.evt" to "#include test\traps1.evt"

Your modded map should be all self-contained in one folder now. Xtended also allows to name many files in a way that is not based on the foldername. This allows you to easily copy and rename your map folder without renaming the files all the time. The following alternative file names are allowed:

- test_spec.lst -> levelinfo.lst
- test.ter -> levelobjects.ter
- test_thumb.bmp -> levelthumb.bmp
- test.evt -> levelevents.evt
- scenes.atd\test.evt -> levelsetup.evt (in test folder instead of scenes.atd)

These are all cosmetic, though (except the last one which also changes the folder). Using levelinfo.lst instead of the *_spec.lst has the additional benefit that Xtended-only maps only show up when Xtended is running.
Link
- < !!! Be Hazardous !!! > -
User avatar
Hazard
Hazardous Code Monkey
 
Posts: 185
Joined: 05 Jan 2006 19:49

Re: Campaign Coop

Postby temp6666666 » 12 Nov 2012 15:59

Since the last actor of the first map has id 11, I renamed 1 to 12, 2 to 13 and 3 to 14

Now it doesn't crash without xtended but...

There were 2 problem with this:

1) Game crashes when you enter the trap room
2) When the kobold pulls the lever, the game crashes with "Event parsing error: do_port_lever: invalid parameter"

And I have fixed them like this:

1) Duplicate folder ropes.atd:game_lv1
2) Replace "do_port_lever" with "nop" in test.evt. The animation where the kobold/player pulls the lever is not played, but who cares :P

As for the none.atd error, I copied and renamed the mutant files to none.atd. Also copied and renamed the move files of mutant (in moves folder). So when you enter level 2, you're a mutant, no error occurs and the game continues as normal, that is, the scene file is loaded and the map works as it should...

There is an old problem in multiplay that I just found (even before editing IDs). The player that triggers the trap, crashes with "Script parsing error: Invalid entity". Removing the trigger (replacing "set_trigger("ropetrap_trigger",spring_rope_trap)" with "nop") resolves the problem, well part of it :P

Still, the player crashses if he cuts the rope on the raft...
temp6666666
Newbie
Newbie
 
Posts: 3
Joined: 10 Nov 2012 20:36


Return to 'Die by the Sword' Fan and Modding Community



cron