Page 356 of 400

Re: Ask a simple question, get a simple answer

Posted: Mon Nov 02, 2020 1:44 am
by Isaac
If you are using the tomb tile-set along with elevation changes, and are seeing holes in the wall when looking downward at them... Here is a fix for that.

http://www.grimrock.net/forum/viewtopic ... 10#p119454

Re: Ask a simple question, get a simple answer

Posted: Mon Nov 02, 2020 2:06 am
by hyteria
not sure ton understand (english not my native langage) but yes i have got some connection probleme with some tiles set and i found a fix when i change properties level rising/lowing the cell max

its seems to work for now

Re: Ask a simple question, get a simple answer

Posted: Mon Nov 02, 2020 8:29 pm
by hyteria
sorry to bother again but i tried to modifie a script but to be honest i dont understand nothing :/

Code: Select all

function surfaceContains(socket, item)
	for v,i in socket:contents() do
	if i.go.name == item then return true
	end
end
end

function openfinaldoor()

	if surfaceContains(beacon_air_1.socket, "figure_ice_guardian") and if surfaceContains(beacon_earth_1.socket, "figure_snail" then
	ctomb_gate_11.controller:open()
	playSound("secret")
	else
	ctomb_gate_11.controller:close()
	
	end
end
i try to make a door who open if player insert specifics items on two different altar

i think there is something to do with counter , but i dont know
thx

Re: Ask a simple question, get a simple answer

Posted: Mon Nov 02, 2020 9:27 pm
by Zo Kath Ra
hyteria wrote: Mon Nov 02, 2020 8:29 pm sorry to bother again but i tried to modifie a script but to be honest i dont understand nothing :/
For both altars, connect their "onInsertItem" action to openfinaldoor()

Re: Ask a simple question, get a simple answer

Posted: Mon Nov 02, 2020 10:00 pm
by hyteria
this was what i did , but this doesn t work

error is "unexpected symbol near "if"

Re: Ask a simple question, get a simple answer

Posted: Mon Nov 02, 2020 10:06 pm
by hyteria
this work i removed the "if" and add ")" who s missing :)

Re: Ask a simple question, get a simple answer

Posted: Tue Nov 03, 2020 12:31 pm
by hyteria
hello

another question :

Code: Select all

counter = 0

function dmdispelltrap()

	for i=14,15 do
	
		local tile = findEntity("spawner_"..i)
		if tile~=nil then
			local active = (tile.x+tile.y+counter) % 4
			if active == 1 then 
				tile.controller:activate()
			end
		end
	
	end
	
	counter = counter + 1
end
using this , how i have something more random ?

thx!

Re: Ask a simple question, get a simple answer

Posted: Tue Nov 03, 2020 4:32 pm
by Isaac
What kind? (Randomness in the frequency of triggering, or of which trap triggers?)

This has both:

Code: Select all

function dmdispelltrap()
	if math.random() < .26 then  										--chance of active trap; range is between zero and one
		local activeTrap = findEntity("spawner_"..math.random(14,15)) 	--randomly chooses either 14 or 15; range includes all numbers in between
		if activeTrap 													--exists
			then activeTrap.controller:activate()						--activate the trap
		end	 
	end	
end
_______________________________

* Are both spawners on the same tile, and this is used to vary the output? There is a better way for that:

Code: Select all

function dmdispelltrap()
	local effect = {"fireburst", "ice_shards", "poison_cloud_medium", "shockburst"}
	spawner_14.spawner:setSpawnedEntity(effect[math.random(#effect)])
	if math.random()<.26 then spawner_14.controller:activate() end
end

Re: Ask a simple question, get a simple answer

Posted: Tue Nov 03, 2020 5:20 pm
by hyteria
this is a simple trigger who activate 3 spawner (fireball)

edit : ok i tried the first one and seems ok , to chance frequency i just have to change math method ratio ?
another thing , i noticed that spawner shot one after the other , this is possible to add chance that both spawn ?
thx a lot for your help !

Re: Ask a simple question, get a simple answer

Posted: Tue Nov 03, 2020 5:39 pm
by Isaac
It activates three?
___________

To make the trap fire more often, raise the .26 value. (*Maximum of up to 1)
0.5 is a 50/50 chance. As written, if the chance fails, then none trigger. It can be changed so the random element simply chooses which one fires for that call, so that there will always be one that fires.
___________

Are they really just random? Your players will probably try to find a meaningful pattern to them.