Page 1 of 4

[HELP] Healing Crystal Red and Green

Posted: Fri Feb 15, 2013 10:23 am
by DeDy
Hi all, please help created red and green crystal.

What am I doing wrong?

Download model, dif, particles, material: http://nightfall.eddo.cz/files/healing_ ... _green.zip

Image
Image

Re: [HELP] Healing Crystal Red and Green

Posted: Fri Feb 15, 2013 5:14 pm
by Grimfan
Hi DeDy,

You're going to need the advice of someone like Neikun or Skuggasvein on this (since they have both played around with healing crystals before) but from some of their comments it appears that several elements of healing crystals are hardcoded and can't be changed or modified effectively, and I think the blue coloration of healing crystals might be one of those hardcoded things (otherwise one of the two guys I've mentioned would have already made proper green or red crystals). Of course, you're going to need their input on this one to get a clear answer.

Sorry, I can't offer any more help on the matter. :(

Re: [HELP] Healing Crystal Red and Green

Posted: Fri Feb 15, 2013 5:26 pm
by Skuggasveinn
Grimfan is correct, the shader for the healing crystal is hardcoded, so if you create something thats a healingcrystal class it will always have the blue shader, the particle effects can be changed as you have found out. So for now there is not much we can do regarding modding the healing crystal.

Re: [HELP] Healing Crystal Red and Green

Posted: Fri Feb 15, 2013 5:27 pm
by Komag
You could completely recreate the effect from scratch though, at least I think it could be done

Re: [HELP] Healing Crystal Red and Green

Posted: Fri Feb 15, 2013 5:49 pm
by DeDy
What I can do :( Thanks for the information.

Re: [HELP] Healing Crystal Red and Green

Posted: Fri Feb 15, 2013 5:58 pm
by Diarmuid
We were discussing this this week in the LotNR chat with Neikun.

You could completely recreate the effect with still slowly rotating projectiles objects for the crystals and use an invisible altar with a large click zone for the trigger. (More specifically, the altar has an invisible item that when you take invokes onDeactivate, which calls party:heal, setMouseItem(nil) and respawns the item back). The projectile model has to be translated down (like -15) in the GMT, and the projectile shot with an offset above (+15) so that the projectile doesn't collide.

EDIT: and of course, you would need two models, one active and one dead crystal, and swap them.

To get the id of a projectile you just created, use this wrapper function which returns the Id:

Code: Select all

function shootProjectileWithId(projName,level,x,y,dir,speed,gravity,velocityUp,offsetX,offsetY,offsetZ,attackPower, ignoreEntity,fragile,championOrdinal)
	local pIds = {}
	for i in entitiesAt(level, x, y) do
		if i.class == "Item" and string.find(i.id, "^%d+$") then
			pIds[i.id] = i.name
		end
	end
	shootProjectile(projName,level,x,y,dir,speed,gravity,velocityUp,offsetX,offsetY,offsetZ,attackPower, ignoreEntity,fragile,championOrdinal)
 	for i in entitiesAt(level, x, y) do
		if i.class == "Item" and string.find(i.id, "^%d+$") and not(pIds[i.id]) then
			return i.id
		end
	end  
end
So, example usage:

Code: Select all

local crystalId = shootProjectileWithId(projName,level,x,y,dir,speed,gravity,velocityUp,offsetX,offsetY,offsetZ,attackPower, ignoreEntity,fragile,championOrdinal)
and then you can store that somewhere and call this to get rid of it:

Code: Select all

findEntity(crystalId):destroy()

Re: [HELP] Healing Crystal Red and Green

Posted: Fri Feb 15, 2013 6:33 pm
by Komag
you got that DeDy? Yeah, me neither :lol:

seriously though, it's pretty advanced stuff, but maybe you are more up to it than I am :)

Re: [HELP] Healing Crystal Red and Green

Posted: Fri Feb 15, 2013 6:52 pm
by Diarmuid
I was throwing quick info around for people to catch, sorry I don't have much time to explain everything in detail :roll: . I am also not sure how to redefine alcoves/altars clicking zones. If someone (Neikun?) could supply me with the altar object (an invisible object that has a clickable area roughly the size of the crystal), I'm up for preparing and setting up the crystal projectile system for the community to use.

Re: [HELP] Healing Crystal Red and Green

Posted: Fri Feb 15, 2013 7:01 pm
by Neikun
Eventually we're all going to need an in depth tutorial on how projectiles can be used to make animations.

I know using the altar as a trigger is going to function a lot like the knocking on the door feature of the Big Friendly Warden did. Where You pick up an invisible item that is instantly taken out of your mouse item.
I know that when Diarmuid is talking about a +15 offset it's because if a projectile hits anything, it disappears. That's the nature of a projectile. So if your model exists (15/3) 5 squares below the regular plain, and fire it (15/3) 5 squares about the regular plain, the model will show in the regular plain while the projectile is above the ceiling and outside any walls. Safe from any collision.

Also what will need to happen when the crystal activates and becomes dead, a timer will need to start to revive it again.

I wonder if we would actually need four projectiles in order to get the the smaller crystal pieces to rotate properly.

Re: [HELP] Healing Crystal Red and Green

Posted: Fri Feb 15, 2013 7:03 pm
by Neikun
I should be able to get on that.

I'm going to need to turn the healing crystal model into an item for easy reference.

WHOO! Feels good to get my Grimrock modding cap back on!