Page 1 of 2

As usual i can't get how to do the simplest things :D

Posted: Sat Oct 13, 2012 10:59 am
by azidahaka
function killateleport()
if dungeon_pressure_plate_10:isDown() == true
then
Teleporter_21:destroy()()
Teleporter_24:destroy()()
Teleporter_23:destroy()()
Teleporter_26:destroy()()
Teleporter_25:destroy()()
Teleporter_27:destroy()()
Teleporter_30:destroy()()
Teleporter_31:destroy()()
end
What is wrong with this? i can't find in the scripting references a good explanation of how to use the "destroy"

Re: As usual i can't get how to do the simplest things :D

Posted: Sat Oct 13, 2012 11:16 am
by Custode
I guess there are too many parentheses  in there, you only need one couple per destroy.

Re: As usual i can't get how to do the simplest things :D

Posted: Sat Oct 13, 2012 11:17 am
by azidahaka
tried that too and it won't work :P

Re: As usual i can't get how to do the simplest things :D

Posted: Sat Oct 13, 2012 11:20 am
by Komag
it's good to use print to test things, so along with all the destroy commands you might also include a line:
print("plate is down"). If the line shows up then you know at least everything else is working. If the line doesn't show up, then maybe you spelled something wrong, capitalized something wrong, linked it wrong, etc. That just helps narrow down the problem.

(the destroy command was something we all wanted during the beta phase so they added it in and I guess didn't have time to properly/fully document it)

Re: As usual i can't get how to do the simplest things :D

Posted: Sat Oct 13, 2012 11:23 am
by azidahaka
is there a funcion do nothing at all? :D also why the above won't work?

seems it might work for just one item...

Re: As usual i can't get how to do the simplest things :D

Posted: Sat Oct 13, 2012 11:24 am
by Custode
azidahaka wrote:tried that too and it won't work :P
I also noticed thet you missed an end for the function, try this:

Code: Select all

function killateleport()
	if dungeon_pressure_plate_10:isDown() then 
		Teleporter_21:destroy()
		Teleporter_24:destroy()
		Teleporter_23:destroy()
		Teleporter_26:destroy()
		Teleporter_25:destroy()
		Teleporter_27:destroy()
		Teleporter_30:destroy()
		Teleporter_31:destroy()
	end
end

Re: As usual i can't get how to do the simplest things :D

Posted: Sat Oct 13, 2012 11:41 am
by azidahaka
it's damn case sensitive and i forgot that! :oops:

Re: As usual i can't get how to do the simplest things :D

Posted: Sat Oct 13, 2012 3:08 pm
by Neikun
Alternate,

Code: Select all

function killateleport()
      Teleporter_21:destroy()
      Teleporter_24:destroy()
      Teleporter_23:destroy()
      Teleporter_26:destroy()
      Teleporter_25:destroy()
      Teleporter_27:destroy()
      Teleporter_30:destroy()
      Teleporter_31:destroy()
end
And just add a connector from the pressureplate to the script entity?

Re: As usual i can't get how to do the simplest things :D

Posted: Sat Oct 13, 2012 3:24 pm
by Magus
Neikun wrote:Alternate,

Code: Select all

function killateleport()
      Teleporter_21:destroy()
      Teleporter_24:destroy()
      Teleporter_23:destroy()
      Teleporter_26:destroy()
      Teleporter_25:destroy()
      Teleporter_27:destroy()
      Teleporter_30:destroy()
      Teleporter_31:destroy()
   end
end
And just add a connector from the pressureplate to the script entity?

remove 1 end :P

Re: As usual i can't get how to do the simplest things :D

Posted: Sat Oct 13, 2012 3:26 pm
by Neikun
I don't know what you are talking about :oops:
haha