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


Caravel Forum : DROD Boards : Architecture : Changing the weapon the guard wields
New Topic New Poll Post Reply
Poster Message
IQubic
Level: Delver
Rank Points: 78
Registered: 11-22-2015
IP: Logged
icon Changing the weapon the guard wields (0)  
How does on change the weapon that a guard uses?

____________________________
119th Skywatcher

[Last edited by IQubic at 03-15-2016 03:40 AM]
03-15-2016 at 03:25 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
Insoluble
Level: Smitemaster
Avatar
Rank Points: 1638
Registered: 09-04-2014
IP: Logged

File: Scripted Guards with weapons.hold (1 KB)
Downloaded 18 times.
License: Public Domain
icon Re: Changing the weapon the guard wields (+3)  
Unfortunately it isn't as easy as all that. It's a bit of a process. You do it with scripted characters instead of placing guards directly. In the level editor, place a Character and when you place it it should bring up the "Customize Character" screen. Select "Guard" as the character Type from the list on the right.

To give the guard a weapon, click "Add Command" and select "Set Var" This will bring up a list of variables. Select _MyWeapon from the list and assign it one of the following numbers for your weapon of choice.

1= pickax
2= spear
3= staff
4= dagger
5= caber

You'll need to add a few more commands for this to work properly as a guard. The script below should do the trick. You can substitute the number for the one in the list above corresponding with the number you need.

If ...
       Wait for Clean Room
   End
Else
   Appear
   Set var _MyWeapon=1
   Imperative Required Target
   Turn into Monster
If End


This includes the Else command from the new 5.1 update, but you can do without it if you need to. The "If... Wait for clean room" bit makes sure that your scripted guard doesn't reappear after you clear the room. The other stuff makes it act like a real guard. I'll also attach a demo hold with scripted guards that you can copy and paste into your hold if none of this makes sense.


____________________________
Links to neat forum tools that I always have trouble finding:
Click here to view the secret text


[Last edited by Insoluble at 03-15-2016 04:26 AM]
03-15-2016 at 04:21 AM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
Dragon Fogel
Level: Smitemaster
Rank Points: 2430
Registered: 06-21-2014
IP: Logged
icon Re: Changing the weapon the guard wields (+1)  
Actually, I think it's Else If that's new, Else was always there.

Also, Disappear may be generally better than End? I think that ensures the guards reappear if the room is uncleared again. (Using seeding beacons or creating a tar baby.) That is what Disappear does, right?
03-15-2016 at 05:00 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
bomber50
Level: Smitemaster
Rank Points: 872
Registered: 09-18-2006
IP: Logged
icon Re: Changing the weapon the guard wields (+1)  
Three clarifications to what Insoluble said:

1. Imperative Required Target can be eliminated in the scripts (it becomes required target when turned into monster).

2. The custom guards will only work if there's at least one non-scripted monster or conquer token in the room.

If your room doesn't have any other monsters, you can place a seep or water skipper somewhere random. and then use Attack tile -> Kill to kill it on the first turn. This will allow the custom guards to show up.

3. If you need to use the script several times in multiple rooms, it's preferable to make your own custom guard character.

On the Customize Character screen, select Characters. Type in a name for the character, and make sure it is of type Guard. Select Edit Default Script and enter the scripting commands Insoluble posted.

Then, you can just select your custom guard's name from the Customize Character screen if you need one.

[Last edited by bomber50 at 03-15-2016 05:02 AM]
03-15-2016 at 05:01 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
bomber50
Level: Smitemaster
Rank Points: 872
Registered: 09-18-2006
IP: Logged
icon Re: Changing the weapon the guard wields (0)  
Dragon Fogel wrote:
Actually, I think it's Else If that's new, Else was always there.

Also, Disappear may be generally better than End? I think that ensures the guards reappear if the room is uncleared again. (Using seeding beacons or creating a tar baby.) That is what Disappear does, right?

Disappear instead of End, allows the scripted guards to appear again if the player hits a seeding beacon inside the room after conquering it. Disappear's disadvantage is that the script always has to run every time you enter the room. It doesn't waste a lot of time, but if your hold doesn't have custom guards and seeding beacons in the same room, you might as well just use End and save the player a millisecond or two.

[Last edited by bomber50 at 03-15-2016 05:15 AM]
03-15-2016 at 05:14 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
IQubic
Level: Delver
Rank Points: 78
Registered: 11-22-2015
IP: Logged
icon Re: Changing the weapon the guard wields (0)  
I just need these guards in one room. I'm just using this room for testing purposes. I want to show off a graphical glitch that occurs in 5.1. This basically means that the room is not meant to be solved and there is no way to kill the guards.

What would be the best way to do this?

____________________________
119th Skywatcher
03-15-2016 at 05:35 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
Dragon Fogel
Level: Smitemaster
Rank Points: 2430
Registered: 06-21-2014
IP: Logged
icon Re: Changing the weapon the guard wields (+1)  
For my test holds, I just use:

Create character with type Guard
Set var _MyWeapon to the weapon I want (see Insoluble's list above)
Turn into monster

This turns the character into a guard with the desired weapon. Everything else mentioned is just for making it function properly if used in a regular room.
03-15-2016 at 05:42 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
IQubic
Level: Delver
Rank Points: 78
Registered: 11-22-2015
IP: Logged
icon Re: Changing the weapon the guard wields (0)  
Yeah, Dragon, I'll just do that.

____________________________
119th Skywatcher
03-15-2016 at 06:14 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 2668
Registered: 07-11-2014
IP: Logged
icon Re: Changing the weapon the guard wields (+1)  
bomber50 wrote:
If your room doesn't have any other monsters, you can place a seep or water skipper somewhere random. and then use Attack tile -> Kill to kill it on the first turn. This will allow the custom guards to show up.
Just a small note, use a spider instead. That way it won't show up in the room image or if you view the room from the mini map.
03-15-2016 at 06:59 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Insoluble
Level: Smitemaster
Avatar
Rank Points: 1638
Registered: 09-04-2014
IP: Logged
icon Re: Changing the weapon the guard wields (0)  
bomber50 wrote:
1. Imperative Required Target can be eliminated in the scripts (it becomes required target when turned into monster).

Oh cool! Thanks, I never knew that.

____________________________
Links to neat forum tools that I always have trouble finding:
Click here to view the secret text

03-15-2016 at 01:05 PM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Architecture : Changing the weapon the guard wields
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.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.