Page 1 of 1

Please take a look at my simple script.

Posted: Sat Feb 07, 2015 8:55 am
by Tarbel
I like so many others are trying to re-create the statue puzzle. I have done all the searches and read all the posts. I have also looked at the training videos. I am still getting an error when this script executes.

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


function CastleDoor()
if surfaceContains(beach_puzzle_statue_1.surface, "rapier") then
castle_entrance_door_1.door:open()
else
castle_entrance_door_1.door:close()
end
end


Any help would be greatly appreciated. Please be kind as this is my first post.

-Tarbel

Re: Please take a look at my simple script.

Posted: Sat Feb 07, 2015 9:00 am
by minmay
beach_puzzle_statue does not have a SurfaceComponent. It has a SocketComponent.

You can look at the main campaign in the editor to see how all the original puzzles etc. are done.

Re: Please take a look at my simple script.

Posted: Sun Feb 08, 2015 9:06 pm
by Tarbel
Thank you Minmay for the quick response.

I am now able to call up the game in the editor and view the actual scripts used. This will be a huge help!

In reviewing the scripts used in "Shipwreck Beach" I didn't find anything that identified a "Rapier" as the item the statue is looking for. So I assumed it must be the default item. In my mod it works just fine with no script if I want the user to place a "Rapier" on the statue.

Is it possible to change the requirement to a different item? If so how?

Thanks, Tarbel

Re: Please take a look at my simple script.

Posted: Sun Feb 08, 2015 9:16 pm
by minmay
Download the asset pack and look at the definition for beach_puzzle_statue.