Ask a simple question, get a simple answer

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!
User avatar
THOM
Posts: 1267
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

Pompidom wrote: Wed Oct 24, 2018 4:43 pm Which asset pack contains the log1 herbs?
The LoG1 pack. Not the LoG2 one.
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
User avatar
Isaac
Posts: 3179
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

THOM wrote: Wed Oct 24, 2018 4:45 pm Maybe they don't appear in the Object list of the Editor because they don't have an Editor Icon defined.
At least all objects without one do not appear.
That sounds sensible, but in this case I defined a cloned dagger object, and called it base_dagger. I could spawn it, but I could not find or place it within the editor.
User avatar
KhrougH
Posts: 68
Joined: Tue Sep 04, 2018 11:45 pm
Location: Roma

Re: Ask a simple question, get a simple answer

Post by KhrougH »

KhrougH wrote: Wed Oct 24, 2018 2:33 pm can i use "baseObjet" to identify an object or an item?

example:
for var in party.map:entitiesAt(party.x, party.y) do
if string.match(var.baseObject, "decoration") then

this return nil, so it doesn't work. but maybe there is another way.
ok, explanation needed:
when i check for (example) an item on the tile map-paty.x-party.y i can find several object, items walls and... whatever... so if i look for my item with part of the name --string.match(var.baseObject, "decoration") -- i could find more than 1 things but only one it the one i need.

so in my specific case i'm looking for wall but objet.wall doesn't exist. so i can recognize them?
we have objet.door , objet.lock , what else!?... but if i use object.wall LoG2 says "no way, stupid!"

i show you another thread with the script i'm talking about:

viewtopic.php?f=22&t=18314&p=118389#p118389

of corse... I wrote the script which is part of a defineObject so it could be totally wrong :lol: :lol: :lol:
but for the moment it works. i'm just almost sure that there is another way to do it, probably even more elegant ad developer like toarrange scripts :D
[...]
All those moments will be lost in time, like tears in rain.
Time to die.
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: Ask a simple question, get a simple answer

Post by bongobeat »

Hi there,
Can someone explain how the magic resistances work please? I mean how is calculated the total magic resistances, with additionnal gears.
I want to remove temporally 60 % of all resistances.

I'm trying to make a condition based on Zimberzimber's decay condition.
(His condition changes the principal stats : STR, DEX, VIT, WILL)

This is the onRecomuteStats of the condition, except I have changed it with resist_shock, etc... but that don't work at all.

Code: Select all

	onRecomputeStats = function(self, champion)
		local sho = champion:getCurrentStat("resist_shock")
		champion:addStatModifier("resist_shock", sho * -0.6)
	local fir = champion:getCurrentStat("resist_fire")
		champion:addStatModifier("resist_fire", fir * -0.6)
	local col = champion:getCurrentStat("resist_cold")
		champion:addStatModifier("resist_cold", col * -0.6)
	local poi = champion:getCurrentStat("resist_poison")
		champion:addStatModifier("resist_poison", poi * -0.6)
I've tryed a basic formula like

Code: Select all

champion:addStatModifier("resist_shock", sho -300)
but this is not what I want, it remove completely the shock resistance, based on what gears do you wear.
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
User avatar
KhrougH
Posts: 68
Joined: Tue Sep 04, 2018 11:45 pm
Location: Roma

Re: Ask a simple question, get a simple answer

Post by KhrougH »

Drakkan wrote: Wed Oct 29, 2014 7:50 pm
SpoilerShow
I do not think messing up all together is good idea, but making few guide-posts could help some poeple. On the other side as I know it, if someone new come to the forum, in majority cases he/she does not read existing threads, but rather start new one, doesnt caring that similar topic already exists here many times. That´s reality and I do not think you can change it :) But I will keep fingers if you want making some "gathering information" thread
Well... I am one of those pretty new in this forum. Before signing in it i read for long threads looking for some help in modding and scripting.
But even now i need some help even if the answer I'm looking for has been already gave to someone else in the past.
I think the problem is the search engine... Or i don't know what... But i can't find the answer i need.
OR... it may depends by the fact that new modder/scripter just don't know what to search in the forum.
In fact NOW i can find answers to queations i had weeks ago. Now that i know what to search, now that i know the words i need.
I remember i spent a week before finding that findEntity was the solution for my problem.
What is saving my ass now is the superthread... Folowing link by link i'm reaching interesting argument.

So ... In my opinion the answer could be making more post as the Superthreads with answers to the more common questions and links about where to find explanation of contents
http://www.grimrock.net/modding/scripting-reference/
Because is not enough making a list, someone should explain what these "words" does when you use.

Well ... This is an opinion of a newer user.
So if you think something is wrong in this post... Is because (again) i'm new and i can't find the answers i need.
[...]
All those moments will be lost in time, like tears in rain.
Time to die.
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: Ask a simple question, get a simple answer

Post by akroma222 »

bongobeat wrote: Sun Oct 28, 2018 8:14 pm Hi there,
Can someone explain how the magic resistances work please? I mean how is calculated the total magic resistances, with additionnal gears.
I want to remove temporally 60 % of all resistances.
Hey Bongo,

.....as KhrougH suspected - Ive asked about this before in the 'Multiple Magic School Spells" thread
viewtopic.php?f=22&t=9579&p=109434&hili ... ce#p109434

AndakRainor offers a method by which to accurately get resistance values here^^

Now the issue, in fetching accurate values for some of our champ stats is - pending on what and where you are doing these calculations (eg - trait hook) ....... the accuracy of the fetched stat values can vary - this is because there is an "priority order" to which the vanilla game calculates statistic values.
Minmay has given us this order (I believe this to be up to date) :
SpoilerShow

Code: Select all

-----------------------------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:

--5 protection is rounded to the nearest integer
--6 leadership and nightstalker
--7 light and heavy armor penalties
--8 strength, dexterity, vitality, willpower bonuses to max load, evasion, health and health regen, energy and energy regen, resistances
--9 (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
--10 when resting, evasion is decreased by 100
This shows that we encounter problems if trying to to fetch an actual value for a statistic whilst the game is in the middle of recalculating that statistic. This is actually something I need to revisit and check and double check myself. However, I will post my resistance modifying trait so you can get an idea of how to code that up:
SpoilerShow

Code: Select all

{
		name = "correct_resistance",
		uiName = "Core Hidden Trait", 
		iconAtlas = "mod_assets/textures/gui/blank_borders/blank64x80.tga",
		icon = 0, 
		charGen = false,
		hidden = true,
		group = "core",
		description = "...no descript needed for hidden traits...",
		--------------------------------------
		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,
	},
Now while this works for my purposes (the only stat bonus given to resists are done and capped at champ creation - no more resist bonuses from increasing stats after the game begins) .... Im unsure on how this cleanly stands up to the aforementioned problem w the stat calc process....

EDIT: In fact I remember someone specifically telling me NOT to get Stat values in the onRecomputeStat hook - as I have done in the above definition (local currStat = champion:getCurrentStat(k))

I remember less so a solution to that being.....(sorry this was a while back) .... Call up a custom get Stat Function that will refer to either a global statistic variable .........OR a Config Table .......OR something else that will hold the statistic value constant until your code manually updates it. Then you can get / fetch a stable value of your statistic.

Plz anyone, tell me if Ive got this wrong -
I think this issue is important ....and a clear reliable method to read stat values would is needed + would benefit all modders

Hope this helps 8-)
User avatar
KhrougH
Posts: 68
Joined: Tue Sep 04, 2018 11:45 pm
Location: Roma

Re: Ask a simple question, get a simple answer

Post by KhrougH »

oook , i give up.
after checking in this forum and on google and on blender tutorials and after some tests...
i still can't modify an existing object adding this famous "gate node" that is missing when you define an object as a door.
i found many thread about this argument but all of them say "add a node called GATE in the model" but i couldn't find someone who says HOW TO DO IT...
I know what a node is... i don't know where to place it and how to set neither.
may someone help?

EDIT:
maybe i even misundersood what a "node" is.
isn't it that module for combining colors in the "node edit" window in bender?
[...]
All those moments will be lost in time, like tears in rain.
Time to die.
User avatar
Isaac
Posts: 3179
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

KhrougH wrote: Tue Oct 30, 2018 12:40 am maybe i even misundersood what a "node" is.
isn't it that module for combining colors in the "node edit" window in bender?
Mixed terms between two different softwares.
__

For it to function like a door, the gate node in a door must (or at least should) contain the mesh data of whatever part of the model that is considered the door itself (as opposed to the door-frame, and other decorations); two of these nodes for double doors. This is because the door component automatically handles the door animations—by moving whatever node is named "gate".

In Blender (or the GMT), you can rename the object (or parent object) 'gate'.
SpoilerShow
Image
User avatar
KhrougH
Posts: 68
Joined: Tue Sep 04, 2018 11:45 pm
Location: Roma

Re: Ask a simple question, get a simple answer

Post by KhrougH »

Isaac wrote: Tue Oct 30, 2018 7:21 am
SpoilerShow
Image
i can't use Grimrock Model Toolkit. i have a macbook. so i go straight to the mod_asset folder
[...]
All those moments will be lost in time, like tears in rain.
Time to die.
User avatar
Isaac
Posts: 3179
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

KhrougH wrote: Tue Oct 30, 2018 7:39 am i can't use Grimrock Model Toolkit. i have a macbook. so i go straight to the mod_asset folder
Blender then. It's the same general task.
Post Reply