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


Caravel Forum : DROD Boards : Architecture : Question about custom characters (It's about tilesets and scripting)
New Topic New Poll Post Reply
Poster Message
Camwoodstock
Level: Delver
Avatar
Rank Points: 32
Registered: 07-02-2014
IP: Logged
icon Question about custom characters (0)  
1. How exactly do I go about making tileset for a character? A basic template would be appreciated.

2. I'm trying to make a core script for one character class. It's going to do these things:
* Be required via imperitive
* Rotate clockwise every turn
* Once the room is cleared, it disappears, even if you already killed it, and it will never show up once you use it.
How would I go about scripting it to do these 3 things?

____________________________
Camwoodstock - The Epic Blunder, Dugan's Best Janitor, and Lowest Point Tourist
Mastered of Gunthro and the Epic Blunder! (postmastery complete!)
Mastered all of KDD 2.0!
Conquered TCB! (plenty o' secret rooms though!)

[Usually Camwoodstock | Reddit is Camwood7 | Wikia is Camwood777 | DashNet Forums is Cookiewoodstock]
12-21-2016 at 03:59 PM
View Profile Send Private Message to User Show all user's posts High Scores Quote Reply
Nuntar
Level: Smitemaster
Avatar
Rank Points: 2973
Registered: 02-20-2007
IP: Logged
icon Re: Question about custom characters (0)  
For a template, look in the "tiles" folder of the TSS Custom Elements Bonus Pack. It's a 176x22 image consisting of eight 22x22 tiles, corresponding to the character's facing in the following order: N, NE, E, SE, S, SW, W, NW.

For the script, copy the following and ctrl-shift-B to import it. Note that you should not check the "Visible" checkbox.
  If ... 
        Wait for clean room 
     End 
  If End 
  Appear 
  Imperative 3
Label loop
  Face direction clockwise
  Go to loop


____________________________
50th Skywatcher

[Last edited by Nuntar at 12-21-2016 04:23 PM]
12-21-2016 at 04:20 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Camwoodstock
Level: Delver
Avatar
Rank Points: 32
Registered: 07-02-2014
IP: Logged
icon Re: Question about custom characters (0)  
quote:
Nuntar wrote:
For a template, look in the "tiles" folder of the TSS Custom Elements Bonus Pack. It's a 176x22 image consisting of eight 22x22 tiles, corresponding to the character's facing in the following order: N, NE, E, SE, S, SW, W, NW.

For the script, copy the following and ctrl-shift-B to import it. Note that you should not check the "Visible" checkbox.
  If ... 
        Wait for clean room 
     End 
  If End 
  Appear 
  Imperative 3
Label loop
  Face direction clockwise
  Go to loop



Uh, thanks for the scripting part, but for the character sprite creation, and how it tells me to use a folder in the TSS Custom Elements Bonus Pack...

I don't have that...

(i play via steam and don't have TSS... yet)

____________________________
Camwoodstock - The Epic Blunder, Dugan's Best Janitor, and Lowest Point Tourist
Mastered of Gunthro and the Epic Blunder! (postmastery complete!)
Mastered all of KDD 2.0!
Conquered TCB! (plenty o' secret rooms though!)

[Usually Camwoodstock | Reddit is Camwood7 | Wikia is Camwood777 | DashNet Forums is Cookiewoodstock]

[Last edited by Camwoodstock at 12-22-2016 12:23 AM]
12-22-2016 at 12:22 AM
View Profile Send Private Message to User Show all user's posts High Scores Quote Reply
Xindaris
Level: Master Delver
Avatar
Rank Points: 276
Registered: 06-13-2015
IP: Logged

File: LaserReflection.PNG (445 bytes)
Downloaded 6 times.
License: Public Domain
icon Re: Question about custom characters (0)  
Ok, for help with custom tiles (which I assume is what you mean by sprites), I've attached something I made to this post, have a look. This image should be decently instructive:

-The grayish color that fills most of the image is interpreted by DROD as TRANSPARENT. So use that color for parts that should show what's under your character.
-The "spiky" part of each bit, where it's only 1-2 pixels wide, points in the direction the tile corresponds to, so you see it goes N, NE, E, SE, etc. on to NW.
-Each direction is a 22x22 pixels image all its own, and there are 8 directions, which adds up to 176x22. The tiles occur one after another with no border, so it may be helpful for you to temporarily place a line or pixel of white on the rightmost column of each 22x22 tile to help yourself see where one ends and the next starts while editing. If you want to have a "neutral" tile for some reason you can tack it on as another 22x22 on the far right of this image.
-If you want to animate, you can do it in one of two ways:
--LOOPING FRAMES: You add each successive frame of the animation from top to bottom, again in 22x22 squares. I think it supports up to 6 frames? In DROD you set the "animation speed" to tell it how fast to play those animations. If you have a bunch of the same character facing the same direction in the room they'll all have the same animation frame playing at the same time, and whether or not that's desirable depends on your intended use.
--RANDOM FRAMES: You add just one more frame to the second row of each direction and it will randomly display that one instead of the top one. Then there's a bunch of stuff that really only applies to sworded characters and I've never used it so I direct your attention to the F1 DROD help file for that. Not setting an animation speed (leaving it 0 I think) defaults to this option.

You also have the option of doing just 1 22x22 tile as your image, which it will interpret as applying to all directions.

____________________________
109th Skywatcher

Here are some links to Things!
Click here to view the secret text


[Last edited by Xindaris at 12-22-2016 01:47 AM]
12-22-2016 at 01:31 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Camwoodstock
Level: Delver
Avatar
Rank Points: 32
Registered: 07-02-2014
IP: Logged
icon Re: Question about custom characters (0)  
quote:
Xindaris wrote:
Ok, for help with custom tiles (which I assume is what you mean by sprites), I've attached something I made to this post, have a look. This image should be decently instructive:

-The grayish color that fills most of the image is interpreted by DROD as TRANSPARENT. So use that color for parts that should show what's under your character.
-The "spiky" part of each bit, where it's only 1-2 pixels wide, points in the direction the tile corresponds to, so you see it goes N, NE, E, SE, etc. on to NW.
-Each direction is a 22x22 pixels image all its own, and there are 8 directions, which adds up to 176x22. The tiles occur one after another with no border, so it may be helpful for you to temporarily place a line or pixel of white on the rightmost column of each 22x22 tile to help yourself see where one ends and the next starts while editing. If you want to have a "neutral" tile for some reason you can tack it on as another 22x22 on the far right of this image.
-If you want to animate, you can do it in one of two ways:
--LOOPING FRAMES: You add each successive frame of the animation from top to bottom, again in 22x22 squares. I think it supports up to 6 frames? In DROD you set the "animation speed" to tell it how fast to play those animations. If you have a bunch of the same character facing the same direction in the room they'll all have the same animation frame playing at the same time, and whether or not that's desirable depends on your intended use.
--RANDOM FRAMES: You add just one more frame to the second row of each direction and it will randomly display that one instead of the top one. Then there's a bunch of stuff that really only applies to sworded characters and I've never used it so I direct your attention to the F1 DROD help file for that. Not setting an animation speed (leaving it 0 I think) defaults to this option.

You also have the option of doing just 1 22x22 tile as your image, which it will interpret as applying to all directions.


What exactly is defined as the "spiky bit"? Does it matter if I edit it at all? What parts of it are absolutely necessary? Is that the red triangle thing?

____________________________
Camwoodstock - The Epic Blunder, Dugan's Best Janitor, and Lowest Point Tourist
Mastered of Gunthro and the Epic Blunder! (postmastery complete!)
Mastered all of KDD 2.0!
Conquered TCB! (plenty o' secret rooms though!)

[Usually Camwoodstock | Reddit is Camwood7 | Wikia is Camwood777 | DashNet Forums is Cookiewoodstock]
12-22-2016 at 03:24 AM
View Profile Send Private Message to User Show all user's posts High Scores Quote Reply
Xindaris
Level: Master Delver
Avatar
Rank Points: 276
Registered: 06-13-2015
IP: Logged

File: GravBlock.PNG (1.3 KB)
Downloaded 3 times.
License: Public Domain
icon Re: Question about custom characters (0)  
The image wasn't made specially for demonstration, it's just something from a project of mine. The way the triangle is pointing is what I'm referring to as the spiky bit. My intention was to give you something to start with for making your own tiles for a character; feel free to edit it in paint or equivalent pixel-capable editor as you like. If you were to import that file directly as a character's tileset and give the character a script that makes it turn clockwise each turn or something like that you'll probably pick up what I'm talking about a bit faster.

I'm not sure what you mean by absolutely necessary; DROD will take any 1, 8, or 9 22x22 tiles arranged in a row like that as the character's tiles. It might take other numbers but I'm not sure what would correspond to the "missing" orientations in that case.

Actually, maybe what I've attached here will be more helpful. It's the tileset for the GravBlock, a custom element of mine. The arrow points in exactly the direction it moves; this character has the "random" animation behavior so it occasionally "displays static on its screen" instead of the usual arrow.

____________________________
109th Skywatcher

Here are some links to Things!
Click here to view the secret text


[Last edited by Xindaris at 12-22-2016 05:31 AM]
12-22-2016 at 05:29 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Camwoodstock
Level: Delver
Avatar
Rank Points: 32
Registered: 07-02-2014
IP: Logged
icon Re: Question about custom characters (0)  
I'll try that, but... The scripting seems to be acting up; it doesn't rotate, and it disappears by default. It's also not required. But the script for the specific object just works just fine.

Y'see, I'm trying to make a "spawn beacon" of sorts. Required to destroy, and it spawns enemies at specific coordinates every 15 turns. So... It being invisible, unable to be harmed, with the script not working, as it also manages to always unclear the room... Yeah, I fear this is broken. It doesn't even rotate properly.

I think it may involve how I script these objects also relying on a label/goto loop, but I'm not sure. Yes, I did set them to all disappear.

____________________________
Camwoodstock - The Epic Blunder, Dugan's Best Janitor, and Lowest Point Tourist
Mastered of Gunthro and the Epic Blunder! (postmastery complete!)
Mastered all of KDD 2.0!
Conquered TCB! (plenty o' secret rooms though!)

[Usually Camwoodstock | Reddit is Camwood7 | Wikia is Camwood777 | DashNet Forums is Cookiewoodstock]
12-22-2016 at 03:57 PM
View Profile Send Private Message to User Show all user's posts High Scores Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 1306
Registered: 07-11-2014
IP: Logged
icon Re: Question about custom characters (0)  
Post your script here (Ctrl+A to select it all, then Ctrl + B to copy to clipboard).

____________________________
(07:23 PM) Pearls: Kieran is correct.
12-22-2016 at 05:05 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Camwoodstock
Level: Delver
Avatar
Rank Points: 32
Registered: 07-02-2014
IP: Logged
icon Re: Question about custom characters (0)  
quote:
kieranmillar wrote:
Post your script here (Ctrl+A to select it all, then Ctrl + B to copy to clipboard).


Most them resemble this format:

Label Spawn
  Wait 15
  Generate entity Roach queen,7,7,South
  GoSub Spawn


Set to visible OR invisible, the character script doesn't like working.

____________________________
Camwoodstock - The Epic Blunder, Dugan's Best Janitor, and Lowest Point Tourist
Mastered of Gunthro and the Epic Blunder! (postmastery complete!)
Mastered all of KDD 2.0!
Conquered TCB! (plenty o' secret rooms though!)

[Usually Camwoodstock | Reddit is Camwood7 | Wikia is Camwood777 | DashNet Forums is Cookiewoodstock]
12-22-2016 at 10:47 PM
View Profile Send Private Message to User Show all user's posts High Scores Quote Reply
Xindaris
Level: Master Delver
Avatar
Rank Points: 276
Registered: 06-13-2015
IP: Logged
icon Re: Question about custom characters (0)  
I don't get the impression that that's your entire script, and it's hard to have any clue what the problem could be without seeing at least a decent chunk of it. Maybe you could just upload a sample hold with one room containing the thing you're trying to script.

My guesses based on your description of the symptoms include the entity not appearing because you didn't put a non-custom monster in the room to make it not yet cleared on turn 0, the script having an "infinite loop within 1 turn" which DROD does not like, or some other kind of misunderstanding of how DRODscript works.

____________________________
109th Skywatcher

Here are some links to Things!
Click here to view the secret text


[Last edited by Xindaris at 12-22-2016 11:25 PM]
12-22-2016 at 11:24 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Camwoodstock
Level: Delver
Avatar
Rank Points: 32
Registered: 07-02-2014
IP: Logged

File: Spawn Beacon Debugging.hold (3.7 KB)
Downloaded 2 times.
License: Public Domain
icon Re: Question about custom characters (0)  
quote:
Xindaris wrote:
I don't get the impression that that's your entire script, and it's hard to have any clue what the problem could be without seeing at least a decent chunk of it. Maybe you could just upload a sample hold with one room containing the thing you're trying to script.

My guesses based on your description of the symptoms include the entity not appearing because you didn't put a non-custom monster in the room to make it not yet cleared on turn 0, the script having an "infinite loop within 1 turn" which DROD does not like, or some other kind of misunderstanding of how DRODscript works.


What I sent in that post was an example script of how specific instances of the enemy are scripted.

However, what I sent HERE is another story; open to everyone, this hold should be a good tool in debugging these things. Hopefully someone can find the issue.

____________________________
Camwoodstock - The Epic Blunder, Dugan's Best Janitor, and Lowest Point Tourist
Mastered of Gunthro and the Epic Blunder! (postmastery complete!)
Mastered all of KDD 2.0!
Conquered TCB! (plenty o' secret rooms though!)

[Usually Camwoodstock | Reddit is Camwood7 | Wikia is Camwood777 | DashNet Forums is Cookiewoodstock]
12-22-2016 at 11:47 PM
View Profile Send Private Message to User Show all user's posts High Scores Quote Reply
Lucky Luc
Level: Smitemaster
Avatar
Rank Points: 961
Registered: 08-19-2012
IP: Logged
icon Re: Question about custom characters (+2)  
Right now, the only thing you're telling your script to do is to spawn a monster every 15 turns. It won't ever do those other fancy things unless you're telling it to.

Nuntar's script already solves a lot of your problems, though you'll need to make slight adjustments to make it work for your purposes. You can just copy it as it is and paste it into DROD with Ctrl+Shift+B.

Here's a breakdown of how Nuntar's script tackles your questions:

- Make the character a required target:
This is simple. Just add the script command "Imperative Required target" before the main loop of your script. After "exporting" it from DROD, it will only show up as "Imperative 3", but that's basically the same thing.

- Make the character not appear if the room is in a cleared state:
The simple approach here is to check whether the room is in a cleared state to begin with and end the script if that's the case. This can however run into problems with seeding beacons, so if you plan to use them, it might be the better options to just skip to the end of the script with another goto if the room is cleared. Also note that this kind of setup always requires at least one regular monster in your room (which you can kill on turn 0 if you wish to, though). Note that you'll have to uncheck "visible" in the scripting dialogue or add an "Disappear" after the skip label if you want it to work properly.

- Make the character rotate every turn:
That's Nuntar's main loop. An elegant way to combine this with your main loop is to add a counter variable which increments every turn. If it hits 15, generate a roach and reset it to 0. Note that in my script, I named the variable ".Counter", starting with a . to make it private, i. e. only accessible by the character initializing it. Not really necessary in this case, but a good practice if you know that your variable doesn't need to be global.

So here's a reworked version of Nuntar's script which should hopefully do what you want it to do (again, use Ctrl+Shift+B to paste it into DROD):

Click here to view the secret text

12-23-2016 at 12:20 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Camwoodstock
Level: Delver
Avatar
Rank Points: 32
Registered: 07-02-2014
IP: Logged
icon Re: Question about custom characters (0)  
quote:
Lucky Luc wrote:
Right now, the only thing you're telling your script to do is to spawn a monster every 15 turns. It won't ever do those other fancy things unless you're telling it to.

Nuntar's script already solves a lot of your problems, though you'll need to make slight adjustments to make it work for your purposes. You can just copy it as it is and paste it into DROD with Ctrl+Shift+B.

Here's a breakdown of how Nuntar's script tackles your questions:

- Make the character a required target:
This is simple. Just add the script command "Imperative Required target" before the main loop of your script. After "exporting" it from DROD, it will only show up as "Imperative 3", but that's basically the same thing.

- Make the character not appear if the room is in a cleared state:
The simple approach here is to check whether the room is in a cleared state to begin with and end the script if that's the case. This can however run into problems with seeding beacons, so if you plan to use them, it might be the better options to just skip to the end of the script with another goto if the room is cleared. Also note that this kind of setup always requires at least one regular monster in your room (which you can kill on turn 0 if you wish to, though). Note that you'll have to uncheck "visible" in the scripting dialogue or add an "Disappear" after the skip label if you want it to work properly.

- Make the character rotate every turn:
That's Nuntar's main loop. An elegant way to combine this with your main loop is to add a counter variable which increments every turn. If it hits 15, generate a roach and reset it to 0. Note that in my script, I named the variable ".Counter", starting with a . to make it private, i. e. only accessible by the character initializing it. Not really necessary in this case, but a good practice if you know that your variable doesn't need to be global.

So here's a reworked version of Nuntar's script which should hopefully do what you want it to do (again, use Ctrl+Shift+B to paste it into DROD):

Click here to view the secret text



I... Think there's a bit of a disconnect here. I put Nuntar's script as the default script for the Character type, the Spawn Beacon. That way, I wouldn't have to script complicated things, and just have it part of the character script, while I could leave the enemy generation to the specific NPC's scripting.

____________________________
Camwoodstock - The Epic Blunder, Dugan's Best Janitor, and Lowest Point Tourist
Mastered of Gunthro and the Epic Blunder! (postmastery complete!)
Mastered all of KDD 2.0!
Conquered TCB! (plenty o' secret rooms though!)

[Usually Camwoodstock | Reddit is Camwood7 | Wikia is Camwood777 | DashNet Forums is Cookiewoodstock]

[Last edited by Camwoodstock at 12-23-2016 12:53 AM]
12-23-2016 at 12:46 AM
View Profile Send Private Message to User Show all user's posts High Scores Quote Reply
Xindaris
Level: Master Delver
Avatar
Rank Points: 276
Registered: 06-13-2015
IP: Logged
icon Re: Question about custom characters (+2)  
That's now how default script works.

-If you want every character that looks a certain way to have the same script, you set that script as the default script of that character type and put down characters, set their type to that character, and do not put any commands in the individual characters. Any commands in an individual character will make the character only run its individual commands and not any of the default ones.
-If you want each individual to have a totally different script, you put commands into the individual members of the character type.

If you have some simple formula for where the spawning beacon thing should place a roach queen relative to its own location (like "2 tiles east of myself" or whatever) you're looking at a basic myscript problem. If they each have some wildly different location they're supposed to put the queen and you ever want to have more than one in the same room you've got no choice but to set each one up completely individually, but you can at least copy-paste the scripts with ctrl+b, ctrl+shift+b.

____________________________
109th Skywatcher

Here are some links to Things!
Click here to view the secret text


[Last edited by Xindaris at 12-23-2016 02:51 AM]
12-23-2016 at 02:47 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Camwoodstock
Level: Delver
Avatar
Rank Points: 32
Registered: 07-02-2014
IP: Logged
icon Re: Question about custom characters (0)  
quote:
Xindaris wrote:
That's now how default script works.

-If you want every character that looks a certain way to have the same script, you set that script as the default script of that character type and put down characters, set their type to that character, and do not put any commands in the individual characters. Any commands in an individual character will make the character only run its individual commands and not any of the default ones.
-If you want each individual to have a totally different script, you put commands into the individual members of the character type.

If you have some simple formula for where the spawning beacon thing should place a roach queen relative to its own location (like "2 tiles east of myself" or whatever) you're looking at a basic myscript problem. If they each have some wildly different location they're supposed to put the queen and you ever want to have more than one in the same room you've got no choice but to set each one up completely individually, but you can at least copy-paste the scripts with ctrl+b, ctrl+shift+b.


Ah, my mistake.

While I'm at it, I'm having issues with scripts for another concept, "Warp Tiles." Which are basically... What they sound like, they teleport you a Landing Tile specified in the script. In addition, they play a custom sound effect.

However, in their current state, they only work once until you leave the room and come back. Everything works... But it only works once for the room you're in. I get the feeling it's glaringly obvious, but can someone help?

Note this is just a regular invisible NPC, there's no voodoo magic involving a character class in this case.

  Wait for entity Player 2,28,2,28
  Teleport Player to 17,12
  Speech "",Normal,Self,0,WarpTile_warp.wav


____________________________
Camwoodstock - The Epic Blunder, Dugan's Best Janitor, and Lowest Point Tourist
Mastered of Gunthro and the Epic Blunder! (postmastery complete!)
Mastered all of KDD 2.0!
Conquered TCB! (plenty o' secret rooms though!)

[Usually Camwoodstock | Reddit is Camwood7 | Wikia is Camwood777 | DashNet Forums is Cookiewoodstock]
12-26-2016 at 03:34 AM
View Profile Send Private Message to User Show all user's posts High Scores Quote Reply
Xindaris
Level: Master Delver
Avatar
Rank Points: 276
Registered: 06-13-2015
IP: Logged
icon Re: Question about custom characters (+1)  
You need to enclose the commands in a loop, just Label Loop at the start and Goto Loop at the end. Otherwise it runs the script one time and then says "welp, I'm done" until the room is reset by the player leaving and entering.

Usually for things that should only happen once per turn a loop should also have a Wait 0 at the end to ensure it doesn't try to run infinitely many times in the turn, which just causes DROD to kill off the script entirely. In this case it's fine since the "Wait for player at" command at the start of the loop won't find the player at the tile since he was just teleported away. I'm mentioning this because it's a pretty common way for something that looks perfectly functional to just not work at all.

____________________________
109th Skywatcher

Here are some links to Things!
Click here to view the secret text


[Last edited by Xindaris at 12-26-2016 03:49 AM]
12-26-2016 at 03:40 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Camwoodstock
Level: Delver
Avatar
Rank Points: 32
Registered: 07-02-2014
IP: Logged
icon Re: Question about custom characters (0)  
Again, figured I'd re-use this thread for another question.

What about making the character hold a custom weapon? Is that do-able?

____________________________
Camwoodstock - The Epic Blunder, Dugan's Best Janitor, and Lowest Point Tourist
Mastered of Gunthro and the Epic Blunder! (postmastery complete!)
Mastered all of KDD 2.0!
Conquered TCB! (plenty o' secret rooms though!)

[Usually Camwoodstock | Reddit is Camwood7 | Wikia is Camwood777 | DashNet Forums is Cookiewoodstock]
01-15-2017 at 05:15 PM
View Profile Send Private Message to User Show all user's posts High Scores Quote Reply
Camwoodstock
Level: Delver
Avatar
Rank Points: 32
Registered: 07-02-2014
IP: Logged
icon Re: Question about custom characters (0)  
quote:
Camwoodstock wrote:
Again, figured I'd re-use this thread for another question.

What about making the character hold a custom weapon? Is that do-able?


I still need help with this one, but while I'm at it... What about this?

I'm trying to script it so, before a cutscene's dialogue is played, beethro looks NW. This is for the sake of part of the cutscene. However... If I use the script I have set up, if Beethro faces ANYWHERE but north, he kinda jitters, faces east, then west, then northwest. How would I fix that?

I cut out all the actual cutscene-related things. The only bit is related to the rotation sequence. If things execute properly, Beethro should say "doy" and it should end.

  Wait for entity Player 16,22,16,22
  Cut scene 333
  Wait 5
Label rotate
  If ... 
        Wait until var "_O" != 0
     If ... 
           Wait until var "_O" = 5
        Set var "_O" - 2
        Wait 1
        Go to rotate
     Else If 
           Wait until var "_O" = 3
        Set var "_O" - 3
        Wait 1
        Go to rotate
     Else 
        Set var "_O" - 1
        Wait 1
        Go to rotate
     If End 
  Else 
     Wait 1
     Go to scene
Label scene
     Speech "doy",Aggressive,Player,0,.
     Wait 3
     Cut scene 0


____________________________
Camwoodstock - The Epic Blunder, Dugan's Best Janitor, and Lowest Point Tourist
Mastered of Gunthro and the Epic Blunder! (postmastery complete!)
Mastered all of KDD 2.0!
Conquered TCB! (plenty o' secret rooms though!)

[Usually Camwoodstock | Reddit is Camwood7 | Wikia is Camwood777 | DashNet Forums is Cookiewoodstock]
03-07-2017 at 03:29 PM
View Profile Send Private Message to User Show all user's posts High Scores Quote Reply
Xindaris
Level: Master Delver
Avatar
Rank Points: 276
Registered: 06-13-2015
IP: Logged
icon Re: Question about custom characters (0)  
I would probably use Wait 0's instead of Wait 1's, but that choice isn't terribly important. Jittering sounds like the wait commands aren't going through properly, which may be myscript shenanigans outside of the section of script in view here.

I can't see anything in the posted section of script that should cause it to do anything but go straight to "scene" if Beethro is already facing NW.

The if _O = 5 section appears to be attempting to set the orientation to 3, which means it checks if Beethro is facing EAST and then if he is, instantly turns him WEST. Which looks pretty weird.

The if _O = 3 section is checking if Beethro is facing WEST and, if he is, sets his orientation to NW. Seems normal enough.

The Else section following those will make the following orientation changes:
NE --> NORTH --> NW
SE --> SOUTH --> SW --> EAST(!)
The last of those changes seems unintended if your goal is to make Beethro "naturally" turn all the way around as he would if the player needed him to be facing NW for some reason.

My inclination would be to deal with every possible non-NW orientation (that is, 1 2 3 5 6 7 8 = N NE W E SW S SE) as a separate case, and setting _O to exactly the next thing I wanted it to be in each of those 7 cases instead of trying to use subtraction from the earlier value of _O to make it happen. Probably I would do something like
SE --> S --> SW --> W --> NW
and separately,
E --> NE --> N --> NW

____________________________
109th Skywatcher

Here are some links to Things!
Click here to view the secret text


[Last edited by Xindaris at 03-07-2017 03:48 PM]
03-07-2017 at 03:45 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Camwoodstock
Level: Delver
Avatar
Rank Points: 32
Registered: 07-02-2014
IP: Logged
icon Re: Question about custom characters (0)  
quote:
Xindaris wrote:
I would probably use Wait 0's instead of Wait 1's, but that choice isn't terribly important. Jittering sounds like the wait commands aren't going through properly, which may be myscript shenanigans outside of the section of script in view here.

I can't see anything in the posted section of script that should cause it to do anything but go straight to "scene" if Beethro is already facing NW.

The if _O = 5 section appears to be attempting to set the orientation to 3, which means it checks if Beethro is facing EAST and then if he is, instantly turns him WEST. Which looks pretty weird.

The if _O = 3 section is checking if Beethro is facing WEST and, if he is, sets his orientation to NW. Seems normal enough.

The Else section following those will make the following orientation changes:
NE --> NORTH --> NW
SE --> SOUTH --> SW --> EAST(!)
The last of those changes seems unintended if your goal is to make Beethro "naturally" turn all the way around as he would if the player needed him to be facing NW for some reason.

My inclination would be to deal with every possible non-NW orientation (that is, 1 2 3 5 6 7 8 = N NE W E SW S SE) as a separate case, and setting _O to exactly the next thing I wanted it to be in each of those 7 cases instead of trying to use subtraction from the earlier value of _O to make it happen. Probably I would do something like
SE --> S --> SW --> W --> NW
and separately,
E --> NE --> N --> NW


I set the _O = 5 to _O = 3 because, from what I was told on the chat, 4 is basically a pitfall; it's a "no-direction" setting. IIRC it breaks the script forever to not do so.

The setting for _O = 3 was set to make sure it did make the smooth transition.

In addition, the numbers aren't clockwise. It's 0-2 for NW/N/NE, then 3-5 for W,NODIR,E, and then 6-8 for SE,S,SW. It's not a matter of numbers being the clockwise, they're similar to how they work on the numpad.

Basically, I'm trying to look for a compact way to set up the script so I can, indeed, set it so Beethro will look NW in a natrual way that follows if you used the rotate CW/CCW keys.

____________________________
Camwoodstock - The Epic Blunder, Dugan's Best Janitor, and Lowest Point Tourist
Mastered of Gunthro and the Epic Blunder! (postmastery complete!)
Mastered all of KDD 2.0!
Conquered TCB! (plenty o' secret rooms though!)

[Usually Camwoodstock | Reddit is Camwood7 | Wikia is Camwood777 | DashNet Forums is Cookiewoodstock]

[Last edited by Camwoodstock at 03-07-2017 07:08 PM]
03-07-2017 at 07:05 PM
View Profile Send Private Message to User Show all user's posts High Scores Quote Reply
Xindaris
Level: Master Delver
Avatar
Rank Points: 276
Registered: 06-13-2015
IP: Logged
icon Re: Question about custom characters (0)  
I'm well aware the numbers are not arranged in a clockwise or counter-clockwise manner. Going straight from 5 to 3 makes absolutely no sense for a natural turning behavior; the only valid turns the player would have are from 5 (EAST) are 2 (NE) or 8 (SE), the former of which is what you want in order to approach NW.

There's really no need to worry about compactness here, but if you really want to then what you should do is change the command in the 5 (EAST) case to go to 2 rather than 3, and add a case for when O is 6 (SW) case so that it goes to 3 (WEST) rather than 5 (EAST) as it currently does.

I would also, for clarity's sake, change ALL of the cases besides the last one so that they SET (use =) _O to the target number rather than subtracting (-) something off. Only the "leftover cases" should really be bothering to change _O by subtraction.

____________________________
109th Skywatcher

Here are some links to Things!
Click here to view the secret text


[Last edited by Xindaris at 03-08-2017 03:22 AM]
03-08-2017 at 03:18 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Camwoodstock
Level: Delver
Avatar
Rank Points: 32
Registered: 07-02-2014
IP: Logged
icon Re: Question about custom characters (0)  
Figures I'd recycle this thread (for +10% eco-friendliness!) to ask another question;

Can I make a scripted NPC Character with the appearance of a citizen be scripted to appear a certain color, irregardless of relay stations near by?

____________________________
Camwoodstock - The Epic Blunder, Dugan's Best Janitor, and Lowest Point Tourist
Mastered of Gunthro and the Epic Blunder! (postmastery complete!)
Mastered all of KDD 2.0!
Conquered TCB! (plenty o' secret rooms though!)

[Usually Camwoodstock | Reddit is Camwood7 | Wikia is Camwood777 | DashNet Forums is Cookiewoodstock]
04-07-2017 at 12:55 AM
View Profile Send Private Message to User Show all user's posts High Scores Quote Reply
averagemoe
Level: Delver
Avatar
Rank Points: 67
Registered: 03-22-2012
IP: Logged
icon Re: Question about custom characters (0)  
You'd have to make a custom tile set for that. I suggest setting up some image floor that's the exact shade of grey the engine flags for transparency, and getting a screenshot of some real citizens of the desired color facing all 8 directions on said floor. Then it's only a matter of editing the image to get them in the right order.

____________________________
The only right way to make DROD into a movie is to have it be animated in the style that Erik draws the characters in.
04-07-2017 at 04:05 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
Camwoodstock
Level: Delver
Avatar
Rank Points: 32
Registered: 07-02-2014
IP: Logged

File: MelindaTiles.zip (37 KB)
Downloaded 2 times.
License: Public Domain
icon Re: Question about custom characters (0)  
quote:
averagemoe wrote:
You'd have to make a custom tile set for that. I suggest setting up some image floor that's the exact shade of grey the engine flags for transparency, and getting a screenshot of some real citizens of the desired color facing all 8 directions on said floor. Then it's only a matter of editing the image to get them in the right order.

Ah. That'd make sense.

...in more confusing situations, though, I'm working on a custom tileset (for funsies, not 100% if i'll release it) yet I'm having an issue getting it recognized by the DROD engine.

Y'see, I'm not sure if it's an issue with the images, or, what, but it just will not load the style. I added the strings to DROD's data file, yet, nothing.

Attached is a .ZIP file with all of the relevant bitmaps, and the "Tiles" .TIM file. In addition, here's the music strings I attempted to input in drod.ini:

Click here to view the secret text


____________________________
Camwoodstock - The Epic Blunder, Dugan's Best Janitor, and Lowest Point Tourist
Mastered of Gunthro and the Epic Blunder! (postmastery complete!)
Mastered all of KDD 2.0!
Conquered TCB! (plenty o' secret rooms though!)

[Usually Camwoodstock | Reddit is Camwood7 | Wikia is Camwood777 | DashNet Forums is Cookiewoodstock]

[Last edited by Camwoodstock at 04-11-2017 03:26 AM]
04-11-2017 at 03:24 AM
View Profile Send Private Message to User Show all user's posts High Scores Quote Reply
Camwoodstock
Level: Delver
Avatar
Rank Points: 32
Registered: 07-02-2014
IP: Logged
icon Re: Question about custom characters (0)  
quote:
Camwoodstock wrote:
quote:
averagemoe wrote:
You'd have to make a custom tile set for that. I suggest setting up some image floor that's the exact shade of grey the engine flags for transparency, and getting a screenshot of some real citizens of the desired color facing all 8 directions on said floor. Then it's only a matter of editing the image to get them in the right order.

Ah. That'd make sense.

...in more confusing situations, though, I'm working on a custom tileset (for funsies, not 100% if i'll release it) yet I'm having an issue getting it recognized by the DROD engine.

Y'see, I'm not sure if it's an issue with the images, or, what, but it just will not load the style. I added the strings to DROD's data file, yet, nothing.

Attached is a .ZIP file with all of the relevant bitmaps, and the "Tiles" .TIM file. In addition, here's the music strings I attempted to input in drod.ini:

Click here to view the secret text



...Help?

____________________________
Camwoodstock - The Epic Blunder, Dugan's Best Janitor, and Lowest Point Tourist
Mastered of Gunthro and the Epic Blunder! (postmastery complete!)
Mastered all of KDD 2.0!
Conquered TCB! (plenty o' secret rooms though!)

[Usually Camwoodstock | Reddit is Camwood7 | Wikia is Camwood777 | DashNet Forums is Cookiewoodstock]
04-16-2017 at 06:39 AM
View Profile Send Private Message to User Show all user's posts High Scores Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Architecture : Question about custom characters (It's about tilesets and scripting)
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.