Jump to content

Recommended Posts

Posted

Hello, for all... sorry for bad english... Im German.

 

How do the lines look like to turn a ship into a wreck?

 

I'm not very familiar with LUA and I'm learning by doing ... I hope the question is okay

 

In the documentation I've already looked but all I've tried has not worked :D

 

Greetz

  • Boxelware Team
Posted

There's multiple ways, you could just damage it with its current HP, basically destroying it.

 

The other way would be to remove the ship and create a wreckage in its place. Copy the plan and position and create a wreckage with the same plan and position.

Posted

 

I am now using the lines from the wreckagetoship.lua

 

if not interactionPossible(callingPlayer) then
        print ("no interaction possible")
        return
    end

    local wreckage = Entity()
    local plan = wreckage:getPlan()

    -- set an empty plan, this will both delete the entity and avoid collisions with the ship
    -- that we're creating at this exact position
    wreckage:setPlan(BlockPlan())

    local ship = Sector():createShip(Player(callingPlayer), wreckage.name, plan, wreckage.position)

    AddDefaultShipScripts(ship)
    terminate()

 

It is now removed as desired, but no new is generated?

  • 1 year later...
Posted

hey ive the idea to make a script so you can make wrecks into ships again, if possible i need to know how, then we can add a price for a try and a

chance of success for the try so then bigger the craft and better matterials it has then more if will cost or fail...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...