...When I lose control...
Now I have one BIG problem here. My DinkEdit takes no effect whatever I do. I first time noticed this on the As always... Problems thread when I tried to change my dark blue man to green man. Didn't work. Now I realized that my editor is just plain inefficient. No changes have been made to the game...
Whoa, nice. It works. But I cannot attach a script to any sprites.
But I cannot attach a script to any sprites.
Odd. If you select a sprite, then right-click and select properties, it should work.
Odd. If you select a sprite, then right-click and select properties, it should work.
I'm using WinDinkEdit... And I'm also doing everything DuckLord advised me to. I checked if I really wrote the things correctly at least 3 times. (By the way... I'm not kinda used to WinDinkEdit, is the regular DinkEdit possible?)
Sure, you can use DinkEdit to attach scripts. And I think that the problem you have isn't with the editor at all, it's rather something like script in the wrong place, wrong format or a scripting error. I mean, how do you know that the script isn't attached?
Or you did something wrong when firing up your DMOD in the editor. It's advisable to fire up DinkEdit with the help of a frontend (probably DFArc2), WinDinkEdit is slightly easier at that.
Or you did something wrong when firing up your DMOD in the editor. It's advisable to fire up DinkEdit with the help of a frontend (probably DFArc2), WinDinkEdit is slightly easier at that.
Well. The script might be attached... somehow, but the only effect it takes os like this:
I walk next to the shelf (the sprite) and press spacebar.
Normally, if a script wasn't attached, Dink would say "Not much happening here" or something like that.
However, my Dink says nothing.
It's not a scripting error, that's for sure... Or wait... maybe... I just can't think of any script that could be wrong.
I walk next to the shelf (the sprite) and press spacebar.
Normally, if a script wasn't attached, Dink would say "Not much happening here" or something like that.
However, my Dink says nothing.
It's not a scripting error, that's for sure... Or wait... maybe... I just can't think of any script that could be wrong.
If he says nothing there must be a script attached. So it must be a scripting error. Show us your script if you can't find out what it is.
Ookay...
void talk( void )
{
freeze(1)
say_stop("**** *** **** * *** *****, ***'** **** ** *** ******* ***** **.", 1);
say_stop("**** ** **** *****, ******* *** ****** *****.", 1);
unfreeze(1)
}
void hit( void )
{
say("******* ***** ****** ***** **** ***** *****, ***!!", 1);
}
void push( void )
{
say("**** **** **** ** ** ** * **** **...", 1);
}
void talk( void )
{
freeze(1)
say_stop("**** *** **** * *** *****, ***'** **** ** *** ******* ***** **.", 1);
say_stop("**** ** **** *****, ******* *** ****** *****.", 1);
unfreeze(1)
}
void hit( void )
{
say("******* ***** ****** ***** **** ***** *****, ***!!", 1);
}
void push( void )
{
say("**** **** **** ** ** ** * **** **...", 1);
}
There's nothing wrong with it... Maybe if you tell exactly what you did.
There are a few things wrong with it. You don't have a void main(void) part, and your freeze lines lack semicolons.
EDIT : Okay, try adding this :
void main(void)
{
sp_touch_damage(¤t_sprite, -1);
}
EDIT : Okay, try adding this :
void main(void)
{
sp_touch_damage(¤t_sprite, -1);
}
But the script Vukodlak uses just works! And why do you need ; behind freeze I always use it but it also works without it it apears to be. And why would the void main(void) part make it work better?
(I think I realy should read some more in my C manual.)
(I think I realy should read some more in my C manual.)
But the script Vukodlak uses just works!
Not always. It depends on the sprite and on said sprite's properties.
And why do you need ; behind freeze I always use it but it also works without it it apears to be. And why would the void main(void) part make it work better?
Forgetting the ';' sometimes makes the game do odd things, although it's quite rare.
EDIT : The same goes for void main(void).
Not always. It depends on the sprite and on said sprite's properties.
And why do you need ; behind freeze I always use it but it also works without it it apears to be. And why would the void main(void) part make it work better?
Forgetting the ';' sometimes makes the game do odd things, although it's quite rare.
EDIT : The same goes for void main(void).
I hate to say "Didn't work" as I have said it sooo veeery many times...
Anyways - This is what I exactly did:
1. I created the shelf sprite.
2. I right-clicked on it.
3. I selected Properties.
4. I wrote "shelve2" on the script box.
5. I did not bother pressing the "edit" button next to the box, as it has never worked to me, it doesn't create a C-file at all. But please don't try to fix this, as it really isn't the problem.
6. I created a C-file into my D-Mod directory called "shelve2".
7. I wrote the script shown above.
8. I played the D-Mod.
9. I walked next to the shelf, pressed spacebar without any text appearing.
10. I added my second post in this topic.
Help meeeeee
Anyways - This is what I exactly did:
1. I created the shelf sprite.
2. I right-clicked on it.
3. I selected Properties.
4. I wrote "shelve2" on the script box.
5. I did not bother pressing the "edit" button next to the box, as it has never worked to me, it doesn't create a C-file at all. But please don't try to fix this, as it really isn't the problem.
6. I created a C-file into my D-Mod directory called "shelve2".
7. I wrote the script shown above.
8. I played the D-Mod.
9. I walked next to the shelf, pressed spacebar without any text appearing.
10. I added my second post in this topic.
Help meeeeee
Try checking whether you have a file extension problem, like last time. You may have a 'shelve2.c' file which is actually a txt file. Or a c.c file, or something like that. If it still doesn't work, you could try sending me the shelve2 file, I'll look into it if I can.
The lack of void main() has no bearing on the working of the script. I don't know if the missing ";"s could cause complications, I guess it's best to add them when something doesn't work to rule that possibility out.
Well then what is it? A file can exist without an extension but you should have .c to let the game recognize the file as a script.
Oh? I realized it so DuckLord told me I don't need them some time ago, so I deleted every .c extension.
You shouldn't have a file.c.c extension or a file.c.txt extension. (the first one should work when typing file.c in the scriptattachement box(If I'm correct), the latter one won't work at all)
You should have a .c extension though, it's just that windows hides known extensions by default, so when having a 'file.txt' file windows just calls the file 'file'. So when you type 'file.c' the .c part isn't really the extension, the extension is still .txt.
If you're having trouble with extensions there is a much easier way to handle it. Just copy any .c file from another DMOD, change the name and you're done. No need to struggle with extensions. I always do it that way.
You should have a .c extension though, it's just that windows hides known extensions by default, so when having a 'file.txt' file windows just calls the file 'file'. So when you type 'file.c' the .c part isn't really the extension, the extension is still .txt.
If you're having trouble with extensions there is a much easier way to handle it. Just copy any .c file from another DMOD, change the name and you're done. No need to struggle with extensions. I always do it that way.
it's just that windows hides known extensions by default
That's one of the design decisions that I could never properly grasp. It's just beyond stupid.
That's one of the design decisions that I could never properly grasp. It's just beyond stupid.
May 9th 2006, 10:56 AM
Ducklord
Oh? I realized it so DuckLord told me I don't need them some time ago, so I deleted every .c extension.
Nononononononono!
Basically, your script files must be C files. They must have the .c extension, but sometimes Windows hides extensions. This means that it may be a c file but you can't see it. If Windows does hide it, then a .c file would either be a .c.c file or a txt file. You've really got to check your display options. Deactivate the 'hide known extensions' square (or something like that) in Windows Explorer. Yeah, you don't use the English version of Windows. But, duh, neither do I, so you should be able to find the right square that should be deactivated.
Nononononononono!
Basically, your script files must be C files. They must have the .c extension, but sometimes Windows hides extensions. This means that it may be a c file but you can't see it. If Windows does hide it, then a .c file would either be a .c.c file or a txt file. You've really got to check your display options. Deactivate the 'hide known extensions' square (or something like that) in Windows Explorer. Yeah, you don't use the English version of Windows. But, duh, neither do I, so you should be able to find the right square that should be deactivated.
6. You created the script in the story dir, right?