Forum

> > CS2D > Scripts > Object script
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Object script

12 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Object script

Smile-Rus
User Off Offline

Zitieren
All hello. The script on object destruction is necessary to me. If i destroy a(Env_Breakable) to appear a smoke.

alt Re: Object script

Kel9290
User Off Offline

Zitieren
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

alt Re: Object script

Bowlinghead
User Off Offline

Zitieren
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

alt Re: Object script

Autumn
User Off Offline

Zitieren
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?

alt Re: Object script

Bowlinghead
User Off Offline

Zitieren
The addhook is wrong!
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!

alt Re: Object script

EngiN33R
Moderator Off Offline

Zitieren
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.

alt Re: Object script

Autumn
User Off Offline

Zitieren
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.

alt Re: Object script

Kel9290
User Off Offline

Zitieren
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

alt Re: Object script

Apache uwu
User Off Offline

Zitieren
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.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht