The Dink Network

I have an idea...

September 17th 2009, 03:31 AM
burntree.gif
Fireball5
Peasant He/Him Australia
Let me heat that up for you... 
How hard can it be to use scripts to manipulate Dink's inventory? Like, add catagories other than magic and weapons/items?

I had this idea of modifying it so there were armour slots as well, although this would mean you would get less items/magic.

If all the slots were pre-filled with placeholders, they could determine what should go there, and then I could use

int &place = get_item("place-arm");
if (&place > 0)
{
  kill_this_item("place-arm");
  add_item("item-fb5", 438, 49);
}
else
{
  say("dangit! No free armour slots", 1);
}


It's been about two years since I've done any professional DinkC (Phhht! Professional! *chuckle*) so I might be a bit rusty.

Tell me what you think!

EDIT: stupid swear filter... changes d-a-m-n into dang!
September 17th 2009, 05:02 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
The only problem with having more than the given categories is that you can only really equip 2 things (one from your magic category and one from your items category.) So even if you did use your placeholders, when you go to equip your armor, that will be the only thing equipped from the original category it is in. You would have to use a global to keep track of which armor is equipped, and in doing so, it won't display the equipped box around the armor equipped. You'd also need an alternative way of equipping the armor.

Since you can't equip the armor by normal means, having it in an inventory that displays it would be confusing for the player. You'd probably be better off scripting your own inventory with a custom interface. So, you'd start from scratch using button4.c.

And of course you can always expand your inventory by using globals. Since your armor cannot be equipped in the items or magic slot, you might want to consider using this to hold what armors you have in the custom inventory. (if you can't equip it, why waste an item slot?)

If you didn't want to do any of this, you could make it so you can only hold one armor at a time and your defense is modified when you obtain it.
September 17th 2009, 07:54 PM
burntree.gif
Fireball5
Peasant He/Him Australia
Let me heat that up for you... 
I was going to make defense be modified just by picking up the armour. Like the ice armour from PQ, but the armour goes in special slots and is equiped probably just by buying it.

I'll see how I go, and keep you guys updated with progress.
September 17th 2009, 09:21 PM
knights.gif
Androrc
Peasant He/Him Austria
 
This would be a pretty good feature, actually. I was thinking of doing something like this myself.

You could add a new screen (and make it so the player activates it by pressing the key you want). For armor selection, you could transform Dink into the mouse pointer (since the mouse is transformed into Dink through DinkC when a new game is started, it should be somewhat easy to replicate that), or the default item selection square.

For quickly reloading Dink's normal graphics when the screen is closed by the player, you could disarm and rearm him with his last weapon, since that loads the graphics particular do that weapon:

int &temp;
&temp = &cur_weapon;
&cur_weapon = 0;
arm_weapon();
&cur_weapon = &temp;
arm_weapon();
September 17th 2009, 10:28 PM
burntree.gif
Fireball5
Peasant He/Him Australia
Let me heat that up for you... 
I've actually gotten it to work without adding any screens, just by using simple scripts.

From START-1.C:
    add_item("item-fst", 438, 1);
    add_item("item-ite", 438, 2);
    add_item("item-ite", 438, 2);
    add_item("item-arm", 438, 3);
    add_item("item-ite", 438, 2);
    add_item("item-ite", 438, 2);
    add_item("item-ite", 438, 2);
    add_item("item-arm", 438, 3);
    add_item("item-ite", 438, 2);
    add_item("item-ite", 438, 2);
    add_item("item-ite", 438, 2);
    add_item("item-arm", 438, 3);
    add_item("item-ite", 438, 2);
    add_item("item-ite", 438, 2);
    add_item("item-ite", 438, 2);
    add_item("item-arm", 438, 3);

    add_magic("item-mag", 437, 2);
    add_magic("item-mag", 437, 2);
    add_magic("item-mag", 437, 2);
    add_magic("item-mag", 437, 2);
    add_magic("item-mag", 437, 2);
    add_magic("item-mag", 437, 2);
    add_magic("item-mag", 437, 2);
    add_magic("item-mag", 437, 2);

    &cur_weapon = 1;
    arm_weapon();

    &cur_magic = 1;
    arm_magic();


From shop.c:
  if (&result == 1)
  {
    int &place = get_item("item-arm");
    if (&place > 0)
    {
      kill_this_item("item-arm");
      add_item("item-boo", 445, 1);
    }
    else
    {
      say_stop("I have no more item slots!", 1)
    }
    goto End;
  }


Every fourth item slot (the column on the far right side) is now an armour slot. I also made a placeholder for magic, just in case.

What I'm having slight problems with now is how to deal with selecting the placeholders. I've noticed Dink seems to crash when dealing with accidental infinite loops and item arming...
September 17th 2009, 10:53 PM
knights.gif
Androrc
Peasant He/Him Austria
 
You could also make it so the armor, when chosen at the item screen (at any slot), equips itself at the "armor slot" and does the desired effects in it's arm void, and then reloads the last used weapon.
September 17th 2009, 11:30 PM
burntree.gif
Fireball5
Peasant He/Him Australia
Let me heat that up for you... 
Thats a pretty good idea... I'll try and implement that.