Page 74 of 396

Re: Ask a simple question, get a simple answer

Posted: Sun Jun 14, 2015 11:28 am
by alois
It seems to me that you are adding to the alcove surface something different from the item you have spawned. Try

Code: Select all

local rs = spawn("rat_shank")
pickup_food_alcove.surface:addItem(rs.item)
playSound("level_up")
Alois :)

Re: Ask a simple question, get a simple answer

Posted: Sun Jun 14, 2015 12:54 pm
by Isaac
alois wrote:It seems to me that you are adding to the alcove surface something different from the item you have spawned. Try

Code: Select all

local rs = spawn("rat_shank")
pickup_food_alcove.surface:addItem(rs.item)
playSound("level_up")
Alois :)
Indeed.
Or even just...

Code: Select all

pickup_food_alcove.surface:addItem(spawn("rat_shank").item)
playSound("level_up")

Re: Ask a simple question, get a simple answer

Posted: Mon Jun 15, 2015 12:47 pm
by Dunkler
Is there a monster-blocker item in the grimrock editor?

I have only seen blockers that block everything.

Re: Ask a simple question, get a simple answer

Posted: Mon Jun 15, 2015 1:07 pm
by Isaac
Dunkler wrote:Is there a monster-blocker item in the grimrock editor?

I have only seen blockers that block everything.
I haven't seen that. The regular Blocker objects have an option for blocking the party and items, but that's not the default.

Code: Select all

-- snippet
	name = "blocker",
	components = {
		{
			class = "Obstacle",
			blockParty = false,
			blockItems = false,
		},
If you have blockParty and BlockItems set in your blockers, you can set them to False.

Re: Ask a simple question, get a simple answer

Posted: Mon Jun 15, 2015 1:54 pm
by Dunkler
Thank you.

That means there is no option to only block monsters to move to a specific square.

I remember in Dungeon Master Editors was a simple Block-Monster Objekt..which was very useful.

Edit: Oh wait...i misunderstood you :) Your created Blocker would block monsters but nothing else..so that would work

Re: Ask a simple question, get a simple answer

Posted: Mon Jun 15, 2015 3:15 pm
by Isaac
Dunkler wrote:Thank you.
Edit: Oh wait...i misunderstood you :) Your created Blocker would block monsters but nothing else..so that would work
Correct; but AFAIK, that is the default behavior of blocker objects.

Re: Ask a simple question, get a simple answer

Posted: Mon Jun 15, 2015 5:54 pm
by minmay
...there's already an object called "blocker" in the standard assets that does exactly what you want. It only blocks monsters.

Re: Ask a simple question, get a simple answer

Posted: Tue Jun 16, 2015 12:40 am
by Eleven Warrior
Thank you Alois and Issac awesome guys :)

Ok I got it to work, but after you use the lever 9 times it still spawns rat_shanks. I thought if "fed_counter > 9 then" would stop the player using the lever further. Once it's greater than 9 it should stop and hudPrint the text (Nothing happens)?? What imam I doing wrong on this guys thxs in return :)

Code: Select all

fed_counter = 0

function feedTheParty()
if fed_counter > 9 then
	hudPrint("Nothing happens.")
else
	fed_counter = fed_counter + 1
		pickup_food_alcove.surface:addItem(spawn("rat_shank").item)
				playSound("level_up")
end
	end
EDIT: Errrr sorry this code does work I missed 1 count with the level :oops:

Re: Ask a simple question, get a simple answer

Posted: Wed Jun 17, 2015 1:11 am
by Eleven Warrior
Hi again guys.

I need a Script that allows me to turn the Party to either 0,1,2,3 when the walk onto a floor_trigger. I think this was mentioned b4 but I cannot find the Script. I know that the player can still use the mouse to turn, but I only need it to happen on level entry or exit.

Thxs for help on this :)

Re: Ask a simple question, get a simple answer

Posted: Wed Jun 17, 2015 6:27 am
by alois
Do you want the party to simply turn (in this case: party:setPosition(party.x,party.y,0/1/2/3,party.elevation,party.level) is enough) or to be incapable of turning after you set the facing (which involves the onTurn hook)?

Alois :)