Jump to content

Photo

How to eweapons and lweapons


  • Please log in to reply
4 replies to this topic

#1 Mr. Z

Mr. Z

    Old Bastard is back!

  • Members
  • Real Name:Erik
  • Location:The Netherlands

Posted 21 May 2013 - 06:36 AM

I've been working with Zscript for quite a while now, but the one thing that I just can't wrap my head around is eweapons and lweapons.

When I look through other people's code I see a whole bunch of tasks dedicated to making a single weapon appear. It's all so confusing and big that I can't learn properly from those. I just want to make simple weapons and special effects (like sparks) with lweapons and eweapons that disappear after x frames, but there's no clear to understand documentation on how to do that.

 

 

Does someone have a tutorial on how to use them properly and without too much confusion?



#2 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 21 May 2013 - 11:38 AM

Well, what exactly are you trying to do? I don't know about you, but I like to learn by doing.



#3 grayswandir

grayswandir

    semi-genius

  • Members

Posted 21 May 2013 - 11:39 AM

I wrote http://www.purezc.ne...showtopic=59398 recently, which is what I think you want. Here's the code in the example quest, for reference:
Spoiler
 
Basically, you just call AnimationUpdate() in your main loop, and then create an animation with lweapon animation = AnimationCreate(sprite_id, x, y). You can assign the animation movement just like a regular weapon and then forget about it.

By default it makes the animations last for 1 run through the sprite. You can assign to animation->DeadState the number of frames you want it to last after you make it if you want different behavior.

#4 Soga

Soga

    Secretly Alive

  • Members

Posted 21 May 2013 - 01:37 PM

http://www.purezc.ne...showtopic=59568

 

I wrote this tutorial just recently.



#5 Mr. Z

Mr. Z

    Old Bastard is back!

  • Members
  • Real Name:Erik
  • Location:The Netherlands

Posted 23 May 2013 - 02:56 AM

Thanks grayswandir and Soga, those helped me a lot. Now I finally understand what I'm doing and managed to make a custom enemy weapon. (Deadstate works in a strange way)


  • Soga likes this


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users