How do I create a game with only one champion?
- WaspUK1966
- Posts: 135
- Joined: Sat Aug 09, 2014 9:17 am
How do I create a game with only one champion?
I`m thinking of doing a game (sort of a survival type thing). But I only want one playable character in the game, who has some predefined skills, level etc, not a whole party of 4. How can I do this, so that when the game is loaded the player only has the one character available on the character-select screen, but can choose between male or female? Do I need to put something in the scripts/init file so that it overrides Grimrock`s default character screen? Any help greatly appreciated.
Cheers
George
Cheers
George
- Dr.Disaster
- Posts: 2876
- Joined: Wed Aug 15, 2012 11:48 am
Re: How do I create a game with only one champion?
If you want to play a mod with less then 4 characters you got two options:
1) use a mod like "The Characterizer" to enable/disable single characters
2) use the console to enable/disable single characters with the Champion:setEnabled() command
If you want to play the main campaign with less then 4 characters you have to resort to the console.
EDIT
Oh you ment as a mod preset! I understood you wanted to play a game with less then a full party.
Nevermind then, Sutekh gave the right answer.
1) use a mod like "The Characterizer" to enable/disable single characters
2) use the console to enable/disable single characters with the Champion:setEnabled() command
If you want to play the main campaign with less then 4 characters you have to resort to the console.
EDIT
Oh you ment as a mod preset! I understood you wanted to play a game with less then a full party.
Nevermind then, Sutekh gave the right answer.
Last edited by Dr.Disaster on Tue Nov 18, 2014 5:20 pm, edited 1 time in total.
Re: How do I create a game with only one champion?
Place a script in your mod and enter the following:
Hope this helps.
Code: Select all
for i = 2,4 do
party:getChampion(i):setEnabled(false)
end
- WaspUK1966
- Posts: 135
- Joined: Sat Aug 09, 2014 9:17 am
Re: How do I create a game with only one champion?
Thanks for that. Just one problem:
If I put the script in the mod, then yes, once the game screen shows you only have one character to use. However, the shadow of the other character icons that would normally be there still show on the screen (looks rather unprofessional). Any way of getting rid of these?
Also, when you load the game for the first time, and come to the character select screen , If you stick with the default characters and just click continue, then everything is fine (apart from the bug I mentioned above). However, if you select custom characters, then the game lets you choose all 4 characters, giving them all their traits etc. It`s only when you actually enter the game you are left with just the first character (as planned). Again, not very professional. Anyway of either :
1) overriding this, so that on the character select screen you can only alter the attributes of a single character (not the other 3)?
2) Bypassing the character-select screen entirely when playing the game for the first time (ie having a predefined character already set up in a script with its own name, skills, etc) so that the player has to use this custom character in game?
Can`t figure it out.
Help always appreciated
George
If I put the script in the mod, then yes, once the game screen shows you only have one character to use. However, the shadow of the other character icons that would normally be there still show on the screen (looks rather unprofessional). Any way of getting rid of these?
Also, when you load the game for the first time, and come to the character select screen , If you stick with the default characters and just click continue, then everything is fine (apart from the bug I mentioned above). However, if you select custom characters, then the game lets you choose all 4 characters, giving them all their traits etc. It`s only when you actually enter the game you are left with just the first character (as planned). Again, not very professional. Anyway of either :
1) overriding this, so that on the character select screen you can only alter the attributes of a single character (not the other 3)?
2) Bypassing the character-select screen entirely when playing the game for the first time (ie having a predefined character already set up in a script with its own name, skills, etc) so that the player has to use this custom character in game?
Can`t figure it out.
Help always appreciated
George
Re: How do I create a game with only one champion?
No.WaspUK1966 wrote:If I put the script in the mod, then yes, once the game screen shows you only have one character to use. However, the shadow of the other character icons that would normally be there still show on the screen (looks rather unprofessional). Any way of getting rid of these?
1) No.WaspUK1966 wrote:Anyway of either :
1) overriding this, so that on the character select screen you can only alter the attributes of a single character (not the other 3)?
2) Bypassing the character-select screen entirely when playing the game for the first time (ie having a predefined character already set up in a script with its own name, skills, etc) so that the player has to use this custom character in game?
2) No.
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.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
- WaspUK1966
- Posts: 135
- Joined: Sat Aug 09, 2014 9:17 am
Re: How do I create a game with only one champion?
Thanks for the prompt reply. Pity. I assume, then, that the character select screen is hard-coded, and unable to change? I`ll try and think of a way round it. Maybe I can have the game exported with a save game included (if poss) for the start of the level, so that the player doesn't use the character-screen at all when first playing, and just clicks "load" or something...I`ll think on that. Once again, thanks for being so helpful
George
George
- Dr.Disaster
- Posts: 2876
- Joined: Wed Aug 15, 2012 11:48 am
Re: How do I create a game with only one champion?
There is no need to. Just give the player a heads up in the description that your mod uses a pre-defined character and it's pointless to create characters. Then on mod start run your character script early to overrides anything a player might have entered for his party. Several mods already do this like Skugg's "The Elder of Murwynd Woods".WaspUK1966 wrote:Thanks for the prompt reply. Pity. I assume, then, that the character select screen is hard-coded, and unable to change? I`ll try and think of a way round it.
- WaspUK1966
- Posts: 135
- Joined: Sat Aug 09, 2014 9:17 am
Re: How do I create a game with only one champion?
yeh, I was thinking about doing that. Basically, I`m trying to do a sequel to my game "Ogre". Ive set my script up so only one character is enabled upon start. I've even changed his name by using the setName function. But I've tried to give him other starting abilities, such as Level, Armor, Class etc using other functions such as setClass and so on, but keep getting error messages. Nothing works. Any advice on how I can code this?
George
George
- Dr.Disaster
- Posts: 2876
- Joined: Wed Aug 15, 2012 11:48 am
Re: How do I create a game with only one champion?
The LoG1 modding reference is pretty precide in that part. Got some code to show what fails to work?
- WaspUK1966
- Posts: 135
- Joined: Sat Aug 09, 2014 9:17 am
Re: How do I create a game with only one champion?
Thanks again. Basically, code goes something like this:
party:getChampion(1):setName("Prince Urdril")
party:getChampion(1):setSex("male")
party:getChampion(1):setClass("Fighter")
party:getChampion(1):setPortrait("assets/textures/portraits/human_male_02.tga")
for i = 2,4 do
party:getChampion(i):setEnabled(false)
end
This gives my working character a name, class, sex, portrait, and disables the other characters. But I also want him to start with modified stats/skills, such as Level, Armor etc. without the "Level UP" or other messages appearing on screen when the game first starts, e.g. "X has gained +5 health" (which is what I get when I use commands such as trainSkill to modify the abilities). Any ideas?
Thanks
George
party:getChampion(1):setName("Prince Urdril")
party:getChampion(1):setSex("male")
party:getChampion(1):setClass("Fighter")
party:getChampion(1):setPortrait("assets/textures/portraits/human_male_02.tga")
for i = 2,4 do
party:getChampion(i):setEnabled(false)
end
This gives my working character a name, class, sex, portrait, and disables the other characters. But I also want him to start with modified stats/skills, such as Level, Armor etc. without the "Level UP" or other messages appearing on screen when the game first starts, e.g. "X has gained +5 health" (which is what I get when I use commands such as trainSkill to modify the abilities). Any ideas?
Thanks
George