Jump to content

Photo

Increasing duration length


  • Please log in to reply
8 replies to this topic

#1 Twilight Knight

Twilight Knight

    Tell all with glee, Argon's on PureZC

  • Members
  • Real Name:Sven
  • Location:Rotterdam, NL

Posted 07 December 2008 - 03:19 PM

I have made this script:
CODE
item script Heal {
  void run(int magictile, int magiccset) {
    Link->HP = Link->MaxHP;
    Screen->DrawTile(4,Link->X - 16,Link->Y - 16,magictile,3,3,magiccset,1,0,0,0,0,true,128);
  }
}


Ok, so the healing and such work fine, Drawtile too. But, the duration is soooo short. Maybe just 1 single frame. I want the effect to be longer. How do I do this? Note: Only the drawtile should stay longer.

#2 Joe123

Joe123

    Retired

  • Members

Posted 07 December 2008 - 03:30 PM

You have to link to a section of the global script to do that.
It's pretty awkward really.

I can teach you if you'd like though?

What you might better off doing is creating a weapon sprite and setting its deadstate to a certain number of frames.
That'd have the effect of making a graphic which appears for, say, 10 frames, then vanishes.

#3 Twilight Knight

Twilight Knight

    Tell all with glee, Argon's on PureZC

  • Members
  • Real Name:Sven
  • Location:Rotterdam, NL

Posted 07 December 2008 - 04:41 PM

Well, since the weapon sprite thing sounds easier, I will rather use that, but how do I set it up in the same way as I wanted the DrawTile?

#4 Joe123

Joe123

    Retired

  • Members

Posted 09 December 2008 - 07:00 AM

Oh I'm sorry, I forgot to reply >_<

You'd do it a bit like this:
CODE
lweapon Decoration = Screen->CreateLWeapon(LW_SCRIPT1); //Make the sprite
Decoration->X = Link->X-16; //Move to correct position
Decoration->Y = Link->Y-16;

Decoration->OriginalTile = magictile; //Set the graphic
Decoration->CSet = magiccset; //Set the CSet
Decoration->NumFrames = magicframes; //Set number of animation frames
Decoration->ASpeed = magicaspeed; //Set animation speed
Decoration->DeadState = magicframes*magicaspeed; //When deadstate is set to a certain value, the lweapon remains on the screen for that many frames

Decoration->Extend = 3; //Allow the sprite to be increased in size
Decoration->TileWidth = 3; //Set it to be a 3x3 sprite
Decortaion->TileHeight = 3;


Obviously it doesn't have to be called 'Decoration', I just couldn't think of a better name.
If you want anything explained any better, feel free to ask.

#5 Twilight Knight

Twilight Knight

    Tell all with glee, Argon's on PureZC

  • Members
  • Real Name:Sven
  • Location:Rotterdam, NL

Posted 14 December 2008 - 03:15 AM

Thanks for your reply, I'm sure it will work!

#6 Beefster

Beefster

    Human Being

  • Members
  • Real Name:Justin
  • Location:Colorado

Posted 14 December 2008 - 12:57 PM

Actually, a better way to do it is to use an lweapon that doesn't do damage and set the DeadState to 60 or something. Then you don't have to awkwardly pass it on to a global script. Though it's not very helpful if you want to keep it centered on Link for a second.

#7 Joe123

Joe123

    Retired

  • Members

Posted 14 December 2008 - 01:35 PM

QUOTE(Beefster @ Dec 14 2008, 05:57 PM) View Post
a better way to do it is to use an lweapon that doesn't do damage and set the DeadState to 60 or something

That is exactly what my code does.

#8 Twilight Knight

Twilight Knight

    Tell all with glee, Argon's on PureZC

  • Members
  • Real Name:Sven
  • Location:Rotterdam, NL

Posted 14 December 2008 - 03:44 PM

Yeah...
I tested it now and everything works fine, except a few issues I already fixed myself.

#9 Beefster

Beefster

    Human Being

  • Members
  • Real Name:Justin
  • Location:Colorado

Posted 17 December 2008 - 05:01 PM

QUOTE(Joe123 @ Dec 14 2008, 11:35 AM) View Post

That is exactly what my code does.
Sorry. I didn't really look at your code. I thought you just passed it on to a global script. XD sorry.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users