enable floortrigger is strange

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
Vice Dellos
Posts: 47
Joined: Thu Feb 28, 2013 12:56 pm

enable floortrigger is strange

Post by Vice Dellos »

so i am looking at creating a champ select level and i used one floortrigger to choose what champion you are selecting and then a second one to reenable it after you cant go back so you cant cycle champions at the start, but i can let you go through select for multiple champs

I used this to re-enable it

Code: Select all

function resetChampionSelect()
	champion_selector.floortrigger:enable()
	hudPrint("?")
end
and it works(!!!!! yayayayayayaya! huehuehue! and stuff), but theres a strange catch... it only works if you walk over it twice...
WTF i don't get it.

does anybody know why i have to trigger it twice before the initial floortrigger is enabled again?
OGDA
Posts: 115
Joined: Tue Oct 28, 2014 5:07 pm

Re: enable floortrigger is strange

Post by OGDA »

Hello,

I was trying to reenable floor triggers yesterday and nearly went mad as nothing worked. I will try walking over them twice in the evening. :)

What happens when you try:

Code: Select all

function resetChampionSelect()
   champion_selector.floortrigger:enable()
   champion_selector.floortrigger:enable()
   hudPrint("?")
end
?

Kind regards,
Joerg
User avatar
Vice Dellos
Posts: 47
Joined: Thu Feb 28, 2013 12:56 pm

Re: enable floortrigger is strange

Post by Vice Dellos »

its strange isnt it XD why didnt i think of that though XD

so i was like why didnt I think fo that solution at first so then Itested it, but it doewsnt work.

what worked for me was to just copy the trighger and call upon the function twice
OGDA
Posts: 115
Joined: Tue Oct 28, 2014 5:07 pm

Re: enable floortrigger is strange

Post by OGDA »

Extremely strange.

Just tested it and placing two floor trigger over each other and calling the same script seems to be the only solution.

Double enable in one script -> not working.
Calling the same script twice from one floor trigger -> not working.
Calling two scripts with enable in each from one floor trigger -> not working.

Unfortunately it still isn't working (even the solution at the top) with several floor triggers as you need 2 per tile and it seems I can only reactivate one of the others at a time with this solution. :/
Also there is a bug where sometimes the function of a script is not set in the connector, reloading the project does help here.

I can't believe this is how it's meant to work, we are missing something here.
User avatar
Vice Dellos
Posts: 47
Joined: Thu Feb 28, 2013 12:56 pm

Re: enable floortrigger is strange

Post by Vice Dellos »

in your case perhaps have 2 triggers each call the same 2 functions that enable one of the other 2 stacked triggers
OGDA
Posts: 115
Joined: Tue Oct 28, 2014 5:07 pm

Re: enable floortrigger is strange

Post by OGDA »

I know don't use the floor trigger disableself anymore und solved it with a script:

Code: Select all

function trcheckscript()
	circlechange = 0

	if tr1.floortrigger:isActivated(true) then
 		cirlcestring = "circleplate1"

		if tempcirclestring ~= cirlcestring then
			circlechange = 1
		end

		tempcirclestring = cirlcestring
	elseif tr2.floortrigger:isActivated(true) then
		 cirlcestring = "circleplate2"
		
		if tempcirclestring ~= cirlcestring then
			circlechange = 1
		end

		tempcirclestring = cirlcestring
	end
	
	if circlechange == 1 then
	
		-- do anything
		
		circlechange = 0
	end
end
Post Reply