Announcement: Why not try our official idea generator for inspiration when making puzzles?


Caravel Forum : DROD Boards : Architecture : Halph scripting or control
New Topic New Poll Post Reply
Poster Message
techant
Level: Smitemaster
Avatar
Rank Points: 854
Registered: 06-08-2004
IP: Logged
icon Halph scripting or control (0)  
I want Halph to come into a room, hit an orb to open a door that the player bumps and then leave the room, then come back in when I need him to hit the next orb.

I have tried using the NPC setting at Halph and the "turn into monster" which works up to that point. I understand the script ends once that command is used so I can't get him to leave the room and additional appearances of Halph just stand still and don't move.

Is there another way to do this?

How can I get him to leave the room. If he dies I die so killing him didn't work.

What I have is 7 tokens each allows Halph to open 1 door, but they are not assigned. He needs to open the first available door to the player then the next available one, once another token is activated.


____________________________
DROD RPG Released!! You must try it out it is Great!!
Click here to view the secret text

10-16-2010 at 12:04 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Timo006
Level: Smitemaster
Avatar
Rank Points: 527
Registered: 07-19-2006
IP: Logged
icon Re: Halph scripting or control (+1)  
May I suggest using a move command to get him to the room edge, and then use a disappear command? then 'wait for event entity at' and use appear.

____________________________
Drod Number: 3034; 8th person to see the Second Sky

[Last edited by Timo006 at 10-16-2010 12:11 PM]
10-16-2010 at 12:11 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Timo006
Level: Smitemaster
Avatar
Rank Points: 527
Registered: 07-19-2006
IP: Logged

File: Testing.hold (1.6 KB)
Downloaded 54 times.
License: Public Domain
icon Re: Halph scripting or control (+4)  
A quick anyone-edit showcase to show what I mean. :)

EDIT: I didn't even think of putting it in 1 variable, I probably still have some aftereffects of scripting Gray Goo. :P

____________________________
Drod Number: 3034; 8th person to see the Second Sky

[Last edited by Timo006 at 10-16-2010 01:19 PM]
10-16-2010 at 12:55 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
vinheim
Level: Smiter
Rank Points: 300
Registered: 05-31-2007
IP: Logged
icon Re: Halph scripting or control (+1)  
Timo provides an excellent solution, though I find it easier to manage if you used 1 door variable instead of his 7 which stores how many doors have been unlocked. So if it's 1, that means 1 door has been unlocked, etc. And you can check which door to unlock next by checking the current value of the door variable, so if it's 4, that means Halph will next move to and activate the orb that opens the 5th door.

But since he posted the build quickly after the reply, maybe he was just being quick ;)
10-16-2010 at 01:04 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
techant
Level: Smitemaster
Avatar
Rank Points: 854
Registered: 06-08-2004
IP: Logged
icon Re: Halph scripting or control (0)  
Thanks to you both!! :thumbsup

I did tried the 'move then disappear' but it was after I used a 'turn into monster' command and that stops the script. I was trying to use Halph helpful door opening ability so I wouldn't need to figure out what you did Timo006. But, yours looks very close to what I am after, so I will try it out. I will be back if I have any questions so keep an eye out for me please. I will also let you know it it works for me. Again THANKS

____________________________
DROD RPG Released!! You must try it out it is Great!!
Click here to view the secret text


[Last edited by techant at 10-17-2010 03:56 AM]
10-17-2010 at 03:55 AM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
techant
Level: Smitemaster
Avatar
Rank Points: 854
Registered: 06-08-2004
IP: Logged

File: Techants_Problem.hold (5.1 KB)
Downloaded 51 times.
License: Public Domain
icon Re: Halph scripting or control (+1)  
OK - I tried the script you suggested but I think my description was not very good. I have 7 different pressure plates that are tripped by different monsters. Once anyone of them is tripped you get a door opened. But, it must be the 1st in the series. The next one you capture on the pressure plate, opens the next door. That is why I was using Halph because he could come and open the door once he appeared but then I couldn't get him to leave and come back again to do the next door.

I uploaded the room I am working on. Capture the water skipper on the arrow with the light and then the eye. This is still really rough for the scripting.

____________________________
DROD RPG Released!! You must try it out it is Great!!
Click here to view the secret text


[Last edited by techant at 10-17-2010 09:47 AM]
10-17-2010 at 09:41 AM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Timo006
Level: Smitemaster
Avatar
Rank Points: 527
Registered: 07-19-2006
IP: Logged

File: Testing.hold (1.8 KB)
Downloaded 47 times.
License: Public Domain
icon Re: Halph scripting or control (+1)  
Updated version of the showcase, just change the "Wait for entity Monster at" command of the second character to use it in any room.

I've been working on this before you posted that room, let me know if my approach works. :)

Explanation: Instead of waiting for pressure plates, the doors are now triggered by monsters. The "Monster" var tells the amount of monsters that have passed over each unique pressure plate. The "Door 1" through "Door 7" variables keep the script from adding more than one point to the "monster" var, so you can now keep a monster on a pressure plate for more than 1 turn. which means that "Monster" can only have a maximum value of 7. In order to let the script continue no matter where Halph is, his movements are triggered when the value of "Monster" is larger than a certain value.

The bottom pressure plates allow the monsters to pass over certain pressure plate. They do not participate in any part of the script.

EDIT: Nice looking room, by the way, I'm looking forward to the final result!

____________________________
Drod Number: 3034; 8th person to see the Second Sky

[Last edited by Timo006 at 10-17-2010 10:28 AM]
10-17-2010 at 10:11 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
vinheim
Level: Smiter
Rank Points: 300
Registered: 05-31-2007
IP: Logged

File: Techants solution.hold (1.7 KB)
Downloaded 51 times.
License: Public Domain
icon Re: Halph scripting or control (+2)  
Hopefully, to lessen the complexity of this whole thing, I've uploaded a hold that should solve your problem easily. What happens is that every turn, the Halph NPC sets a variable "monster" to 0. Then it checks for each captured monster in the room and adds 1 to "monster". Finally, it checks if a rank door is open based on "monster", if the first rank door is not open and "monster" is greater than 0, Halph appears and goes to the first orb, activates it, goes back to the exit stairs and disappears.

This solution accounts for monsters captured on the same move too. If 2 monsters are captured on the same turn (or 1 soon after another), "monster" will be added by 2. Halph activates the first orb, goes back and activates the second orb, since it ALWAYS checks every turn if the number of rank doors opened is equal or not to the number of trapped monsters.

This solution uses easy-to-understand scripts and only 1 NPC (Halph).

[Last edited by vinheim at 10-17-2010 01:45 PM]
10-17-2010 at 01:40 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Timo006
Level: Smitemaster
Avatar
Rank Points: 527
Registered: 07-19-2006
IP: Logged
icon Re: Halph scripting or control (0)  
A bit late, and would probably make all this even more complex, but here's an (hopefully) bug-free implementation of my system in Techant's room.

The advantage of this system is that monsters don't need to stay trapped on a certain tile until the final door is opened.

EDIT: updated version below.

____________________________
Drod Number: 3034; 8th person to see the Second Sky

[Last edited by Timo006 at 10-17-2010 04:00 PM]
10-17-2010 at 02:38 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
vinheim
Level: Smiter
Rank Points: 300
Registered: 05-31-2007
IP: Logged

File: scripting weirdness.demo (866 bytes)
Downloaded 48 times.
License: Public Domain
icon Re: Halph scripting or control (+2)  
Oh yeah, no doubt that because of force arrows and the fact that not all grassy pressure plates can have enemies trapped on them, that enemies will have the ability to move off them. The scripting though seems a lil too complicated for the purpose it serves and right now, after several run throughs of the level, Halph usually opens one door less than he's supposed to.

This happens when I get enemies onto grass plates without having the southern clone tap a door. If you want, I could make a simpler hold tomorrow.

Attached is an example. The script works great if tapping a door straight after you can, so maybe some restrictions could be in place. Still though, a tad bit too complicated. ;)

EDIT: Even when tapping a door after you get an enemy onto a grass plate does the scripting weirdness work. I think it's related to one of the plates near the goblin...

[Last edited by vinheim at 10-17-2010 03:22 PM]
10-17-2010 at 03:19 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
vinheim
Level: Smiter
Rank Points: 300
Registered: 05-31-2007
IP: Logged
icon Re: Halph scripting or control (+1)  
Actually, I found a simpler way to deal with this. In my previous uploaded hold, the Halph NPC assumes the monsters don't move which allows it to calculate which ones have been captured. However, in Techant's hold, monsters CAN move, so we can't calculate every turn which monsters have been captured.

So why don't we replace monsters with NPCs? Every pressure plate is assigned with an NPC. Once an enemy steps on that pressure plate, the NPC "appears" on a wall tile where it can be checked for existence turn after turn.

The flaw? It's ugly to have all these NPCs appearing all over the walls. The solution? Make them invisible. There are 2 ways:

1) Unmark "visible" - But then they can't be checked for existence by the Halph NPC

2) Utilize visible "invisible" NPCs - I have used them in my hold "Vinheim's Creation". They are NPCs whose sprite is a 22x22 fully-grey PNG image. Because of the grey, every pixel of them is considered invisible and cannot be seen even when marked "visible".

Problem solved. Use my previous hold, add NPCs for each pressure plate (which I forgot to add), make their sprite invisible, have them appear somewhere to be checked for existence by Halph NPC. No variables, no complicated scripts, few NPCs.

I didn't solve the problem of only allowing monsters to step on those grassy pressure plates, but it should be easy for Techant to do a check on whether it was Beethro or a monster who activated the plate.
10-17-2010 at 03:41 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Timo006
Level: Smitemaster
Avatar
Rank Points: 527
Registered: 07-19-2006
IP: Logged

File: Implementation.hold (5.4 KB)
Downloaded 52 times.
License: Public Domain
icon Re: Halph scripting or control (+2)  
Vinheim, The problem mentioned above is now solved. :D

Turns out that I accidentally assigned 1 as "Door 8"'s value, while it should be 0, this means that, by changing it, the room now works fine.

Updated version included in this post. :)



____________________________
Drod Number: 3034; 8th person to see the Second Sky

[Last edited by Timo006 at 10-17-2010 04:02 PM]
10-17-2010 at 04:00 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
vinheim
Level: Smiter
Rank Points: 300
Registered: 05-31-2007
IP: Logged

File: vinheims solution for Techant.hold (3.1 KB)
Downloaded 46 times.
License: Public Domain
icon Re: Halph scripting or control (0)  
Well now it works fine now. I knew it was one of those doors :P

Anyways, this is my one utilizing visible "invisible" NPCs. The only flaw is that you may forget which NPC a plate is assigned to. Also, all pressure plates have grass around them if there's no other floor tile there.
10-17-2010 at 10:59 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
vinheim
Level: Smiter
Rank Points: 300
Registered: 05-31-2007
IP: Logged

File: invisible.png (144 bytes)
Downloaded 52 times.
License: Public Domain
icon Re: Halph scripting or control (0)  
If you decide to use it, here is the invisible NPC image.
10-17-2010 at 11:00 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
12th Archivist
Level: Smitemaster
Avatar
Rank Points: 789
Registered: 12-07-2008
IP: Logged
icon Re: Halph scripting or control (+1)  
vinheim wrote:
If you decide to use it, here is the invisible NPC image.
This post reeks of irony.

Anyway, on-topic, pretty neat! :D

____________________________
It was going well until it exploded.
~Scott Manley

Check out the DROD Wikia project here!
10-17-2010 at 11:04 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
techant
Level: Smitemaster
Avatar
Rank Points: 854
Registered: 06-08-2004
IP: Logged
icon Re: Halph scripting or control (+1)  
Thank you both for your solutions. I like them both. Timo006 the added appearance of the prizes is very clever and I would not have thought of it. I also think instead of using invisible NPC's I will use Wubba's in an interesting way. I will have them turn into Wubba's and use them as count down or decoration somewhere.

Now, if I just understood what you both did I could learn to "fish" myself.

Oh, thanks for the compliment about the room. It was for the contest this month. I have never asked for help with a contest entry because I thought that would disqualify me. I entered a different room which I created all by myself, but this room had me hooked. I just had to figure out how to do what I wanted. I do not build holds so I have not had the advantage of improving my scripting skills. I decided to post this so I could improve those skills. Thanks again for how much work you did to make this work. I am planning to submit it but with both of you with credit/ co-creators. If that is alright with each of you.

____________________________
DROD RPG Released!! You must try it out it is Great!!
Click here to view the secret text


[Last edited by techant at 10-18-2010 12:31 AM]
10-18-2010 at 12:26 AM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
vinheim
Level: Smiter
Rank Points: 300
Registered: 05-31-2007
IP: Logged
icon Re: Halph scripting or control (0)  
Ok using wubbas are another way, you could put them somewhere at the top as a measuring meter kinda thingy.

You should use Timo's additional character which shows the prizes and the guard's conversation too, though I recommend using my scripts for the unlocking of doors.

What my chars mean is that for each NPC assigned to a pressure plate, they are invisible at first, but they turn visible when a monster enters its pressure plate.

For the Halph NPC, it counts up how many of these NPCs have appeared (how many monsters have entered each pressure plate). Then it checks if a door is opened based on this number. If 1 of these NPCs have appeared, yet the door for rank 1 has not been opened, it unlocks it. If 4 of these NPCs have appeared, yet only the first 2 rank doors are opened, it runs and opens the 3rd door, then it opens the 4th door.

EDIT: Credit would be lovely, though you don't have to if you don't want to since I'm just using a TCB version of MetDRoiD Echoes staircase mechanic :P

EDIT 2: Oh and like Timo has already said, the room looks great, the way everything is laid out looks like it's going to look pretty attractive in the final version which I hope you do submit!

[Last edited by vinheim at 10-18-2010 12:42 AM]
10-18-2010 at 12:39 AM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Timo006
Level: Smitemaster
Avatar
Rank Points: 527
Registered: 07-19-2006
IP: Logged
icon Re: Halph scripting or control (0)  
Credits would be rather nice, but it's up to you whether you include us or not. If you need any more scripting (or perhaps explaining) done, just ask us, and it shall be done. ;)

____________________________
Drod Number: 3034; 8th person to see the Second Sky

[Last edited by Timo006 at 10-18-2010 07:53 AM]
10-18-2010 at 07:48 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Architecture : Halph scripting or control
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.9
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.