The Dink Network

Invisible - Fixed thanks :)

August 8th 2011, 12:40 AM
custom_msdink.png
MsDink
Peasant She/Her New Zealand
Tag - Umm.. tag, you're it? 
Is there no other way for Dink to be made invisible - a sequence to run and him to be made visible again without fading and redrawing the screen? I am doing adding a summoning sequence to the regular fireball spell - the character doesn't redraw after the sequence has played through.

Any hints pls or do I have to fade down and up again which I prefer not to do unless 100% necessary?

sp_no_draw(1,1);
sp_no_draw(1,0);
doesnt work
August 8th 2011, 02:26 AM
duckdie.gif
You want to make Dink invisible? The preferred way is to say "Koolahlimpa!" and throw glitter in the air.
Edit: Sorry, but I think making a blank sequence and running him through it will work.
August 8th 2011, 02:33 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
sp_no_draw(1,1); isn't supposed to work. sp_nodraw(1,1) on the other hand...
August 8th 2011, 02:35 AM
duckdie.gif
Oh yeah. right. go it. 'Thanks meta' (message by EmDee^)
August 8th 2011, 02:49 AM
custom_msdink.png
MsDink
Peasant She/Her New Zealand
Tag - Umm.. tag, you're it? 
Yeah sorry I have sp_nodraw - my error - but it still doesnt work

So i can do this without fade down and redrawing the screen?

argg playing with it keeps making it worse lol

This is what I have
//summons magic and gives fireball

void main( void )
{
	//set this sprite to react to touch, but not to being hit
	sp_touch_damage(&current_sprite, -1);
	sp_nohit(&current_sprite, 1);
	//using this global variable to get around
	//a bug with Dink freezing as he touches and
	//tries to talk to the scroll at the same time
	&dddd = 0;
}

void touch( void )
{
	//first better check that there is a spare magic slot
	int &fmagic = free_magic();
	if (&fmagic < 1)
	{
		say_stop("Hmmm, the old backpack is full of magic", 1);
		//no free slot so let's exit this script
		return;
	}
	//now we can give the magic
	add_magic("item-fb", 437, 1);
	//add some razzle-dazzle
	playsound(43,22050,0,0,0);
	freeze(1);
	&save_x = sp_x(1, -1);
	&save_y = sp_y(1, -1);

// Summon sequence 
	preload_seq(38);
	sp_nodraw(1,0);
	sp_nodraw(&current_sprite,1);
	int &summon = create_sprite(312,257,4,38,1);
	sp_seq(&summon,38);
	sp_frame_delay(&summon,100);
	sp_brain(&summon, 7);
	sp_nodraw(1,1);
	wait(250);
	
	say_stop("I now have fireball.", 1);
	//shrink to this percent then die
	unfreeze(1);
	&dddd = 666;
	sp_brain_parm(&current_sprite, 5);
	sp_brain(&current_sprite, 12);
	sp_touch_damage(&current_sprite, 0);
	sp_timing(&current_sprite, 0);
	int &hold = sp_editor_num(&current_sprite);
	if (&hold != 0)
	{
		//this was placed by the editor, lets make it not come back
		editor_type(&hold, 1);
		//kill sprite forever
	}
}



Character walks up touches this scroll - scroll disappears, character disappears, he plays his summon sequence (but also tells me the backpack is full) he disappears and it freezes telling me -still- the back pak is full, therefore isnt playing thru to its conclusion... so what have I not done right?

August 8th 2011, 03:14 AM
knightgl.gif
zeddexx
Peasant He/Him New Zealand
I'm pretty sure I'm worth atleast SIX goats... 
sp_nodraw(1, 1); worked fine in my thief dmod, i didnt have to fade out or draw screen or anything. Did you type it exactly like the above?
August 8th 2011, 03:17 AM
custom_msdink.png
MsDink
Peasant She/Her New Zealand
Tag - Umm.. tag, you're it? 
Above is script copied so yeah - though you have a space there - so I tried with a space as well but still no go

The only lines I have changed are line 20 from say to say_stop
and 32 to 43

rest is usual fireball script
August 8th 2011, 03:20 AM
duckdie.gif
Try putting a space after the ffirst bracket. Tis what I do with the void command.
August 8th 2011, 03:20 AM
knightgl.gif
zeddexx
Peasant He/Him New Zealand
I'm pretty sure I'm worth atleast SIX goats... 
Wish i could help, but this is way over my head im afraid sorry
August 8th 2011, 05:23 AM
dinkdead.gif
Put the sp_touch_damage(&current_sprite, 0); at the start of the touch procedure - it's probably calling the script many times while Dink is touching it, filling the slots with magic and generally causing havoc

Edit: Also, you possibly have the sp_nodraw's the wrong way round?
sp_nodraw(1, 1) makes him invisible, sp_nodraw(1, 0) makes him visible again.
August 8th 2011, 05:53 AM
custom_msdink.png
MsDink
Peasant She/Her New Zealand
Tag - Umm.. tag, you're it? 
Hey welcome back Sparrow, and nope none of that worked - the &current_sprite is the scroll not the summon sequence... and if I change the sp_nodraw round - he doesnt disapear as he should (which he does the other way round)

If I change the touch damage he walks over the scroll and he cant pick it up therefore nothing happens.. (sorry I am retarded when it comes to this stuff *sighs* baby steps!)
August 8th 2011, 05:56 AM
duckdie.gif
Maybe the object with which you attached the script is too small? I once attached a cscript to a coin and no matter how hard I tried it wouldn't work. Just a wild guess is all.
August 8th 2011, 06:01 AM
dinkdead.gif
I know the current_sprite is the scroll, I was thinking that every time the script gets to the wait(250) then it will start again from the beginning because Dink is still touching it. Didn't test or anything though so may well be wrong
Don't see how it would both play the sequence and tell you the backpack is full otherwise.

E: Change the touch damage in the touch procedure I meant, not in the main.
void touch(void)
{
 sp_touch_damage(¤t_sprite, 0);
 //rest of code
)
August 8th 2011, 06:04 AM
custom_msdink.png
MsDink
Peasant She/Her New Zealand
Tag - Umm.. tag, you're it? 
will send it if you want it really does both hehe i am so dumb i make this thing do stuff it shouldnt...

eek and yes i changed it to the touch (as in removed and put it under touch)but if touch is set to 0 how can he activate the rest?
August 8th 2011, 07:32 AM
spike.gif
It should look like this:

void main( void )
{
//set this sprite to react to touch, but not to being hit
sp_touch_damage(&current_sprite, -1);
sp_nohit(&current_sprite, 1);
//using this global variable to get around
//a bug with Dink freezing as he touches and
//tries to talk to the scroll at the same time
&dddd = 0;
}

void touch( void )
{
sp_touch_damage(&current_sprite,0);

//rest of the script
August 8th 2011, 07:37 AM
custom_msdink.png
MsDink
Peasant She/Her New Zealand
Tag - Umm.. tag, you're it? 
Ahhh i needed both Thanks heaps for that scratcher (and Sparrow) - now how do I make him come back after the animation sequence is completed
That plays thru nicely as it should - but no character when it done - hes invisible still...

sp_nodraw(&current_sprite,1);
preload_seq(38);
sp_nodraw(1,0);
sp_nodraw(&current_sprite,1);
int &summon = create_sprite(312,257,4,38,1);
sp_seq(&summon,38);
sp_frame_delay(&summon,100);
sp_brain(&summon, 7);
sp_nodraw(1,1);
wait(250);

If I change the 3rd line to 1,1 and 9th line to 1,0 he doesnt disappear and stands back whilst the sequence plays
August 8th 2011, 07:53 AM
spike.gif
There is no wait at all between sp_nodraw(1,1) and sp_nodraw(1,0). Dink is told to turn invisible, and then turn visible again at the same instant... Put the sp_nodraw(1,0) after the wait() command instead:

sp_nodraw(&current_sprite,1);
preload_seq(38);
sp_nodraw(1,1);
sp_nodraw(&current_sprite,1);
int &summon = create_sprite(312,257,4,38,1);
sp_seq(&summon,38);
sp_frame_delay(&summon,100);
sp_brain(&summon, 7);
wait(250);
sp_nodraw(1,0);
August 8th 2011, 08:01 AM
custom_msdink.png
MsDink
Peasant She/Her New Zealand
Tag - Umm.. tag, you're it? 
did that, but nope he still shows up and lurks in behind.
August 8th 2011, 08:05 AM
spike.gif
Did you switch the numbers between sp_nodraw(1,1) and sp_nodraw(1,0)? As Sparrowhawk said, 1 is for making things invisible, 0 is for making them visible again.

Also, with wait(250), Dink only remains invisible for 250 milliseconds - it's a pretty dang quick animation if it only takes that long, so you might want to use a longer wait.
August 8th 2011, 08:31 AM
custom_msdink.png
MsDink
Peasant She/Her New Zealand
Tag - Umm.. tag, you're it? 
yep i did the switcheroo
but playing with the wait... hmm...
All working YAY,
As discussed on chat - it was the wait that needed adjusting (big time) thank you SO very much He left and came back so fast i missed it.
/me hands out bunches of bananas and some mighty squishy hugs thanks heaps!
August 8th 2011, 09:21 AM
duckdie.gif
Me bites banana... oops that your finger MsDink... *hides face*