Page 4 of 4

Re: [HELP] Healing Crystal Red and Green

Posted: Fri Mar 01, 2013 12:17 am
by Neikun
In the mean time, please offer more colour suggestions!

Re: [HELP] Healing Crystal Red and Green

Posted: Fri Mar 01, 2013 1:18 pm
by Mutman
I would find use for dark blue and dark purple/violet :)

Re: [HELP] Healing Crystal Red and Green

Posted: Fri Mar 01, 2013 2:36 pm
by Neikun
I'm getting a feeling like dark crystals are wanted then.
I wonder if I can pull off a translucent crystal.
I'll need some help from Diarmuid to set up the scripts for making crystals in a new material.

Re: [HELP] Healing Crystal Red and Green

Posted: Sat Mar 02, 2013 4:23 pm
by Xanathar
Hi guys
I'm doing a similar thing in my dungeon (just with big floating runes instead of crystals).

I'm scripting the runes as standard crystals, and using the following script to handle all kind of clicks (inspired by Antti suggestions).

I'm sure there are pros in your approach, but reporting it here just in case it can help you. It can also be a way to detect clicks in the future:
SpoilerShow

Code: Select all

lastx = 0
lasty = 0
lastf = 0
lastl = 0
lastS = nil

-- This must be called by the onGui handler
function onClick(g)
	-- check if party moved. Use this way to handle also changing facing by mouse look
	if (party.x ~= lastx) or (party.y ~= lasty) or (party.facing ~= lastf) or (party.level ~= lastl) then 
		local dx, dy = getForward(party.facing)
		local Sx = grimq.from(entitiesAt(party.level, party.x + dx, party.y + dy))
			:where("class", "Crystal")
			:first()
			
		if (Sx == nil) then
			lastS = nil
		else 
			lastS = Sx.id
		end
	end

	if (lastS == nil) then
		return;
	end
	
	local S = findEntity(lastS)
	
	if (S == nil) then
	    return; 
	end

	if (g.button(lastS, 0, 0, g.width, g.height)) then
		local pX = g.mouseX / g.width
		local pY = g.mouseY / g.height
		
		if (pX < 0.33 or pX > 0.66) then
			return
		end

		local item = getMouseItem()
		
		if (item == nil) then
			if (pY > 0.75) then
				local pickup = grimq.from(entitiesAt(party.level, party.x, party.y))
				:where(grimq.isItem)
				:where(function(f) return f.facing == party.facing; end)
				:first()
				
				if (pickup ~= nil) then
					local mi = grimq.copyItem(pickup)
					pickup:destroy()
					setMouseItem(mi)
					return
				end
			end
			party:heal()
		else
			activateShrine(S, item)
		end
	end
end

function activateShrine(S, item)
        -- placeholder
	hudPrint("used item " .. item.name .. " over shrine " .. S.name)
end


Re: [HELP] Healing Crystal Red and Green

Posted: Sun Mar 10, 2013 12:37 pm
by DeDy
Nightfall: First Contact is finished and I would like to put the red and green crystal. Please, is there a chance that the crystals within a week of release?

Re: [HELP] Healing Crystal Red and Green

Posted: Mon Mar 11, 2013 5:50 am
by Diarmuid
We should release of first version of the crystals probably tomorrow. Just a last check run to see if everything's ok with the scripts, and pack the whole thing.

Re: [HELP] Healing Crystal Red and Green

Posted: Mon Mar 11, 2013 2:57 pm
by Neikun
The best part of the crystal scripts is that it will become very easy to make your own.
We have five colours at the moment, and if you want to make a new one, it's very easy.

Re: [HELP] Healing Crystal Red and Green

Posted: Sat May 24, 2014 9:42 pm
by Eleven Warrior
Hi guys :)

I would like to know if the Colored Crystal were finished? I have downloaded the Crystals Pack from the Nexus, but it does not have the 5 or 6 colored crystal in it. I would realy like to get a hold of these colored crystals Please :)

Thxs :)

Re: [HELP] Healing Crystal Red and Green

Posted: Sat May 24, 2014 10:22 pm
by Sutekh

Re: [HELP] Healing Crystal Red and Green

Posted: Sun May 25, 2014 5:49 am
by Eleven Warrior
Errrrr yes those one thxs, I did not see them on the site :oops: