Page 61 of 396

Re: Ask a simple question, get a simple answer

Posted: Fri Apr 17, 2015 11:31 pm
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).

Re: Ask a simple question, get a simple answer

Posted: Sat Apr 18, 2015 5:39 am
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...

Re: Ask a simple question, get a simple answer

Posted: Sat Apr 18, 2015 6:42 am
by minmay
Yes, a ParticleComponent can have only one particle system at a time.

Re: Ask a simple question, get a simple answer

Posted: Sat Apr 18, 2015 8:14 am
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?

Re: Ask a simple question, get a simple answer

Posted: Sun Apr 19, 2015 12:47 pm
by The cube
How to check what items are in a certain tile or what items are on a certain pressure plate?

Re: Ask a simple question, get a simple answer

Posted: Sun Apr 19, 2015 2:12 pm
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

Re: Ask a simple question, get a simple answer

Posted: Mon Apr 20, 2015 10:59 am
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.

Re: Ask a simple question, get a simple answer

Posted: Mon Apr 20, 2015 7:47 pm
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?

Re: Ask a simple question, get a simple answer

Posted: Mon Apr 20, 2015 8:02 pm
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

Re: Ask a simple question, get a simple answer

Posted: Mon Apr 20, 2015 9:47 pm
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?