English Object script

12 replies
Goto Page
To the start Previous 1 Next To the start
08.10.11 10:48:43 am
Up
Smile-Rus
User
Offline Off
All hello. The script on object destruction is necessary to me. If i destroy a(Env_Breakable) to appear a smoke.
08.10.11 11:29:03 am
Up
Trigger_Start:
Trigger = smoke

Gen_FX:
Name = smoke

Env_Breakable:
Trigger = smoke

It's easy. No need for scripts.
08.10.11 11:37:57 am
Up
Smile-Rus
User
Offline Off
Thanks for the help, but the script is necessary
08.10.11 11:48:20 am
Up
Kel9290
User
Offline Off
Code:
1
2
3
4
5
6
addhook("objectkill","_obj")
function _obj(i,p)
     if object(i,"tilex") == YOUR_ENTITY_POSITION_IN_TILE_X and object(i,"tiley") == YOUR_ENTITY_POSITION_IN_TILE_Y then
          parse("effect smoke "..object(i,"x").." "..object(i,"y").." 5 10")
     end
end

^
not tested
http://cs2d.com/help.php?cat=all&cmd=effect#cmd
under the stone.
08.10.11 11:49:02 am
Up
Bowlinghead
User
Offline Off
Code:
1
2
3
4
addhook("objectkill","lol")
function lol(x,y)
     parse('effect "colorsmoke" '..x..' '..y..' 0 0 255 010 010')
end


I think its work!
EDIT: 40 seconds
Share time limited free games here
08.10.11 12:12:16 pm
Up
Autumn
User
Offline Off
hey guys it does not work. It is necessary for me that after destruction Env_Breakable on its place there was a smoke.
Points Env_Breakable (x=33,y=133)
Spoiler >

I not so have made?
08.10.11 12:16:13 pm
Up
Bowlinghead
User
Offline Off
The addhook is wrong!
Code:
1
2
3
4
addhook("break","lol")
function lol(x,y)
     parse('effect "colorsmoke" '..x..' '..y..' 0 0 255 010 010')
end



objectkill is from wall1, turrets and so on!
Share time limited free games here
08.10.11 12:48:27 pm
Up
Autumn
User
Offline Off
it still does not work. I don't know why (
08.10.11 04:38:21 pm
Up
EngiN33R
Moderator
Offline Off
Code:
1
2
3
4
addhook("break","lol")
function lol(x,y)
parse('effect "smoke" '..(x*32+16)..' '..(y*32+16)..' 32 32')
end


I do believe the problem should be solved.
I code, therefore I exist. | Visit my blog for Lua tips and other interesting info
09.10.11 10:07:58 am
Up
Autumn
User
Offline Off
Yes, now it works, thanks. But how to make that a smoke went only from this (Env_Breakable) (x=33, y=133)?Because so after destruction of any (Env_Breakable) there is a smoke.
09.10.11 10:08:43 am
Up
Kel9290
User
Offline Off
Code:
1
2
3
4
5
6
addhook("break","lol")
function lol(x,y)
     if x==33 and y==133 then
          parse('effect "smoke" '..(x*32+16)..' '..(y*32+16)..' 32 32')
     end
end
under the stone.
09.10.11 10:36:26 am
Up
Autumn
User
Offline Off
Thanks, now all work as me it is necessary)
10.10.11 05:16:15 am
Up
Apache uwu
User
Offline Off
Actually you could do this in the map editor.

Since breakables are placed constantly in the map, there is no point of using a script to control this. Since your won't be able to move the breakables or add them in game.
To the start Previous 1 Next To the start