Jump to content

Photo

Weapon and Item Durability


  • Please log in to reply
12 replies to this topic

#1 Gouanaco

Gouanaco

    Death Knight

  • Members
  • Real Name:Max
  • Location:Australia

Posted 14 March 2017 - 03:17 AM

Hello everyone, I have another script request.

 

I am looking for a script that will give weapons and items durability, so that they only have a set amount of uses.

I would also like some way to display the items durability on the sub screen.

Some examples of durability:

 

Swords: Loses durability on impact against creature, possibly also against switches etc

Shields: Loses durability whenever a projectile is blocked, possibly different projectiles deal different amounts of damage

Boomerangs: Loses durability on impact against creature, possibly also when hitting walls

Bows: Loses durability on each loose of an arrow

Hammers: Each use regardless of what it hits loses durability

 

I did find this thread http://www.purezc.ne...ing#entry720548

However the script doesn't appear to be completed.

 

Thanks to anyone that can make an attempt at this, I know that this script will be slightly complex and have to be worked on separately for each weapon/item.

 

 

 


  • Shane likes this

#2 justin

justin

    Adept

  • Members

Posted 14 March 2017 - 08:10 AM

I made a script for this awhile back. It's in the database http://www.purezc.ne...=scripts&id=151

Pretty sure that it does everything you're after except shields. Let me know if you have any problems implementing it.

#3 Gouanaco

Gouanaco

    Death Knight

  • Members
  • Real Name:Max
  • Location:Australia

Posted 14 March 2017 - 11:52 AM

I made a script for this awhile back. It's in the database http://www.purezc.ne...=scripts&id=151

Pretty sure that it does everything you're after except shields. Let me know if you have any problems implementing it.

 

Damn, I forgot to search the database. Sorry mods.

 

But thanks justin, Ill give your script a crack later on.



#4 Matthew

Matthew

  • Administrators
  • Real Name:See above.
  • Pronouns:He / Him
  • Location:Ohio

Posted 14 March 2017 - 01:13 PM

Boko club is badly damaged.
  • ShadowTiger, Gouanaco and Deedee like this

#5 Item

Item

    Senior

  • Banned

Posted 14 March 2017 - 01:15 PM

My name is in it. ((Why did I chose this username and stuck with Unpost instead))


  • Gouanaco likes this

#6 Gouanaco

Gouanaco

    Death Knight

  • Members
  • Real Name:Max
  • Location:Australia

Posted 16 March 2017 - 02:17 AM

I made a script for this awhile back. It's in the database http://www.purezc.ne...=scripts&id=151

Pretty sure that it does everything you're after except shields. Let me know if you have any problems implementing it.

 Alright I am having some problems.

 

I have pasted the code into a .z file with all my other code, then I am importing and compiling the code and now I am getting errors in other parts of my code. 

 

Line 388: Syntax Error, Unexpected Script, Expecting Identifier, On token Script

Fatal Error P00: Can't Open Or parse Input File!

 

My script runs fine without your code added to the bottom.Your code is added around lines 1166-1861

 

I have the following extensions:

ffcscript.zh

std.zh

std_constants.zh

std_functions.zh

stdArguments.zh

stdCombos.zh

stdExtra.zh



#7 justin

justin

    Adept

  • Members

Posted 16 March 2017 - 06:56 AM

What's line 388?

#8 Gouanaco

Gouanaco

    Death Knight

  • Members
  • Real Name:Max
  • Location:Australia

Posted 16 March 2017 - 08:14 AM

What's line 388?

Nevermind!

 

I did originally post line 338 but I have found the problem to my code.

 

I had 3 years ago had the same bug as this and made edits WITHIN the buffer and not the original .z code that I had!

There was bugs in the GBshield scripts as well as a bug with blending a while() loop that I had forgotten about. Tsk tsk.

 

---------------------------

 

Ok so I have complied your script and it appears to be working. However, for a sword that has say 20 uses would I use I_ACT_Consume or I_PU_Consume??? It states that PU is used for none 1 use items but within I_ACT it allows a counter and choice of what it collides with.

 

Also do I place the script in the Action or Pickup slot for a sword.

 

Another thing is when I first picked up the sword after adding one of the scripts to it the text PIT and a counter on the left of the screen appear constantly counting up to a value around 500, Debugging you left on?

 

---------------------------

 

Also Is it possible if you could work on something for shields? Even if its basic, consumable shields are a huge planned part of my quest and I would greatly appreciate if you could find a way. Thanks again!


Edited by Gouanaco, 16 March 2017 - 01:02 PM.


#9 justin

justin

    Adept

  • Members

Posted 16 March 2017 - 10:38 PM

If the item is more than 1-time use you'll apply both the pickup and the action scripts to it. If it's one time use you only apply the action script. You'll notice the action and pickup arguments work in conjuction. Does that clear it up?

I do have a debugging function in there, but what you're describing doesn't sound like mine. Mine would only run if you were doing something unusual that I didn't test, I left it in there so that people could test unusual stuff. You can eliminate it, in the function ffc script Consumable_FFC find the line Debug_MissingLW(consume_type); and comment ( precede it with // ). If the debugging stuff doesn't go away it's from something else.

#10 Gouanaco

Gouanaco

    Death Knight

  • Members
  • Real Name:Max
  • Location:Australia

Posted 17 March 2017 - 12:32 AM

If the item is more than 1-time use you'll apply both the pickup and the action scripts to it. If it's one time use you only apply the action script. You'll notice the action and pickup arguments work in conjuction. Does that clear it up?

I do have a debugging function in there, but what you're describing doesn't sound like mine. Mine would only run if you were doing something unusual that I didn't test, I left it in there so that people could test unusual stuff. You can eliminate it, in the function ffc script Consumable_FFC find the line Debug_MissingLW(consume_type); and comment ( precede it with // ). If the debugging stuff doesn't go away it's from something else.

Thanks Justin for clearing that up. Script seems to be working fine now, although I just had an instance were just as the sword disappeared it fired off a sword beam, even though link doesn't have it?

 

The counter has disappeared but the text PIT still remains as soon as I use for example the sword with your script, I am still checking the rest of my code for anything that might be causing it.

 

And once again Ill ask if its possible for shields? I have the GBShield script implemented so that the player has to press a button to use the shield.


Edited by Gouanaco, 17 March 2017 - 01:16 AM.


#11 justin

justin

    Adept

  • Members

Posted 17 March 2017 - 06:21 AM

Post the GBShield code you're using or a link to it. I'll see what I can do.

What types of eweapons damage the shield? All by the same amount or does it depend on the weapon or even how much damage the attack does?

Sounds like the sword beam thing might be a bug. I'll see if I can track it down. What values are you using in the arguments?
  • Gouanaco likes this

#12 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 17 March 2017 - 08:23 AM

He didn't set a proper invisible combo for ffcscript.zh to match his tileset. That us why he is seeing a 'pit' combo when it runs.

Edited by ZoriaRPG, 17 March 2017 - 08:24 AM.


#13 Gouanaco

Gouanaco

    Death Knight

  • Members
  • Real Name:Max
  • Location:Australia

Posted 17 March 2017 - 08:26 AM

http://www.purezc.ne...e=scripts&id=35- GBShield script

 

Well it would be preferred to be the damage that would have normally been done to link done to the shield. But even just having a it lose a use when it blocks something is still really good.

 

Values for the sword are:

 

D0: 5

D1: 1

D2: 12

D3: 1

D4: 3

 

If you wish I can send you in a PM my entire code if you want. The beam could be a problem on my part but I have been looking and excluding code trying to find out what might be causing it but haven't found it so far.

 

@ZoriaRPG How would I go about assigning a proper invisible combo? EDIT: I found the tile and just removed the pit text.

He didn't set a proper invisible combo for ffcscript.zh to match his tileset. That us why he is seeing a 'pit' combo when it runs.

 

Edited by Gouanaco, 17 March 2017 - 08:31 AM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users