Cleaning up mines and oil slicks
Cleaning up mines and oil slicks
Mines and oil are OK when used dynamicly, during the pursuit. But with oil you can for example permanently block access to electrogun on tiny town and mines can turn GTA2 into mine sweaper game. So I wonder if it's posible on the script level to:
a) make mines and oil disappear X seconds after planting
b) make the limit of simulaniously existing mines on the map really small, like 3 for example; same for oil
c) clean up whole map from mines and oil every X seconds
Any ideas?
a) make mines and oil disappear X seconds after planting
b) make the limit of simulaniously existing mines on the map really small, like 3 for example; same for oil
c) clean up whole map from mines and oil every X seconds
Any ideas?
Re: Cleaning up mines and oil slicks
If you place many of them then the old ones vanish. You could try creating many oil slicks using script to see if that clears old ones.
Re: Cleaning up mines and oil slicks
afaik destructors delete oil and mines. you can switch them on or off(create/delete) when you need them. Unfortunately they do not work inside a while_exec loop
yur sa'nok ngeyä
Re: Cleaning up mines and oil slicks
DELETE_ITEM doesn't remove DESTRUCTORs. SWITCH_GENERATOR can turn them off but it can't turn them back on.
Does CREATE_DESTRUCTOR even work? There was nothing created when I used it. I can create them with DESTRUCTOR name but that means each one has to have a unique name.
Does CREATE_DESTRUCTOR even work? There was nothing created when I used it. I can create them with DESTRUCTOR name but that means each one has to have a unique name.
Re: Cleaning up mines and oil slicks
Can I create 100 mines with a nice little loop or do I have to write CREATE_OBJ 100 times?Sektor wrote:If you place many of them then the old ones vanish. You could try creating many oil slicks using script to see if that clears old ones.
Re: Cleaning up mines and oil slicks
You can use a loop to create objects. I tested it and the oil that I started on vanished.
Code: Select all
PLAYER_PED player = (50.5, 46.5, 2.0) 25 0
OBJ_DATA slick
COUNTER loop = 1
LEVELSTART
slick = CREATE_OBJ ( 50.5 , 46.5 ) 0 OIL END
WHILE_EXEC ( loop < 100 )
slick = CREATE_OBJ ( 50.5 , 45.5 ) 0 OIL END
++loop
ENDWHILE
LEVELEND
Re: Cleaning up mines and oil slicks
i experimented with destructors on tiny tiny town army. i have in mind that i got something work at least a bit but i have to check. chances exist but it is not a very good method anyway.
yur sa'nok ngeyä
Re: Cleaning up mines and oil slicks
This constantly creates oil in one spot. Oil will vanish and mines will explode.
You can make objects explode/vanish even faster by duplicating the slick = CREATE_OBJ line.
Code: Select all
//script meant for ste.gmp and ste.sty
PLAYER_PED p1 = (50.5, 50.0, 2.0) 25 0
PARKED_CAR_DATA car = (51.5, 50.0, 2.0) 0 0 GT24640
OBJ_DATA slick
COUNTER loop = 1
LEVELSTART
GIVE_WEAPON ( car, CAR_OIL )
GIVE_WEAPON ( car, CAR_MINE )
slick = CREATE_OBJ ( 50.5 , 50.0 ) 0 OIL END
WHILE_EXEC ( loop = 1 )
slick = CREATE_OBJ ( 50.5 , 51.0 ) 0 OIL END
ENDWHILE
LEVELEND
Re: Cleaning up mines and oil slicks
Works great, Sektor! But it should bo slower, not faster, so this is what I ended with:
But here comes the questions:
1. Oil and mines have common limit. Does this limit affect some other objects too?
2. Is it possible to make oil's time to live longer than mine's?
Code: Select all
WHILE_EXEC (loop = 1) //the main loop
SET cleaner = (cleaner + 1)
IF (cleaner = 10) // here you can balance objects time to live, 10 works for me - its about half a minute
SET cleaner = 1
theoil = CREATE_OBJ ( 0.5 , 0.5 ) 0 OIL END
ENDIF
// other stuff ...
1. Oil and mines have common limit. Does this limit affect some other objects too?
2. Is it possible to make oil's time to live longer than mine's?
Re: Cleaning up mines and oil slicks
1. I believe all objects share the same limit. So if there were footballs on the map then they would be removed if you dropped 88 mines.
2. No.
2. No.