RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Destructable Event Objects?

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 82
We learn by living...
Hi, I'm looking for a good way to make event objects, like rocks or crates destructible, like with hit points and resistances.

One idea was creating a bunch of variables for object type (wood/stone/metal/etc.) to store "hit points" that are reduced by using other event effects. It just seems like it would be simpler if we could assign hit points to objects. I'm sure there's probably better ways of doing this.

-Shin

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
You could use the self switch function, but unfortunately that would only give you a maximum of 4 lives. Plus, giving that to every object would be a bit tedious. I'm pretty sure variables are your best bet. Unless you want to install an ABS solely for the purpose of being able to give objects HP, which would be just as tedious as assigning self switches to each object.

Resistances, now that's something else. I'm not too sure what you want to do with there, so could please you explain further?

***
Rep:
Level 82
We learn by living...
You could use the self switch function, but unfortunately that would only give you a maximum of 4 lives. Plus, giving that to every object would be a bit tedious. I'm pretty sure variables are your best bet. Unless you want to install an ABS solely for the purpose of being able to give objects HP, which would be just as tedious as assigning self switches to each object.

Resistances, now that's something else. I'm not too sure what you want to do with there, so could please you explain further?

Certainly!

Rock, Wood, Metal, and Flesh compose four of the more common solids in a video game. Liquids and gases won't work with this idea, but many terrain features, including trees (wood), castle walls (rock), weapons and armor (metal or wood), and non player characters (mostly flesh) fit in these broad categories.

Wood burns, rock cracks, metal dissolves. Metal also magnetizes and conducts electricity, rather than suffering too much from it. In a sci-fi, you might have "electronics" [androids/robots/AI's] as a fifth type which is weak vs. electricity.

So basically, you have electricity, fire, cold, acid, magnetism, and vibration as common Resistances.

I would guess the method to making it work is creating the solid types as specific types of variables, which act as containers.

Think of it like pitchers of colored liquid or kool-aid:


The amount of liquid (the number assigned to the variable) represents it's hit points.
The type of liquid (the variable name) represents it's weaknesses or strengths.

So 200 hit points of Wood is not the same as 200 hit points of Flesh or Steel,
since Wood might take 50% damage from Vibration or Acid and 200% damage from fire.
Steel on the other hand, might take 200% damage from Acid and only 50% from fire.

Setting "flesh" to "Standard" (100% vs. everything), might be a good idea.

The Basic mechanism (which I do not yet understand how to do) is

1. assign a variable type to an event object, like a wall tile, a town guard, or a tree stump
2. assign that variable a number, such as 50 hit points
3- plan a. set up the object to disappear when hit points are zero and less.
3- plan b. set up two event pages where the image is 'damaged' at 50% hp (page 2), and 'destroyed' at 0 hp (page 3).

4. have techniques/skills/spells in comment events that can inflict these types of damage.

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
So, from what I can understand, you want a system where there are solid objects in which you can set a hit point value to, and you want specific techniques that can be used to destroy these objects? Do you want specific events to have specific Hit Points? For example, a withering tree could have 50 HP, while a strong tree could have 100 HP.

Otherwise, this should be quite easy to do (though tedious).

Page 1: Control the variable the the HP you want the event to have.
           Turn Self Switch A on.

Page 2: Check if Self Switch A is on.
           Label it with a label (Like Label: Gagoh)
           Check what the variable is using a conditional branch.
           If the variable is less then half the HP then turn Self Switch B on. Otherwise:
           Check if the player has certain skills. (This could be tedious with conditional branches, but it's certainly do-able)
           Make a command window (Use skill: Fire, Ice, Thunder, Earth )
           Depending on which skill is used, a specific number of HP goes down.
           Ask if the player wants to continue hitting the object. If the player does, then make him jump to the label Gagoh.
           If he doesn't, then stop the event.

Page 3: Check if Self Switch B is on.
           Label it with a label (Like Label: Cozzie)
           Check what the variable is using a conditional branch.
           If the variable is zero then turn Self Switch C on. Otherwise:
           Check if the player has certain skills. (This could be tedious with conditional branches, but it's certainly do-able)
           Make a command window (Use skill: Fire, Ice, Thunder, Earth )
           Depending on which skill is used, a specific number of HP goes down.
           Ask if the player wants to continue hitting the object. If the player does, then make him jump to the label Cozzie.
           If he doesn't, then stop the event.

Page 4: Check if Self Switch C is on.
           Erase the Event.

Something along the lines of that plan should work.

***
Rep:
Level 82
We learn by living...
What is a command window? is that like an options list? And if it is, how do I get more than four options?

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
What is a command window? is that like an options list? And if it is, how do I get more than four options?

Yeah, a choice window. Sorry for my unclear wording. I don't think you can get more than four options unless you use a special script. You could always put the last choice as NEXT, and then link that to another choice window.

***
Rep:
Level 82
We learn by living...
I've managed to create a stone variable with 50 hit points that is reusable for 8 rocks on my screen, and appear to be able to attack and destroy each separately (sort of). When I leave and come back, they stay destroyed, although if you change your target, it only keeps track of the total for that variable. Not a terrible concern if you want to go through the trouble of making massive numbers of variables, or if you just focus all your attacks on one target at a time, everything works out.

I'll add a detailed tutorial in the tutorials section, but for now, suffice to say, you need like 5 event pages per item, and the last three are tricky, because they basically 1. check if hp are 0, 2. if so push you to next screen 3. on next screen, they push you to third screen while resetting the hp back to full.

This gives the weird effect of having destroyed an object while keeping the community access hit points at normal levels. The trick I used, since I couldn't figure out a way to say "if THIS event is hit..." I instead went with "if this is target # X" then (if hp = 0, destroy).

It's a relationship between current target and community Hp. It will probably be much more stable when the various targets have different types of hp. For example, 8 boulders made of Stone all access the same pool, but a scene with one guard, a magical suit of armor, and a stone golem all access unique hit point pools, so you can half-way kill the guard, then go attack the rock guy, then come back and your guard's hp are still where you left off.

I estimate 4 duplicate pools should be sufficient for most projects, and if you don't care, one is sufficient.

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
Seems like you've got it all worked out. Congrats, and I hope this system is as good as you make it sound.