Page 159 of 396

Re: Ask a simple question, get a simple answer

Posted: Fri Oct 14, 2016 7:35 pm
by AndakRainor
zimberzimber wrote:I don't have the time to experiment with it right now, but can it fade in/out?
I don't think so, I never found a way to do it myself...

Re: Ask a simple question, get a simple answer

Posted: Fri Oct 14, 2016 7:38 pm
by akroma222
AndakRainor wrote:You can see the onTick is used to read values and store them until the next frame. The previous value is substracted to get only the value without the previous contribution of might. When it's time for the next frame, all stat modifiers are cleared and all recomputes are redone, and during that process, at any time, might gives the value stored from the previous frame. So you could say, might is always one frame late when a stat changes. It is still better than my previous 1 second refresh interval and when trying to give bonuses to champions that also depend on other present bonuses, I think it is logically the best thing you can do. Again because, unless I'm proven wrong, when all recomputes are done, it is too late to add another modifier.
Cheers!! I do like your way of managing this issue ;)

Re: Ask a simple question, get a simple answer

Posted: Fri Oct 14, 2016 7:43 pm
by minmay
stat recompute order:
1. items in inventory from 1 to BackpackFirst-1 in order
2. conditions in undefined order (pairs)
3. skills in undefined order (pairs)
4. traits in undefined order (pairs)
applied after all onRecomputeStats are called:
- protection is rounded to the nearest integer
- leadership and nightstalker
- light and heavy armor penalties
- strength, dexterity, vitality, willpower bonuses to max load, evasion, health and health regen, energy and energy regen, resistances
- after strength/dexterity/vitality/willpower are applied, resistances are clamped between 0 and 100, health is clamped at max_health, energy is clamped at max_energy
- when resting, evasion is decreased by 100

Re: Ask a simple question, get a simple answer

Posted: Fri Oct 14, 2016 7:46 pm
by zimberzimber
What does Nightstalker do?

Re: Ask a simple question, get a simple answer

Posted: Fri Oct 14, 2016 7:52 pm
by minmay
increases vitality by 5 when time of day >= 1, and decreases vitality by 5 otherwise

Re: Ask a simple question, get a simple answer

Posted: Sat Oct 15, 2016 12:01 am
by zimberzimber
Is there a way to get the games resolution settings? (What resolution the user is using)
I have a GUI ready, and while it looks nice with my resolution, I doubt it will on any other.

Re: Ask a simple question, get a simple answer

Posted: Sat Oct 15, 2016 12:36 am
by minmay
Are GraphicsContext.width and GraphicsContext.height not enough?

Re: Ask a simple question, get a simple answer

Posted: Sat Oct 15, 2016 4:03 am
by zimberzimber
minmay wrote:Are GraphicsContext.width and GraphicsContext.height not enough?
Couldn't find a way to get that value and use it where I need it.
I'm using grimtk, and I'm trying to modify the pre-defined templates to take up % of the screen instead of a set value. These two:

Code: Select all

dialogueTopForm = {
	name = dialogueTopFormName,
	type = "GWindow",
	size = {836*0.75, 386},
	bgImage = "gtk-dialogue-top",
	bgDrawMode = GTK.Constants.ImageDrawMode.Stretched,
	gravity = GTK.Constants.Gravity.NorthWest,
	offset = {0, 10},
	layout = {
		type = "GBoxLayout",
		direction = GTK.Constants.Direction.Horizontal,
		gravity = GTK.Constants.Gravity.NorthWest,			
		spacing = {10, 8},
		margin = {30, 40, 30, 30}
	},	
	children = 
	{
		{
			name = "mainImageView", 
			type = "GImageView",
			image = "gtk-dialogue-top",
			drawMode = GTK.Constants.ImageDrawMode.ShrinkToBox,
			imageGravity = GTK.Constants.Gravity.NorthWest,
			size = {380, 340},
			minSize = {380, 340},
			maxSize = {770, 900},			
		},
		{
			name = "mainMessageLabel", 
			type = "GLabel",
			text = "",
			size = {380, 340},
			minSize = {380, 340},
			maxSize = {770, 900},
			font = GTK.Constants.Fonts.Medium,
		}
	}
}

dialogueBottomForm = {
	name = dialogueBottomFormName,
	type = "GWindow",
	bgImage = "gtk-dialogue-bottom",
	size = {836*0.75, 302},
	gravity = GTK.Constants.Gravity.SouthWest,
	offset = {0, -10},
	lockKeyboard = true,
	freezeAI = true,
	layout = {
		type = "GBoxLayout",
		direction = GTK.Constants.Direction.Vertical,	
		spacing = {8, 12},
		margin = {24, 24, 24, 24}
	},		
	children = 
	{	
		{
			name = "speakerContainer",
			type = "GWidget",
			position = {0, 0},
			size = {770*0.75, 92},
			bgImage = "gtk-dialogue-bottom-speaker-box",
			minSize = {770*0.75, 92},
			maxSize = {770*0.75, 92},
			layout = {
				type = "GBoxLayout",
				direction = GTK.Constants.Direction.Vertical,	
				spacing = {2, 2},
				margin = {2, 10, 2, 10}
			},				
			children = 
			{
				{
					name = "speakerLabel", 
					type = "GLabel",
					text = "[Speaker]",
					position = {5, 4},
					size = {750*0.75, 30},
					minSize = {750*0.75, 30},
					maxSize = {750*0.75, 30},
					font = GTK.Constants.Fonts.Large,
					textColor = {255, 192, 64, 255}
				},
				{
					name = "messageLabel", 
					type = "GLabel",
					text = "[Message]",
					position = {5, 38},
					size = {750*0.75, 48},
					minSize = {750*0.75, 48},
					maxSize = {750*0.75, 86},
					font = GTK.Constants.Fonts.Medium,
					textColor = {255, 192, 64, 255}
				},	
			}
		},
		{
			name = "responseContainer", 
			type = "GWidget",
			position = {34, 124},
			size = {780*0.75, 140},
			minSize = {780*0.75, 100},
			maxSize = {780*0.75, 100},
			layout = {
				type = "GBoxLayout",
				direction = GTK.Constants.Direction.Vertical,
				gravity = GTK.Constants.Gravity.SouthWest,			
				hideOverflow = true,
				spacing = {4, 4},
				margin = {4, 4, 4, 4}
			},
			children = 
			{ 
		
			}
		},				
	}
}

Re: Ask a simple question, get a simple answer

Posted: Sat Oct 15, 2016 7:38 am
by akroma222
minmay wrote:stat recompute order:
Much appreciated minmay, thankyou 8-)

Re: Ask a simple question, get a simple answer

Posted: Sat Oct 15, 2016 5:21 pm
by AndakRainor
minmay wrote:stat recompute order:
1. items in inventory from 1 to BackpackFirst-1 in order
2. conditions in undefined order (pairs)
3. skills in undefined order (pairs)
4. traits in undefined order (pairs)
applied after all onRecomputeStats are called:
- protection is rounded to the nearest integer
- leadership and nightstalker
- light and heavy armor penalties
- strength, dexterity, vitality, willpower bonuses to max load, evasion, health and health regen, energy and energy regen, resistances
- after strength/dexterity/vitality/willpower are applied, resistances are clamped between 0 and 100, health is clamped at max_health, energy is clamped at max_energy
- when resting, evasion is decreased by 100
Do you know where traits onComputeCooldown, onComputeCritChance and onComputeAccuracy functions should appear in this ordered list?