New probem (scroll down in thread)
Can I create static sprites once I walk into a screen and then save their locations, hardness, sequences and frames to map.dat?
I've been thinking if a randomized map is possible, that look different every time you play the game... So that when you enter the screen the first time it places all the sprites and then keeps them when I walk back...
I'd have to find a way to see if I'd already placed sprites on the screen too.. is there any variables bound to the screen?
I could also do it with one global, giving the screens numbers, so that when they add up the form a unique number, would be quite complicated though...
So what do you think? Is it possible?
(EDIT: if I attach the script that add the sprites to a sprite, and remove it permanently after it's filled the screen with sprites... that'd do the trick)
EDIT 2: Solved, kind of
new problem if you scroll down:
I've been thinking if a randomized map is possible, that look different every time you play the game... So that when you enter the screen the first time it places all the sprites and then keeps them when I walk back...
I'd have to find a way to see if I'd already placed sprites on the screen too.. is there any variables bound to the screen?
I could also do it with one global, giving the screens numbers, so that when they add up the form a unique number, would be quite complicated though...
So what do you think? Is it possible?
(EDIT: if I attach the script that add the sprites to a sprite, and remove it permanently after it's filled the screen with sprites... that'd do the trick)
EDIT 2: Solved, kind of
new problem if you scroll down:
Cool idea!
But I don't think it's possible.
The .dat files can have only one of each, AFAIK. Maybe using globals..?
And so on.

But I don't think it's possible.

if(&leg == 1) { sp_x(¤t_sprite ...);
And so on.
Hmm can't I give a sprite an sp_editor_num? D:
Well I guess the easy way out is placeing temp sprites in the editor that turn into other sprites and change location the first time you enter the screen...
Well I guess the easy way out is placeing temp sprites in the editor that turn into other sprites and change location the first time you enter the screen...
Yeah.. I know XD
Nah, I guess I'll settle with the simple way... thanks anyway doodler!
Nah, I guess I'll settle with the simple way... thanks anyway doodler!
Glad to be of assistance
and to take a break from I hate adults.


If you're planning on having many randomised screens and don't want to place the sprites, then you'll want to store the data (e.g. locations) for each screen in editor_num/seq/frame and attach a generic script to all screens that reads the editor_num/seq/frame to place/create the sprites in the saved positions. It'll be tricky depending on just how much you want to be random.
Editor_num/seq/frame allows you to save stuff across screen changes (and is saved in the save file) without using globals. But you can only access it on the relevant screen.
You just have to make sure using the editor_ stuff doesn't interfere. Note there doesn't have to be a sprite number X to use editor_seq(X,...)
If you want an example of this I had the enemies save their health if you left and returned to a screen in MouseDink (or maybe it was just the bonca, can't remember). I think that is similar to what you are asking. I could have had the health randomly chosen to begin with and the random choice would have been remembered upon leaving and re-entering the screen.
Editor_num/seq/frame allows you to save stuff across screen changes (and is saved in the save file) without using globals. But you can only access it on the relevant screen.
You just have to make sure using the editor_ stuff doesn't interfere. Note there doesn't have to be a sprite number X to use editor_seq(X,...)
If you want an example of this I had the enemies save their health if you left and returned to a screen in MouseDink (or maybe it was just the bonca, can't remember). I think that is similar to what you are asking. I could have had the health randomly chosen to begin with and the random choice would have been remembered upon leaving and re-entering the screen.
Oh... that's interesting stuff
I really should try storing variables like that some time.. But I think I'll just place the sprites...
Oh another problem
It seems like the sprite loses it's script if you change the editor sequence or frame :/
Is ti possible to keep that from happening?
If that didn't make any sense:
I want a sprite to change seq and frame and then stay that way, but keep the script, because I want to do other things to it if it's allready got the right frame/seq (when you re-enter the screen).

I really should try storing variables like that some time.. But I think I'll just place the sprites...
Oh another problem
It seems like the sprite loses it's script if you change the editor sequence or frame :/
Is ti possible to keep that from happening?
If that didn't make any sense:
I want a sprite to change seq and frame and then stay that way, but keep the script, because I want to do other things to it if it's allready got the right frame/seq (when you re-enter the screen).
That's really weird. I didn't know that happened. Are you sure the script is being removed, as opposed to the sprite being disabled somehow? I was hoping someone else would chime in because I had no idea that happened.
If it's just the script, you can get around it by re-setting all the sprite scripts in a script attached to the screen. Bit of a pain, but it would work. Find the sprites with get_brain (set them to a special non-used brain in the editor if you have to, you can always change it in scripts), then set the scripts maybe based on their seq on whatever you can get to identify the sprite.
If it's just the script, you can get around it by re-setting all the sprite scripts in a script attached to the screen. Bit of a pain, but it would work. Find the sprites with get_brain (set them to a special non-used brain in the editor if you have to, you can always change it in scripts), then set the scripts maybe based on their seq on whatever you can get to identify the sprite.
I have no idea why your scripts are getting reset
I have a few NPC scripts that change their editor_seq and frame and they stay functional just fine... Must be something else interfering there.

I have a few NPC scripts that change their editor_seq and frame and they stay functional just fine... Must be something else interfering there.
The thing is I have this dummy sprite with a script attachted that changes it seq and frame to a random house sprite. And then I change it's script to the hardboxer script to write the hardness for the house. But when I walk back to the screen it doesn't seem to run any script
Is there a way to write change the sprite defult script to hboxer.c after the first scipt's run once?
I guess I could move the hboxer-code to the house generating code.. but I'd get so messy!
(Yeah, I'm playing around with this again now when I have dink up and running on mac!
)

Is there a way to write change the sprite defult script to hboxer.c after the first scipt's run once?
I guess I could move the hboxer-code to the house generating code.. but I'd get so messy!
(Yeah, I'm playing around with this again now when I have dink up and running on mac!

You mean using editor_type? I thought that was the expected result. But I guess it's only "expected" after you know about it.
My suggestion is to leave editor_type alone, and just set editor_seq/frame. You can have to script check for this on future visits (by calling it with with a -1) and then make whatever changes are needed to the sprite.

THANK YOU!
I don't know why I used editor_type... I guess I thought I had to use all of them, I just copied it out of dinkCref and modified the values, hehe.
Now the scripts run in the right order each time i enter the screen.. but the hardboxer doesn't seem to add any spites ... I'll do some more bugtesting tomorrow and see if I can pinpoint where it goes worng.. too tierd now -_-
Thanks anyway, I feel like I'm on the right track now.
I don't know why I used editor_type... I guess I thought I had to use all of them, I just copied it out of dinkCref and modified the values, hehe.
Now the scripts run in the right order each time i enter the screen.. but the hardboxer doesn't seem to add any spites ... I'll do some more bugtesting tomorrow and see if I can pinpoint where it goes worng.. too tierd now -_-
Thanks anyway, I feel like I'm on the right track now.