The Dink Network

arm and kill

January 21st 2006, 06:12 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
is there a way to force dink to arm a weapon, such as his fists after the current item he is using is killed

example...when dink uses an elixer nothing is armed anymore, i want it so he automatically arms his fists after it is killed
January 21st 2006, 06:13 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
Maybe in the holdingdrop procedure of each weapon?
January 21st 2006, 06:14 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
so what lines would i use? i know to use
arm_weapon();
but not sure how to specify which slot or item
January 21st 2006, 06:18 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
Aha. I looked in start-1.c (which automatically adds and arms the first) to see that &cur_weapon specifies the weapon slot.

So you'd just do something like this:

&cur_weapon = 1;
arm_weapon();
January 21st 2006, 06:19 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
&cur_weapon = 1;
arm_weapon();

assuming that the fists are in the first slot. There's a 1.08 function that gets the slot of a given item script;

In 1.08, use:

&cur_weapon = get_item("item-fst");
arm_weapon();

EDIT: Blah, redink1 was first...
January 21st 2006, 06:23 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
blah, doesn't work... here's what i have...

void holdingdrop( void )
{
&cur_weapon = 1;
arm_weapon();
}

add: i played around with it a bit added
&update_status = 1;
draw_status();
to it, but still no changes. same thing happens, you use the item, the icon stays there and you've got nothing equipped
January 21st 2006, 08:35 PM
anon.gif
dinkmega
Ghost They/Them
 
I remember something like that happening in a Dmod, but which one? Can't remember.
January 21st 2006, 08:57 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
Try adding a 'say' line to see if holdingdrop is actually being called.
January 21st 2006, 09:33 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
i tested it, it's being called.

add: something wierd...i took out arm_weapon(); just to see what would happen, and the fist graphic goes into the weapon slot, but still not armed...
January 22nd 2006, 03:16 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
more playing around with it...i made a key script...

void main ( void )
{
&cur_weapon = 1;
arm_weapon();
&update_status = 1;
draw_status();
kill_this_task();
}

and tested it. it works, it arms the fists. so i made it spawn in the holdingdrop command. the fist item graphic displays, but still no item is armed.
January 22nd 2006, 04:20 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
In your spawned script, try adding wait(1); before anything.
January 22nd 2006, 04:24 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
well, what do ya know, it works now. thanks a bunch. so you have to spawn an extra script, who cares maybe there's a way i can implement it into the script that give the potion it's effect.

add: got everything working o.k. now, wierd how it won't work in the holdingdrop procedure though