New Dev File: Scriptus Generica
The recently bonked SabreTrout has untethered a new development file for ye' land lubbers to enjoy: Scriptus Generica. It apparently consists of 4 general purpose DinkC scripts. If they aren't any use to you, SabreTrout assures me he'll swim across the Arctic Ocean.
Not a particularly exciting pack this, just a few scripts that can be easily modified for your own d-mod.
And I will indeed swim across the Arctic Ocean if you can't use this file. Backstroke, probably.
And I will indeed swim across the Arctic Ocean if you can't use this file. Backstroke, probably.
The shop thing will be useful to me, but the person script not. Are you going to swim 1/3rd of the Arctic ocean now?
Maybe the NPC script should handle brain 16. I was thinking something along the following lines:
void main( void )
{
//finding base walk with integer arithematic
int &get_pseq = sp_pseq(¤t_sprite, -1);
&get_pseq / 10;
&get_pseq *= 10;
sp_base_walk(¤t_sprite, &get_pseq);
sp_brain(¤t_sprite, 16);
sp_speed(¤t_sprite, 1);
}
void main( void )
{
//finding base walk with integer arithematic
int &get_pseq = sp_pseq(¤t_sprite, -1);
&get_pseq / 10;
&get_pseq *= 10;
sp_base_walk(¤t_sprite, &get_pseq);
sp_brain(¤t_sprite, 16);
sp_speed(¤t_sprite, 1);
}
int &get_pseq = sp_pseq(¤t_sprite, -1);
&get_pseq / 10;
&get_pseq *= 10;
sp_base_walk(¤t_sprite, &get_pseq);
That works? Dink ignores fractions? lazy man doesn't try...
&get_pseq / 10;
&get_pseq *= 10;
sp_base_walk(¤t_sprite, &get_pseq);
That works? Dink ignores fractions? lazy man doesn't try...
As far as I know C++ will ignore fractions if your handling int variables, although it'll generate a compiler warning. The proper way to code it would be something like:
get_pseq -= get_pseq % 10
get_pseq -= get_pseq % 10
Tested it on me laptop, it works.
int &get_base_walk = sp_pseq(¤t_sprite, -1);
&get_base_walk / 10;
&get_base_walk * 10;
sp_base_walk(¤t_sprite, &get_base_walk);
&get_base_walk += 1;
preload_seq(&get_base_walk);
&get_base_walk += 2;
preload_seq(&get_base_walk);
&get_base_walk += 2;
preload_seq(&get_base_walk);
&get_base_walk += 2;
preload_seq(&get_base_walk);
&get_base_walk += 2;
preload_seq(&get_base_walk);
int &get_base_walk = sp_pseq(¤t_sprite, -1);
&get_base_walk / 10;
&get_base_walk * 10;
sp_base_walk(¤t_sprite, &get_base_walk);
&get_base_walk += 1;
preload_seq(&get_base_walk);
&get_base_walk += 2;
preload_seq(&get_base_walk);
&get_base_walk += 2;
preload_seq(&get_base_walk);
&get_base_walk += 2;
preload_seq(&get_base_walk);
&get_base_walk += 2;
preload_seq(&get_base_walk);
However, if you attach that to multiple sprites on the same screen, I don't think it would work, thanks to the variable sharing issues that plague Dink v1.07 and lower.
wait(¤t_sprite) solves all my problems, save alcoholism and demonic possesion of my pets.
And I thought the bug was only between sprites with the same script on the same screen... though I could well be wrong.
Sorry to double post, but ¤t_sprite would get all screwed up if I modified.
Sorry to double post, but ¤t_sprite would get all screwed up if I modified.
Drink EXACTLY 1 cup of coffee per 2 map screens created. - Sabretrout(Scriptus Generica)
Ohhhhh.Why didn't someone tell me this sooner?
I've only been drinking 1 cup per 5 map screens!
Ohhhhh.Why didn't someone tell me this sooner?
I've only been drinking 1 cup per 5 map screens!
Maybe that's why your D-Mods are so lousy.
(Just joking, Carrie; I've only really played one..)
(Just joking, Carrie; I've only really played one..)
However, if you attach that to multiple sprites on the same screen, I don't think it would work, thanks to the variable sharing issues that plague Dink v1.07 and lower.
As far as I tried it does, even with the same script attached to multiple sprites. Though I didn't test quite thoroughly (yet)...
As far as I tried it does, even with the same script attached to multiple sprites. Though I didn't test quite thoroughly (yet)...
Maybe that's why I've been having unforseen problems with my Dink.ini file and even more with my attempt at a dmod (thus the lack of its release). I don't even drink cofee at all.
*cough* shop2.c is actually called shop2.txt in the zip *cough*
Normal object script is fairly useless. And as mentioned before, a brain 16 NPC would be nice.
Also, first talking to shop1.c, then talking to shop2.c will result in twice a "I've never seen you before" routine. This can be fixed by changing:
int &hello = sp_editor_num(¤t_sprite);
to
int &hello = XX;
in shop2.c, where XX is the same as before.
Normal object script is fairly useless. And as mentioned before, a brain 16 NPC would be nice.
Also, first talking to shop1.c, then talking to shop2.c will result in twice a "I've never seen you before" routine. This can be fixed by changing:
int &hello = sp_editor_num(¤t_sprite);
to
int &hello = XX;
in shop2.c, where XX is the same as before.