View previous topic :: View next topic |
Author |
Message |
Master K Ex-Akatsuki Masked Ninja

Joined: 11 Jun 2011 Posts: 57 Location: Everywhere and Nowhere. Muahaha!
|
Posted: Sat Jun 11, 2011 11:13 am Post subject: Creating a Puzzle |
|
|
Hello dear reader.
I would like to know how I could create a puzzle with plotscripting. I have a basic idea of it forming in my head on what might be needed:
*NPC's that look like puzzle pieces.
*A tileset that looks like a completed puzzle.
*Perhaps a cursor script to move said puzzle pieces?
Could you please help me? |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sun Jun 12, 2011 1:42 am Post subject: |
|
|
Wow that's vague! Are you thinking of the fifteen puzzle, or what? Maybe you're asking for puzzle ideas rather than actual scripting help? _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Master K Ex-Akatsuki Masked Ninja

Joined: 11 Jun 2011 Posts: 57 Location: Everywhere and Nowhere. Muahaha!
|
Posted: Sun Jun 12, 2011 5:51 am Post subject: |
|
|
Apologies for vagueness, what I mean is actual (I rather that over fake) scripting help to make a sort of jigsaw puzzle.
What I am really curious to know is how to make something trigger by pushing something else on it in the right position. |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sun Jun 12, 2011 6:02 pm Post subject: |
|
|
Ah. Pretty simple. It'd be best to run a loop in the map autorun script which continually checks npc positions. Also it's best to use pixel positions instead of tile positions so that effects don't immediately occur when an NPC starts to move onto the correct tile. I'm going to assume that all the pushable npcs are unique (they each have a different NPC definition number). Here's a script to set a tag when a specific npc is in a specific spot:
Code: |
plotscript, puzzle map, begin
while (current map == 1) begin # set the correct map number here
if (npc pixel x (1) == 4 * 20 && npc pixel y (1) == 5 * 20) # change to correct position
then (set tag (tag:npc 1 placed, on)) #change tag name
else (set tag (tag:npc 1 placed, off))
#more npc position checks can go here...
wait
end
end |
Depending on whether the map resets when you leave the map and come back, you might want to add "set tag (tag:npc 1 placed, off)" to the end of the script. But if this is a one-time minigame, probably not.
If you want something to happen when multiple npcs are correctly placed, you'd want to count them instead of setting tags. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
|