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

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
azidahaka
Posts: 91
Joined: Fri Apr 13, 2012 9:48 pm

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

Post 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"
Custode
Posts: 15
Joined: Wed Oct 10, 2012 8:29 pm

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

Post by Custode »

I guess there are too many parentheses  in there, you only need one couple per destroy.
azidahaka
Posts: 91
Joined: Fri Apr 13, 2012 9:48 pm

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

Post by azidahaka »

tried that too and it won't work :P
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

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

Post 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)
Finished Dungeons - complete mods to play
azidahaka
Posts: 91
Joined: Fri Apr 13, 2012 9:48 pm

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

Post 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...
Custode
Posts: 15
Joined: Wed Oct 10, 2012 8:29 pm

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

Post 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
azidahaka
Posts: 91
Joined: Fri Apr 13, 2012 9:48 pm

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

Post by azidahaka »

it's damn case sensitive and i forgot that! :oops:
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

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

Post 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?
Last edited by Neikun on Sat Oct 13, 2012 3:25 pm, edited 1 time in total.
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
Magus
Posts: 56
Joined: Wed Sep 12, 2012 6:05 pm

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

Post 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
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

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

Post by Neikun »

I don't know what you are talking about :oops:
haha
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
Post Reply