The Dink Network

external question

August 31st 2002, 08:47 AM
girl.gif
joshriot
Peasant They/Them United States
keep it real 
i do this external("stats","load_slayer"); and in stats.c in load_slayer(); i have &strength = 4, &defense = 4, and &magic = 4. they originaly = 3,2,1 (i think) but only the strength gets updated, no matter what order i put the commands in. whats going on?
August 31st 2002, 09:50 AM
wizardg.gif
Paul
Peasant He/Him United States
 
: i do this external("stats","load_slayer"); and in stats.c in load_slayer(); i have &strength = 4, &defense = 4, and &magic = 4. they originaly = 3,2,1 (i think) but only the strength gets updated, no matter what order i put the commands in. whats going on?

Odd. I can't think why it would do that. Could I see the actual load_slayer() procedure?
August 31st 2002, 10:19 AM
girl.gif
joshriot
Peasant They/Them United States
keep it real 
main.c

------

make_global_int ("&strength",1);

make_global_int ("&defense",1);

make_global_int ("&magic",1);

item slayer

------

void arm()

{

external("stats","load_slayer");

}

stats.c

------

void load_slayer()

{

&strength = 4;

&defense = 4;

&magic = 4;

}

strength goes to 4, nothing else. the only thing i could guess is that start-1 could call the arm after getting the item before some other crucial command, but i can re-equip the item in-game and still no luck. i even tried making another item set &defense and &magic to 3 in arm and the load_slayer still doesnt get it to 4, it stays at 3. try this for yourself.
August 31st 2002, 10:38 AM
old.gif
: main.c

: ------

: make_global_int ("&strength",1);

: make_global_int ("&defense",1);

: make_global_int ("&magic",1);

: item slayer

: ------

: void arm()

: {

:  external("stats","load_slayer");

: }

: stats.c

: ------

: void load_slayer()

: {

:  &strength = 4;

:  &defense = 4;

:  &magic = 4;

: }

: strength goes to 4, nothing else. the only thing i could guess is that start-1 could call the arm after getting the item before some other crucial command, but i can re-equip the item in-game and still no luck. i even tried making another item set &defense and &magic to 3 in arm and the load_slayer still doesnt get it to 4, it stays at 3. try this for yourself.

add this to the stats.c

draw_status();
August 31st 2002, 10:02 PM
wizardg.gif
Paul
Peasant He/Him United States
 
: main.c

: ------

: make_global_int ("&strength",1);

: make_global_int ("&defense",1);

: make_global_int ("&magic",1);

: item slayer

: ------

: void arm()

: {

:  external("stats","load_slayer");

: }

: stats.c

: ------

: void load_slayer()

: {

:  &strength = 4;

:  &defense = 4;

:  &magic = 4;

: }

: strength goes to 4, nothing else. the only thing i could guess is that start-1 could call the arm after getting the item before some other crucial command, but i can re-equip the item in-game and still no luck. i even tried making another item set &defense and &magic to 3 in arm and the load_slayer still doesnt get it to 4, it stays at 3. try this for yourself.

You're not going to like this...

I tried it and it works perfectly.

But why not just drop the external command and put the stat adjustments right in the item script, it might not be quite as neat, but it should work fine. (And if it doesn't, you'll know something's more basic is wrong.)
September 1st 2002, 05:22 AM
girl.gif
joshriot
Peasant They/Them United States
keep it real 
: You're not going to like this...

: I tried it and it works perfectly.

: But why not just drop the external command and put the stat adjustments right in the item script, it might not be quite as neat, but it should work fine. (And if it doesn't, you'll know something's more basic is wrong.)

it works right into the script and spawned, just not with external. and for what im trying to do, having all the stat load and saves modularolarized into one script will be much better.

void load_slayer( void )

{

&defense = 5;

debug("defense should increase now");

&strength = 5;

debug("strength should increase now");

&magic = 5;

debug("magic should increase now");

}

debug:

Dink:Script 1stats is entered at offset 25.

Dink:MERROR: "&defense" unknown in 1stats, offset 72.

Dink:defense should increase now

Dink:strength should increase now

Dink:MERROR: "&magic" unknown in 1stats, offset 191.

Dink:magic should increase now

Dink:Script 1slayer is entered at offset 1869.
September 1st 2002, 05:59 AM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
Dink is really funky on spacing. I noticed you have different spacings between &defense/&magic and the = sign... try putting just one space instead.
September 1st 2002, 06:30 AM
girl.gif
joshriot
Peasant They/Them United States
keep it real 
: Dink is really funky on spacing.  I noticed you have different spacings between &defense/&magic and the = sign... try putting just one space instead.

you got it. pretty simple solution actually, it seems i was just expecting it to be something complex from the debug. i will never use debug again.