how do i remove an item while i am playing?

Talk about anything related to Legend of Grimrock 2 here.
Post Reply
User avatar
ratman
Posts: 159
Joined: Fri Jan 10, 2020 1:13 am

how do i remove an item while i am playing?

Post 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.
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

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

Post 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.
User avatar
ratman
Posts: 159
Joined: Fri Jan 10, 2020 1:13 am

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

Post by ratman »

thanks
Post Reply