help fudge
how do i do this?
i mean like dink says something to something automatically
i know i have to create a script for the screen but what if i want to run it just once and not everytime dink enters the screen?
i mean like dink says something to something automatically
i know i have to create a script for the screen but what if i want to run it just once and not everytime dink enters the screen?
The easiest way to do this is to create a new global variable in main.c and change the value when the script has run its course. At the start of the script check if the value of the global is its initial value or the new one you gave it. This will make it run only once
There's plenty of good starter tutorials available on this site, as well as the DinkC reference. And my best tip would be to remember where you've seen something you want in someone else's d-mod and check the source code for it to see how they did it

There's plenty of good starter tutorials available on this site, as well as the DinkC reference. And my best tip would be to remember where you've seen something you want in someone else's d-mod and check the source code for it to see how they did it

Create a global.
Then:
Then:
if (&globalnamehere == 1) { } if (&globalnamehere == 0) { freeze(1); say_stop("It's so epic outside here!", 1); &globalnamehere = 1; unfreeze(1); }
Using a global is cool if it's somehow quest-related, but I wouldn't want to waste a global just to get Dink to say some random remark like "This house looks nice" (that particular line is so bland that you'd be better off not including it at all though
).
Placing an invisible sprite on the screen that dies after running its script works best, IMO. Something like this:

Placing an invisible sprite on the screen that dies after running its script works best, IMO. Something like this:
void main() { sp_nodraw(¤t_sprite,1); sp_nohit(¤t_sprite,1); say("This house looks nice. I will now commence to strangle myself on that hat rack.",1); int &idie = sp_editor_num(¤t_sprite); if (&idie != 0) editor_type(&idie,1); }
a good glabal that most D-mod's use is the global &story and if you used a skeleton mod it should be already made.
so i hope you found my small tip usefull
so i hope you found my small tip usefull
ok 1 more problem
where do i declare a global variable so i could change its value depending on the part of the story the player is in?
where do i declare a global variable so i could change its value depending on the part of the story the player is in?
You declare it in main.c, like this:
This makes a new variable called "&story" with an initial value of 0. &story is declared in main.c already, so you should probably choose a different name here. Also consider taking a look at my cute little tutorial, it's a good place to start if you're a beginner at making DMODs.
make_global_int("&story", 0);
This makes a new variable called "&story" with an initial value of 0. &story is declared in main.c already, so you should probably choose a different name here. Also consider taking a look at my cute little tutorial, it's a good place to start if you're a beginner at making DMODs.
What Scratcher said works best, but don't be too concerned if you don't know what he means or what that script does, they're fairly advanced concepts.
Stick with a global for now
Stick with a global for now

actually....im using ur tutorial XD
actually i have been learning c++ at school since quite some time so nothing is going over my head
