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
Isaac
Posts: 3133
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac » Sun May 29, 2022 9:08 am

8-) Nice, and thank you for the fixed link.

This is a beautiful map resource that I'd not seen before.

___________________

I did a simple model swap for the fixed files, and restarted the editor, but the problem is still present (for me) that the projectiles fly through the gate and the secret wall.

*Is there more to it than just the swap to get it to work? The models are obviously cleaned up/fixed... but I still can toss projectiles through them. :?:

**I mentioned above that when I swapped the gate model for a vanilla iron door model, the projectiles still passed through the gate object.
Last edited by Isaac on Sun May 29, 2022 9:32 am, edited 3 times in total.

User avatar
Adrageron
Posts: 202
Joined: Thu Nov 08, 2012 1:22 pm

Re: Ask a simple question, get a simple answer

Post by Adrageron » Sun May 29, 2022 9:18 am

@Isaac Thank you! You was right, Minmay already knows. :D

@minmay Thanks a lot! "shuffling around the nodes" sounds to me like "just cast a fireball spell" - easy anough if you are a wizard, but impossible for mere mortal like myself :mrgreen:

User avatar
Isaac
Posts: 3133
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac » Sun May 29, 2022 9:50 am

I see that the secret door cannot be used on a double height wall, as done in the demo map. It clips with the wall above it.

User avatar
Adrageron
Posts: 202
Joined: Thu Nov 08, 2012 1:22 pm

Re: Ask a simple question, get a simple answer

Post by Adrageron » Sun May 29, 2022 9:58 am

Isaac wrote:
Sun May 29, 2022 9:08 am
I did a simple model swap for the fixed files, and restarted the editor, but the problem is still present (for me) that the projectiles fly through the gate and the secret wall.
For me fixed models works just fine.

User avatar
Isaac
Posts: 3133
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac » Sun May 29, 2022 10:37 am

That's interesting, and good enough; glad to hear it...but it's odd.

In-editor, using the fixed file, and even when I swap the model out for the vanilla dungeon_secret_door.fbx it does not fix the issue for me. :(

Image

User avatar
THOM
Posts: 1251
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM » Thu Jun 16, 2022 10:06 pm

Well. I want to remove items from the party's inventory with certain traits. I also want to remove that items from containers the party may carry.
I have the following function which works for single items but doesn't work for items in containers - it simply doesn't remove anything there. And I do not understand, why.

Has anyone an idea, what's wrong with it?

Code: Select all

function removeWeappons()
      	local weaptrait = {"light_weapon", "sword", "daggers", "weapon", "heavy_weapon", "mace", "axe", "two_handed", "firearm", "spear", "missile_weapon", "throwing_weapon", "wand" }  
	
      	for i=1,4 do
        	local ch = party.party:getChampion(i)
        	for slot=1,ItemSlot.MaxSlots do
          		local item = ch:getItem(slot)
          		if item then
            		for _,trait in ipairs(weaptrait) do
              			if item:hasTrait(trait) then
               				ch:removeItemFromSlot(slot)
               				break
               				
               		--##here begins the part that seems to be wrong
               		
				elseif item:hasTrait("container") then
						for index=1,item.go.containeritem:getCapacity() do
							local cItem = item.go.containeritem:getItem(index)
							if cItem then
								for _,cTrait in ipairs(weaptrait) do
              								if cItem:hasTrait(cTrait) then
               								ch:removeItemFromSlot(index)
               								break
										end
									end
								end
							end
						end
					end
				end
			end
		end

		setMouseItem()
end
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download

User avatar
THOM
Posts: 1251
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM » Fri Jun 17, 2022 12:44 pm

Never mind. Found it by my own. - Tricky detail stuff in the script...
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download

User avatar
Adrageron
Posts: 202
Joined: Thu Nov 08, 2012 1:22 pm

Re: Ask a simple question, get a simple answer

Post by Adrageron » Tue Sep 13, 2022 1:29 pm

Hey, guys!

Is there any way to forcefully exit party's "on top of the ladder" state?
What I've tried already:
Teleportation or party:setWorldPosition() - party just stays on the air
Knockback - ignored
Disabling/destroying ladder - ignored
Enabling party.gravity - ignored, will kill party by falling damage afrer jumping down from current position
Using party:setWorldPositionY() ignored

I'm out of ideas a bit :roll:

If not disabling the state, may be there is a way to check is the party on top of the ladder or not? party:isClimbing() don't work. Of course, I can search for ladder entities under the party, but this is not a guaranteed method. Party can stand on magic bridge or something...

Another interesting (and annoying) mechanic - if you spawn platform under the party after climbing the ladder, the party will fall down anyway after turning right/left. Looking for workaround for this "feature" too :mrgreen:
Last edited by Adrageron on Wed Sep 14, 2022 8:23 am, edited 1 time in total.

User avatar
THOM
Posts: 1251
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM » Tue Sep 13, 2022 2:34 pm

Without trying it by myself:

Have you tried PartyComponent:move(direction)?
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download

User avatar
Adrageron
Posts: 202
Joined: Thu Nov 08, 2012 1:22 pm

Re: Ask a simple question, get a simple answer

Post by Adrageron » Tue Sep 13, 2022 4:17 pm

THOM wrote:
Tue Sep 13, 2022 2:34 pm
Have you tried PartyComponent:move(direction)?
Thank you! It is worked (kind of). The problem is that the party actually moved (even backwards). But this is a progress anyway, I can spawn temporary obstacle to prevent moving :ugeek:

Post Reply