The Dink Network

vision in the game

June 7th 2003, 02:38 PM
fairy.gif
glennglenn
Peasant He/Him Norway
GlennGlenn doesn't want a custom title. 
Well i have worked on a d-mod for a long time
and i have a problem.
Dink should talk to a Wizard and then the wizard send him to kill the pillbug
and here are the problem. I have set the pillbug on vision 1
and then i have maked this script to make the
vision get to 1 from 0

void main( void )
{
if (&story < 2)
{
&vision = 0;
}

if (&story == 2)
{
&vision = 1;
}
}

But why doesn`t the pillbug show up
June 7th 2003, 02:50 PM
spike.gif
Because changing the vision is possible only in a "base script" of a screen. Go to DinkEdit, go to the screen in which the scene takes place, hit B and write the name of the above script there.
June 7th 2003, 03:00 PM
fairy.gif
glennglenn
Peasant He/Him Norway
GlennGlenn doesn't want a custom title. 
hey scratcher it is atached to the screen
June 7th 2003, 09:09 PM
pillbug.gif
I've always had the same problem, I just avoid visions. If you can't fix it, you could always just use another storyline and create the sprite using a local variable. That is, only as a last resort.

June 7th 2003, 10:39 PM
pq_frog.gif
Ric
Peasant They/Them Canada
 
Ya, visions are sticky, but so usefull! I would try to debug it by adding say("vis = 1",1); after the &vision = 1; command. When you run it, dink will say it if that proc. got run. Also use the debug (alt-D) at that point. It will say in the debug text if the comparison if(&story == 2) was made.
June 8th 2003, 12:48 AM
old.gif
Try this way, I know you guys dont like it, but it will work, I hope

void main(void)
{
if (&story != 2) goto SKIP;
&vision = 1;
SKIP:
}
June 8th 2003, 04:01 AM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
Don't forget the kill_this_task();
June 8th 2003, 05:22 AM
fish.gif
Binirit
Peasant She/Her
 
I never have any problems using vision. I think it's an easy way to do things - but then again, I'm not that good at scripting, so perhaps that's it.
June 8th 2003, 12:41 PM
spike.gif
Well, first of all, you don't need the
if (&story < 2)
{
&vision = 0;
}
at all, and second, adding draw_status(); after &vision = 1; once helped me.. Dunno if it even had anything to do with the &vision thing, (since I had a really complex script) but anything's worth trying. And do the thing Ric said, to make sure the proc actually runs.
June 8th 2003, 02:37 PM
fairy.gif
glennglenn
Peasant He/Him Norway
GlennGlenn doesn't want a custom title. 
hey i have tried your tips
but i found the problem
the procedure doesn`t run
i tried to put a say command in the script and dink didnt say anything
so can someone tell me why my script dont run
June 8th 2003, 02:39 PM
custom_odd.gif
When you attach it to the screen in dinkedit or windinkedit, make sure you just use the name, not the name with .c on it. Just make sure it's named properly, and the main proc should run when you walk on the screen.
June 8th 2003, 02:44 PM
fairy.gif
glennglenn
Peasant He/Him Norway
GlennGlenn doesn't want a custom title. 
I have atached it to the screen without the .c
but it still dont work
June 8th 2003, 02:49 PM
anon.gif
theprophet
Ghost They/Them
 
Ok, I had enough of it, the hard way:

void main(void)
{
if (&story != 2) goto skip;
force_vision(1);
SKIP:
kill_this_task();
}

ASSIGN THIS SCRIPT TO A SPRITE IN THE ROOM ( tree or wall, etc.. )
June 8th 2003, 03:39 PM
wizardb.gif
Phoenix
Peasant He/Him Norway
Back from the ashes 
Or, better yet:

void main(void)
{
if (&story != 2)
return;
force_vision(1);
}

and you still do as he said, attach it to somethng random in the room; doesn't matter what.
June 8th 2003, 03:42 PM
old.gif
I posted that, but use my WAY

IF FORCE_VISION IS USED, IT WILL ASSIGN THE SCRIPT TO 1000, so phoenix way will make it survive forever....
June 8th 2003, 05:22 PM
knightg.gif
WC
Peasant He/Him United States
Destroying noobs since 1999. 
Just add a freaking return. goto's suck.
June 8th 2003, 05:31 PM
spike.gif
Make sure there's no space in the start of the script's name in dinkedit, since if you press shift etc. in the editor it will make a space.
June 8th 2003, 05:40 PM
spike.gif
Just do
if (&story == 2)
{
force_vision(1);
kill_this_task();
return;
}
June 8th 2003, 10:14 PM
custom_odd.gif
scratcher.. if you kill the script.. then it won't do the return... and honestly, neither is necesary. it's a room script. when it's done, it's done.
June 9th 2003, 08:26 AM
spike.gif
Oh well. If there's nothing more in the script, they're not, but if there is, both of those commands are needed.