Forum

> > Stranded II > Scripts > on drop how to make an item disappear
Forums overviewStranded II overview Scripts overviewLog in to reply

English on drop how to make an item disappear

4 replies
To the start Previous 1 Next To the start

old on drop how to make an item disappear

JasJack67
Super User Off Offline

Quote
Id like to make an item disappear on drop

I have tried freestored "item" but get a memory access violation...probably because the item is no longer stored when i drop it

also tried to use the alteritem instead, i would be happy to make the item change to another item...but it was like the code didnt exist when i ran it.

also tried alterobject...because nothing was working...but thats an error too as i want an "item" changed or disappear.

heres what i have but the alteritem does not alter it to 24
1
2
3
4
5
6
on:drop {
			alteritem ,1,24;
		        freetimers "self",1;
		        freestate "unit",1,24;
                        msg "Oops! I've dropped my torch!",3,6500;
                     }

i want the torch to disappear or change to a branch in this code above...while i have freed the prior timer and state.

thank you in advance for any ideas.

old Re: on drop how to make an item disappear

Hurri04
Super User Off Offline

Quote
then try:
1
2
3
4
5
on:drop {
	alteritem 1, [TORCH-TYPE], 1, 24;
	msg "Oops! I've dropped my torch!",3,6500;
	skipevent;
}
experiment a little with it. I think though that the skipevent command has to be in the last line or anything after it will be ignored...

old Re: on drop how to make an item disappear

JasJack67
Super User Off Offline

Quote
Hey again Hurri Thanks!

your answer lead me to resolution!

the skipevent made the torch stay in my rucksack even after i tried to "drop it"...so i then used the freestored and find to get the result i wanted.

which was to, on drop, make the torch disappear and get the branch back from it.

before the script on:drop, i have taken a branch and wool from my rucksack, lit it on fire at a fire, for making a torch. Upon making the torch a timer goes off showing the state of Light icon, for 1 minute...after 1 minute the icon goes away and the torch burns out (turns back into a branch.)

if you drop the torch during this 1 minute period it ruined the above sequence of events...as the torch would simply lay on the ground after the 1 minute timer expired...so i wanted the torch to go out, and you have to make a new torch, if you drop it;

is the reason for this script and explains the freetimer/freestate:

so this was the script in whole.
1
2
3
4
5
6
7
8
on:drop {
		            freetimers "self",1;
		            freestate "unit",1,24;
                      msg "Oops! I've dropped mytorch!",3,6500;
                      skipevent;
                      freestored "unit",1,111,1;
                      find 24;
        }

thanks so much Hurri, i worked on this for couple days now!
edited 2×, last 31.10.12 01:45:58 am
To the start Previous 1 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview