Jump to content

Recommended Posts

Posted

I am trying for a long time to make a static object to get broken when I hit with a melee weapon. It is easy to do that when I hit with a bow, but I want do it with a axe example. Now I know OBSE has this ability with those functions : reference.GetObjectHealth ; reference.setObjectHealth but still don't know exactly how to do it. I have the object, it is a wooden plank animated for a broken damage, just need the script. Please help if someone know the script?!

Posted

Maybe can you do this with a OnHit effect by reproducing the pushable planks' script MPlanksBreakAway01Script.

 

Never tested it but I think it's worth trying.

Posted

Si if you hit a static object, which effect do you want it to have when it is broken? To look broken? If you want the object to look like you hit it, then you need to replace that object with a premade broken object I guess. A static is static after all... You can exchange a static object with another in a script but first you need to make the broken meshes.

Posted
  On 12/31/2020 at 12:55 PM, Oblivionaddicted said:

Maybe can you do this with a OnHit effect by reproducing the pushable planks' script MPlanksBreakAway01Script.

 

Never tested it but I think it's worth trying.

I AM SURE I DID IT BUT NOT WORKING WITH ONE HIT COMMAND IF I USE MELEE. STRANGE, IT IS WORKING WITH RANGE ATTACK, ARROWS OR EVEN SPELL MAGIC

Posted
  On 12/31/2020 at 3:09 PM, Pellape said:

Si if you hit a static object, which effect do you want it to have when it is broken? To look broken? If you want the object to look like you hit it, then you need to replace that object with a premade broken object I guess. A static is static after all... You can exchange a static object with another in a script but first you need to make the broken meshes.

Interesant. The problem is I want do that just after I will hit that static object with a axe. To replace with a script or put animation in that object is easy for me. How to do that after hit with weapon melee?

Posted
Scn BreakStaticObjectSCR

Float xPos
Float yPos
Float zPos

Float xAngle
Float yAngle
Float zAngle

Begin OnHit

	set xPos to OriginalObject.GetStartingPos x
	set yPos to OriginalObject.GetStartingPos y
	set xPos to OriginalObject.GetStartingPos z
	
	set xAngle to OriginalObject.GetStartingAngle x
	set xAngle to OriginalObject.GetStartingAngle y
	set xAngle to OriginalObject.GetStartingAngle z

	OriginalObject.disable
	
	BrokenObject.SetPos x xPos
	BrokenObject.SetPos y yPos
	BrokenObject.SetPos z zPos
	
	BrokenObject.SetAngle x xAngle
	BrokenObject.SetAngle y yAngle
	BrokenObject.SetAngle z zAngle

	BrokenObject.enable
end

That could work I guess

Posted
  On 1/1/2021 at 4:24 PM, ionoblivion said:

 

  On 12/31/2020 at 3:09 PM, Pellape said:
Pellape

 

  On 1/2/2021 at 12:32 AM, Pellape said:
Scn BreakStaticObjectSCR

Float xPos
Float yPos
Float zPos

Float xAngle
Float yAngle
Float zAngle

Begin OnHit

	set xPos to OriginalObject.GetStartingPos x
	set yPos to OriginalObject.GetStartingPos y
	set xPos to OriginalObject.GetStartingPos z
	
	set xAngle to OriginalObject.GetStartingAngle x
	set xAngle to OriginalObject.GetStartingAngle y
	set xAngle to OriginalObject.GetStartingAngle z

	OriginalObject.disable
	
	BrokenObject.SetPos x xPos
	BrokenObject.SetPos y yPos
	BrokenObject.SetPos z zPos
	
	BrokenObject.SetAngle x xAngle
	BrokenObject.SetAngle y yAngle
	BrokenObject.SetAngle z zAngle

	BrokenObject.enable
end

That could work I guess

 

Sorry my friend I tried what you proposed to me but no chance with melee to do it. Is working well with a spell or a bow but not melee. Seems that function Begin OnHit works only on npc.

 

Posted

Okay. I will give you another hint then...

 

In MOO, you can hit trees, flora and rocks with axes, hand scythes and pickaxes. The tools do not have scripts. It is not easy to follow Maskar's nested scripts, so I will not, well at least not now but take a look at his scripts as these tools acts exactly in the same way that you are looking for. If you do not find it, I might take a peek...

 

I am harvesting so much that I made Maskar a new Hand Scythe that most likely will be added in the next update :D

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...