Jump to content

Destroying a Static with Melee via Script


KDStudios

Recommended Posts

Hey guys.

 

The below problem has been sorted, however I'm always needing more help. If anyone has any scripting knowledge please click here for more info on what help I need with and any posts that are posted after the linked post.

Wiccan0witch has stopped modding indefinitely and it's fallen upon me to finish and continue working on her Falloutcraft mod.

 

So far I have broke through two of her big problems with the mod.

 

I've finally created a model for some of the blocks she had trouble creating (For saplings, flowers, mushrooms etc)So I got that done, now I need to add the texture (Simple enough really, I can do that in 5 seconds! :D )

 

A spoiler for it if you're curious but it is unrelated to the issue I'm having.

http://img641.imageshack.us/img641/8403/blockg.jpg

 

Secondly I created a non-movable static Block model that she was having trouble making. So now certain blocks won't move from the walls anymore :)

 

Right so now my main issue is creating a script to destroy an object after meleeing it a certain amount of times. Perhaps with a certain weapon.

Arcoolka had something partially like it in his RTS mod where you can chop down tree's. But he's far too busy to have me bother him with most likely a trivial scripting answer.

 

So I come to you, the nexus community for help.

I'm not the best at scripting, but any pointers or help you can provide would be amazing!

 

Edit01:

Okay so I've dug around a bit and created a basic, small script that actually does part of what I want it to do.

Here it is:

scn 0MCWoodHarvestScript

Begin OnHitWith 0WeapAxeIron

player.additem mcblockwood 1

disable

endif

end

So basically what the script does is that the block is an activator, if it gets hit by any other melee weapon. Nothing happens. But if I hit it with the Iron Axe. The player receives 1 block of wood.

Now all I need to do is figure out how to make that block disappear. Ha it appears all I needed to do was add "Disable"

What now?

Okay so now that I've got destroying the block out of the way... Now I need to figure out how to add them to the world.

There is two problems.

1) They are currently Static only

2) If I made them Havok enabled I won't be able to make levels

Suggestions?

Edited by KDStudios
Link to comment
Share on other sites

  • Replies 49
  • Created
  • Last Reply

Top Posters In This Topic

I would add them as Activators, not statics and just give them a low HP level.

 

The script u should have on it is (can't remember in a hurry) but death = 1 or disable = 1, gives the player the wood.

 

Edit: Ah, Dunno if this helped. Cos in the question u wrote static and another place activator. But can answer something else, it needs to have havok/collision, else the weapon would not hit it.

You could perhaps try a script telling that if the player uses a weapon very very very near it, even a special weapon, it would then disable. Then it might not require havok.

Edited by rausheim
Link to comment
Share on other sites

Well I've managed to succeed in what I wanted to do when I started this topic.

The script is surprisingly very simple.

And I mis-typed. I am using Activators :)

They have collision, but they musn't have hovok. I had to remove that.

 

But yeah the script is something like:

 

scn 0BlockHarvestScript (Can be anything)

 

 

Begin OnHitWith 0WeapAxeIron ; The Activator will run this when hit by the Iron Axe

player.additem MCBlockWood 1 ; 1 block of wood will be added to the players inventory

Disable ; Disables the Activator using the script, causing it to disappear.

End

 

(Obviously the script with have indentations and the like, Nexus doesn't like indentations)

 

Here's the scripts in action.

http://www.youtube.com/watch?v=VlcXqIA-zkw

 

 

 

Now what I need to figure out is how to bring those activators back via dropping them from inventory...

Problem is... Activators won't go inside an inventory as an item :/

Hmmm

Link to comment
Share on other sites

Ah yes!

Can't believe I didn't think of that.

Works like a charm!

 

Now it spawns in thin air, but that is fine.

I figured I wouldn't be able to fend off Feng Shui forever :)

 

Wiccan had plans to incorporate Feng Shui into Falloutcraft but never got around to it, or couldn't get it to work. I never asked. Nor can I be bothered rooting around her laptop to see if she has.

(She's asleep right now, 3:10am here)

However Falloutcraft received permission from HugePinball to incorporate it so that's what I'll do, unless I find some other alternative to move the object properly.

 

Anyway thanks a lot for your help, always been a fan of your work anyway :)

If I could give you another kudos that I gave you back when you released Starship Troopers I would do :)

Link to comment
Share on other sites

Since you gave me those kind words, here's another one you can try regarding spawning in thin air ;-)

 

I'm not 100% sure this will work, but (if I remember right) I have something similar in my "Get out of spaceship"-script.

 

scn TheScriptName

 

ref ItemDropped

var PlayerPosZ

 

begin ondrop

player.placeatme ThatActivatorUwant 1

set ItemDropped to player.placeatme ThatActivatorUwant 1

set player.getpos z to PlayerPosZ

ItemDropped.setpos z to PlayerPosZ

disable

end

Link to comment
Share on other sites

Okay, changing it to ref got past that problem.

Now it's saying "Unknown Variable 'getpos'."

 

Here's the script.

 

 

scn 0MCGrassUnHarvestScript

 

ref ItemDropped

ref PlayerPosZ

 

begin ondrop

player.placeatme 0MCHGrassHarvest 1

set ItemDropped to player.placeatme 0MCHGrassHarvest 1

set player.getpos z to PlayerPosZ

ItemDropped.setpos z to PlayerPosZ

disable

end

 

Ps. I appreciate the help you're giving me, I'd be utterly clueless and staring into space without you. :P

Edited by KDStudios
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...