Page 227 of 395

Re: Ask a simple question, get a simple answer

Posted: Fri Mar 30, 2018 11:09 am
by zimberzimber
Vanilla functions, done on the first screen after you select a dungeon toy play
Click "import party" and select a save file from another session.

Re: Ask a simple question, get a simple answer

Posted: Fri Mar 30, 2018 1:26 pm
by THOM
...with the exception that no imported party has any equipment...

Re: Ask a simple question, get a simple answer

Posted: Sun Apr 01, 2018 3:58 am
by Mysterious
Yes I know you can import a party that's not what I was looking for and as Thom said no equipment. I have played a Mod here or steam where the Author tells you to save a game with a certain name for the next part of his mod.

There has to be away surely?

Re: Ask a simple question, get a simple answer

Posted: Sun Apr 01, 2018 5:00 am
by minmay
I'm not aware of any mod that does that, but I went over how to do it here.
minmay wrote:No.

However, you can abuse the party import feature to store arbitrary information. E.g. use Champion:setName() to encode all champions' inventories, game statistics, and whatever else you want to transfer, then have the player import the party into the next mod. I tested with a 1 MB name and it saved and loaded just fine, so there is plenty of space available. So if you want players to be able to go back and forth between two or more dungeons and have arbitrary persistence, it can be done. Whether this would actually be a good design is debatable, however.

Re: Ask a simple question, get a simple answer

Posted: Mon Apr 02, 2018 2:59 am
by Mysterious
Ty for the information on Loading a game into a new mod ahh well :(

Ok I can do: GameMode.setGameFlag("DisableMovement",true) no problem but, is there a way to Disable the Mouse Pointer? I have read the Bloggs etc... and have not found anything unless I missed it.

Re: Ask a simple question, get a simple answer

Posted: Mon Apr 02, 2018 10:48 am
by THOM

Code: Select all

GameMode.getGameFlag(flag) 
(possible flags are PauseGame, HideGui, DisableMovement, DisableMouseLook, DisableMonsterAI and DisableKeyboardShortcuts)

Code: Select all

GameMode.setEnableControls(boolean)
If enable controls is false, then the player cannot move, use mouse look, pick up or throw items using the mouse, open or close champion windows, or use keyboard shortcuts in general. The player can freely interact with champion windows that are already open.

Have a look here.

Re: Ask a simple question, get a simple answer

Posted: Mon Apr 02, 2018 6:15 pm
by lostsol
Hello,

I am nearing completion of a mod and looking for some help on a few scripting questions.

Health / Energy Regeneration: What is the proper way to prevent regeneration completely? I have tried several methods, I can't look at my script right now but the closest I have come is by using a trait with a recomputeStat hook that modifies regeneration rate by -100. While this greatly slows regeneration, it does not stop it like it would with certain injury conditions.

Also on conditions: Does anyone have the definitions for the conditions? I know how to make new ones but I would like to see the existing ones and just slightly adjust them.

Reload Firearm Secondary Action: I would like for this action to use ammo from the inventory instead of the hand. I could probably figure out a way eventually, but I thought I'd throw it out there in case someone knew a simple way to do this or already has a script for it and is willing to share.

Thanks !

Re: Ask a simple question, get a simple answer

Posted: Wed Apr 04, 2018 9:09 am
by akroma222
lostsol wrote: Health / Energy Regeneration: What is the proper way to prevent regeneration completely? I have tried several methods, I can't look at my script right now but the closest I have come is by using a trait with a recomputeStat hook that modifies regeneration rate by -100. While this greatly slows regeneration, it does not stop it like it would with certain injury conditions.
Can you post the code you are using in your trait's onRecomputeStatistics hook?
If your regen rates do not completely stop it is likely you are not using the champ's actual regeneration rates...
For an example of what I mean - this hidden trait removes all the attribute based element resistance bonuses a champion recieves -after- party creation
SpoilerShow

Code: Select all

defineTrait{
	name = "correct_resistance",
	uiName = "Correct Resistance",
	iconAtlas = "mod_assets/textures/gui/blank_borders/blank64x80.tga",
	icon = 0,
	hidden = true,
	description = "",
	onRecomputeStats = function(champion, level)
		if level > 0 then
			local statResTab = {strength = "fire", dexterity = "shock", vitality = "poison", willpower = "cold"}
			for k,v in pairs(statResTab) do
				local currStat = champion:getCurrentStat(k)
				local diff = currStat - 10
				if diff >= 1 then	
					champion:addStatModifier("resist_"..v, - (diff * 2))
				end
			end
		end
	end,
}
lostsol wrote: Also on conditions: Does anyone have the definitions for the conditions? I know how to make new ones but I would like to see the existing ones and just slightly adjust them.
Not exactly at the moment - I am currently re-implementing the original conditions (AND their menu / attack panel Gui effects :roll: ) and am happy to repost these defs once finished
lostsol wrote: Reload Firearm Secondary Action: I would like for this action to use ammo from the inventory instead of the hand. I could probably figure out a way eventually, but I thought I'd throw it out there in case someone knew a simple way to do this or already has a script for it and is willing to share.
You will likely need to re-implement the effects of the RelaodFirearmComponent .... Ive got nothing to help here unfort :|

Re: Ask a simple question, get a simple answer

Posted: Wed Apr 04, 2018 10:29 am
by Isaac
lostsol wrote:Hello,
Also on conditions: Does anyone have the definitions for the conditions? I know how to make new ones but I would like to see the existing ones and just slightly adjust them.
https://github.com/JKos/log2doc/wiki/As ... ditiondesc

Re: Ask a simple question, get a simple answer

Posted: Thu Apr 05, 2018 1:25 am
by lostsol
akroma222 wrote:
lostsol wrote: Health / Energy Regeneration: What is the proper way to prevent regeneration completely? I have tried several methods, I can't look at my script right now but the closest I have come is by using a trait with a recomputeStat hook that modifies regeneration rate by -100. While this greatly slows regeneration, it does not stop it like it would with certain injury conditions.
Can you post the code you are using in your trait's onRecomputeStatistics hook?
If your regen rates do not completely stop it is likely you are not using the champ's actual regeneration rates...
For an example of what I mean - this hidden trait removes all the attribute based element resistance bonuses a champion recieves -after- party creation
SpoilerShow

Code: Select all

defineTrait{
	name = "correct_resistance",
	uiName = "Correct Resistance",
	iconAtlas = "mod_assets/textures/gui/blank_borders/blank64x80.tga",
	icon = 0,
	hidden = true,
	description = "",
	onRecomputeStats = function(champion, level)
		if level > 0 then
			local statResTab = {strength = "fire", dexterity = "shock", vitality = "poison", willpower = "cold"}
			for k,v in pairs(statResTab) do
				local currStat = champion:getCurrentStat(k)
				local diff = currStat - 10
				if diff >= 1 then	
					champion:addStatModifier("resist_"..v, - (diff * 2))
				end
			end
		end
	end,
}
Hi Akroma, thank you for your reply.

Here is what I'm working with:
SpoilerShow

Code: Select all

defineTrait{
     name = "no_regen",
     uiName = "",
     icon = 0,
     description = "",
     hidden = true,
     onRecomputeStats = function(champion, level)
          if level > 0 then
               champion:addStatModifier("energy_regeneration_rate", -100)
               champion:addStatModifier("health_regeneration_rate", -100)
         end
     end,
}
Also, I did not mention this in my original post. Focusing on Energy, with a Willpower attribute score of 10, this function works perfectly. Below 10 and the champion actually slowly loses energy. Beyond 10 and regeneration starts happening again, although at a very slow rate, like 1 point every 1-2 minutes. I really, really hope I'm doing something boneheaded here..