On Hit instead of on Break

Questions about how to create your own dungeons and replacement graphics and sounds.

Moderator: George Gilbert

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
Soaponarope
Artisan
Posts: 190
Joined: Wed Sep 16, 2009 4:18 pm

On Hit instead of on Break

Post by Soaponarope »

This seems like a newbish question, but I can't find how to do this. How do I make an item convert when striking something without having that item break.

I want to add a convert spell effect on hit, and keep items intact.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Re: On Hit instead of on Break

Post by beowuuf »

I think you would code it into the attack action of the item, instead of looking to the item itself.

Sorry, unless you mean a thrown item, in which case have the convert on break effect also create an identical copy of the item
User avatar
b1llygo4t
Apprentice
Posts: 30
Joined: Tue Sep 01, 2009 1:53 am
Location: my house

Re: On Hit instead of on Break

Post by b1llygo4t »

just have the item create the same item and the spell effect on break? it would muck up charges tho
potion? what potion?
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: On Hit instead of on Break

Post by Gambit37 »

Charges are copied across to converted items, so this would be OK.
User avatar
Soaponarope
Artisan
Posts: 190
Joined: Wed Sep 16, 2009 4:18 pm

Re: On Hit instead of on Break

Post by Soaponarope »

Yes I meant thrown items and did not think of just creating a new one since I thought there was another way besides on break.

Thanks, this works for me since I wasn't using this for charged items.

With charged items though, the charges wouldn't be copied over since a new item must be made though, right? So I don't think that would work for Billygoat.
User avatar
b1llygo4t
Apprentice
Posts: 30
Joined: Tue Sep 01, 2009 1:53 am
Location: my house

Re: On Hit instead of on Break

Post by b1llygo4t »

to bad objects cant break when they hit the floor, or am i wrong?
potion? what potion?
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: On Hit instead of on Break

Post by Gambit37 »

@Sopaonarope: It's my understanding that when an object is converted, if its properties have matching properties in the new object, they are copied over. And even non-matching properties can be matched, for example CHARGES might be converted to HEALTH if you convert a potion to a monster.

Only George knows exactly how this works, so it looks like you have lots of experimentation ahead... ;-)

"Break" only applies to objects thrown against a wall. There's no event matching for objects landing on the floor.
Post Reply