Page 1 of 1

how do i remove an item while i am playing?

Posted: Mon Jan 13, 2020 7:27 pm
by ratman
such as if the player takes an item from an altar, I would want it to remove a "swamp_sky_1". does anyone know how to do this? thanks in advance.

Re: how do i remove an item while i am playing?

Posted: Mon Jan 13, 2020 11:52 pm
by Isaac
For which game? (Presumably LoG2; because it's a Sky.)

This is usually done via script, in a script_entity.

Every object has a destroy:() method.

you can destroy an object in either game, by calling the [[ object.id ]] : destroy()

For example:

Code: Select all

swamp_sky_1:destroy()
___

Create (or select) a script_entity on the map, and paste the following into it:

Code: Select all

function destroySky(self)
	if findEntity:("swamp_sky_1") then
		findEntity:("swamp_sky_1"):destroy()
	end 
end
If you wish to destroy the sky object due to the player's action at a specific time, you can activate the script by connecting any trigger object to the script.

Re: how do i remove an item while i am playing?

Posted: Mon Jan 20, 2020 1:25 am
by ratman
thanks