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!
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

Eburt wrote:I guess I should clarify that the issue is really just when I move the camera up or down (it sort of pushes forward into the floor if I look down and pulls back when I look up). It pans fine and does move correctly with the party. The built in screenEffects appear to work regardless of the camera rotation axis. The only differences I can see to the way it's done in the base definitions are:

1. They use boxMin and boxMax to position the particle where as I use an offset in the actual particle defintion.
2. I am simply enabling the particle component attached to the party, rather than calling PartyComponent:playScreenEffect().

I tested number 1 and it didn't seem to make a difference. Do I have to use playScreenEffect or am I just missing something obvious?
screenEffect does seem to get transformed to follow the camera instead of the party object (since the camera itself is offset from the party) so yes, if you want to follow the camera like screenEffect you will have to use either screenEffect itself (no need to do so through PartyComponent:playScreenEffect()) or reverse engineer it (which I don't recommend).
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.
Eburt
Posts: 69
Joined: Thu Feb 05, 2015 5:44 am

Re: Ask a simple question, get a simple answer

Post by Eburt »

Thanks minmay - I appreciate your patience. I've got everything working smoothly now.

Edit: Wait, I lied. It works, but only until another screen effect is activated. E.g., getting hit by a fireball "overrides" the screen effect that I activated. The obvious workaround to me would be to keep activating my screen effect, but I think that could make for some ugly cut-off fireball effects...
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

Yes, a ParticleComponent can have only one particle system at a time.
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.
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

Eburt wrote:Thanks minmay - I appreciate your patience. I've got everything working smoothly now.

Edit: Wait, I lied. It works, but only until another screen effect is activated. E.g., getting hit by a fireball "overrides" the screen effect that I activated. The obvious workaround to me would be to keep activating my screen effect, but I think that could make for some ugly cut-off fireball effects...
What exactly are you doing with the screen effect? Is this something that can be done using a 3D model instead of a particle system?
User avatar
The cube
Posts: 94
Joined: Tue Apr 23, 2013 6:09 pm
Location: Barren Desert

Re: Ask a simple question, get a simple answer

Post by The cube »

How to check what items are in a certain tile or what items are on a certain pressure plate?
User avatar
Duncan1246
Posts: 404
Joined: Mon Jan 19, 2015 7:42 pm

Re: Ask a simple question, get a simple answer

Post by Duncan1246 »

The cube wrote:How to check what items are in a certain tile or what items are on a certain pressure plate?
You can use in a script: party.map:entitiesAt(x,y) or self.go.map:entitiesAt(x,y) where x,y is the position of the tile; I think you have no specific call for a floor trigger.
Then you can explore the list for a specific item:

Code: Select all

for e in party.map:entitiesAt(x,y) do	
					if e.name=="youritemname" then
					--here the action to perform
					end
				end
Duncan
The Blue Monastery (LOG1)
download at:http://www.nexusmods.com/grimrock/mods/399/?

Finisterrae(LOG2)
download at:http://www.nexusmods.com/legendofgrimrock2/mods/61/?
User avatar
AndakRainor
Posts: 674
Joined: Thu Nov 20, 2014 5:18 pm

Re: Ask a simple question, get a simple answer

Post by AndakRainor »

Is it possible to access spells data outside their definitions ? I would like to check skills requirements for a spell knowing its name.
User avatar
The cube
Posts: 94
Joined: Tue Apr 23, 2013 6:09 pm
Location: Barren Desert

Re: Ask a simple question, get a simple answer

Post by The cube »

Code: Select all

function checkplatforms()
	if magic_bridge_21.magic_bridge:getState() == activated then
		hudPrint("works!")
	end
end

function checkplatforms()
	if magic_bridge_21.controller:getState() == activated then
		hudPrint("works!")
	end
end

function checkplatforms()
	if magic_bridge_21.magic_bridge:isActivated() then
		hudPrint("works!")
	end
end

function checkplatforms()
	if magic_bridge_21.controller:isActivated() then
		hudPrint("works!")
	end
end
None of these work, they all crash. What is the actual way to do this?
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

Magic bridges do not have a component named magic_bridge. Neither ControllerComponent nor PlatformComponent have a component called getState. Grimrock 2 has a scripting reference (and another one here), as well as the asset pack which contains all object definitions (go to page 3 of that thread for a mirror). At a minimum, you should really read and understand the definition of an object before you use it. What you probably wanted is:

Code: Select all

function checkplatforms()
   if magic_bridge_21.platform:isEnabled() then
      hudPrint("works!")
   end
end
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.
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

When I set an onDamage hook for the party and print out the incoming variables, I see who was attacked, how they were attacked, and for how much damage.

But when I return False from the function, the attack still damages the champion. Is this a bug, or a deliberate change from similar behaviors in some LoG1 functions? It seems awfully amiss to have an onDamage hook that doesn't allow canceling. What is the point of the onDamage hook in LoG2?
Post Reply