Swapping the party; entirely, repeatably, completely.

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
boyflea
Posts: 50
Joined: Tue Aug 06, 2013 4:18 pm
Location: Hampshire, UK
Contact:

Swapping the party; entirely, repeatably, completely.

Post by boyflea »

Is it possible to swap characters totally: given a universal timer, I would like to replace the 'party A' with 'party B' entirely, and afterwards return to party A.


This seems to encompass several threads: is 'Ask a simple question, get a simple answer' the right place for this? seems I'm asking too many dumb questions in one go :).

...

Why? I hate Grimrock 2 - so I want to break it a bit. (I Lie: I just want to see if I can change the game-style)

things I am considering:
1/ how to transfer user from Party A to Party B, without causing game over (as Party A effectively needs to be destroyed)
2/ playing as Party B: shoudl be fine if transitioned correctly.
3/ not causing game over when destroying all members of a party B, but reverting to Party A
4/ applying time-limit for player when they are in Party B
5/ controlling savegame to certain points( think I know: edit 'on-move' and keep crystals in-game) - effectively though when being Party B cannot savegame
6/ Restoring Party A inventory upon return
7/ keeping Party B and Party A seperate (design)
8/ repeat this trick several times in the game
9/ Party B - adding visual cues to denote being in Party B would be cool, as would a visual tell to denote imminent timer elapse: any ideas?
10/ there would be music: is it possible to play complete isolated music tracks to denote Party B too?

I don't know: is this too engine-breaking?
I have been away for far too long and appreciate this is a big ask: I want to commit myself, but have failed a few times recently is all, so any guidance appreciated: I guarantee 75% of this stuff is in the forums somewhere... help! (please!) :)

I am very slowly easing back into this, but only to pursue this one idea. If it's impossible, worth knowing now, tbh :)
User avatar
AndakRainor
Posts: 674
Joined: Thu Nov 20, 2014 5:18 pm

Re: Swapping the party; entirely, repeatably, completely.

Post by AndakRainor »

All this is possible, with scripts. I did something similar with champions recruitment in taverns ! You will find some infos in this forum. You can start reading this : viewtopic.php?f=22&t=8464&hilit=recruit

Also, enabling and disabling all champions does not trigger game over, don't worry. But to do exactly what you want, you will have a few things to adapt in the code you can get from this thread !
Eburt
Posts: 69
Joined: Thu Feb 05, 2015 5:44 am

Re: Swapping the party; entirely, repeatably, completely.

Post by Eburt »

boyflea wrote:Is it possible to swap characters totally: given a universal timer, I would like to replace the 'party A' with 'party B' entirely, and afterwards return to party A.
Do you want the player to be able to make Party A, or will it be predefined (any choices they make on character creation are overwritten)? One difficulty with the former is that the portraits are not saved so there is no way to set them back unless you know what they are.

Another complexity is the inventory of the different parties. I assume you want to keep all the items, including properties like number of charges? If so, this gets a bit... messy... as you have to store the actual items in some unreachable spot.
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Swapping the party; entirely, repeatably, completely.

Post by minmay »

Eburt wrote:Do you want the player to be able to make Party A, or will it be predefined (any choices they make on character creation are overwritten)? One difficulty with the former is that the portraits are not saved so there is no way to set them back unless you know what they are.
This is not a problem thanks to the new onGetPortrait hook: there is no need to overwrite the existing portrait anymore, you can just draw the new one on the frames you want it.
boyflea wrote:5/ controlling savegame to certain points( think I know: edit 'on-move' and keep crystals in-game) - effectively though when being Party B cannot savegame
I can't imagine why you would consider this to be a good thing, and it's possible unless you count making the game crash upon saving or kill you on reloading, either of which is easy to do but also terrible. Obviously it's possible if you count "asking the player to use ironman mode" but the player can just...not use ironman mode.
boyflea wrote:6/ Restoring Party A inventory upon return
This is really not hard; you can just place a single ContainerItemComponent somewhere unreachable and move champions' inventories to that container and back.
boyflea wrote:10/ there would be music: is it possible to play complete isolated music tracks to denote Party B too?
You can switch out the current ambient track with GameMode.playStream(), but the old one won't fade out, you can't seek, it will always start from the beginning, and you have to account for anything that resets the ambient track (changing levels, reloading, boss battles, going underwater). You have better control over SoundComponents and can play stereo 2D sound with them by setting the soundType to "ambient", but there's still no seeking (though you can alter speed, but not increase it past 2x) and you're locked into using uncompressed WAVs which means enormous file size. So neither one is a very good option.

So 1, 2, 3, 4, 6, 7, 8, 9 are trivial, 5 is impossible, 10 is possible but not very good.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
boyflea
Posts: 50
Joined: Tue Aug 06, 2013 4:18 pm
Location: Hampshire, UK
Contact:

Re: Swapping the party; entirely, repeatably, completely.

Post by boyflea »

Ok, great. Well I'd had better get on with it then :)

thanks for the top-level advice:- ok, let's see what I can do!

regarding some points: I would not be looking to import characters, but if the mechanism works, would be cool to use in other dungeons (ie: puzzles where your imported team start in seperate locations and have to reform): otherwise an imported team would be TEAM C: and they would be the ones who trigger the quest for TEAM A and TEAM B.

Savegame: re-thinking this, maybe the crystals is the answer - I'll tinker...

Music: well will investigate.

but you know what: I'm still learning the basic editor for GR2, so some could say I'm being over-ambitious. :)


THANK YOU FOR YOUR RESPONSE! x
User avatar
Eleven Warrior
Posts: 752
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Swapping the party; entirely, repeatably, completely.

Post by Eleven Warrior »

To Minmay. Mate if your going to comment then at least give some coding to help people and I do mean something easy and with some description on how it works.

For god sake man we are not as cleaver as you so help out a bit better please.

Your like wtf use this and wtf use that etc...... Mate if you are so good and I know you are then help yeah :)
Post Reply