The Dink Network

New Dev File: Scriptus Generica

July 17th 2005, 04:56 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
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.

July 17th 2005, 06:47 PM
custom_fish.png
SabreTrout
Noble He/Him United Kingdom
Tigertigertiger. 
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.
July 17th 2005, 07:50 PM
wizardb.gif
merlin
Peasant He/Him
 
Arctic Ocean, or Arctic bathtub?
July 18th 2005, 07:54 AM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
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?
July 18th 2005, 12:59 PM
goblinm.gif
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(&current_sprite, -1);
&get_pseq / 10;
&get_pseq *= 10;
sp_base_walk(&current_sprite, &get_pseq);
sp_brain(&current_sprite, 16);
sp_speed(&current_sprite, 1);
}
July 18th 2005, 02:03 PM
spike.gif
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...
July 18th 2005, 02:13 PM
goblinm.gif
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
July 19th 2005, 03:42 PM
spike.gif
Tested it on me laptop, it works.

int &get_base_walk = sp_pseq(&current_sprite, -1);
&get_base_walk / 10;
&get_base_walk * 10;
sp_base_walk(&current_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);
July 19th 2005, 03:55 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
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.
July 19th 2005, 07:57 PM
goblinm.gif
wait(&current_sprite) solves all my problems, save alcoholism and demonic possesion of my pets.
July 19th 2005, 07:59 PM
goblinm.gif
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 &current_sprite would get all screwed up if I modified.
July 19th 2005, 09:22 PM
custom_carrie2004.gif
carrie2004
Peasant She/Her Canada
*chomp* 
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!
July 19th 2005, 09:29 PM
duck.gif
Tal
Noble He/Him United States
Super Sexy Tal Pal 
Maybe that's why your D-Mods are so lousy.

(Just joking, Carrie; I've only really played one..)
July 20th 2005, 08:01 AM
spike.gif
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)...
July 23rd 2005, 06:28 AM
dragon.gif
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.
August 1st 2005, 06:50 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
*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(&current_sprite);

to

int &hello = XX;

in shop2.c, where XX is the same as before.