Forum

> > CS2D > Scripts > Sprite ask
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Sprite ask

11 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Sprite ask

tos12345678
User Off Offline

Zitieren
Hi, i need lua cmd which will be spawning sprite and make explode effect on the specific place map every restart.
e.g. timer 10000 parse sprite + explode x*2100 y*2600
Thanks for help!

alt Re: Sprite ask

GeoB99
Moderator Off Offline

Zitieren
A straight way to do this is by using cs2d lua hook endround hook and then do a condition check if the mode is 5 (round restart). Then use cs2d lua cmd timer with cs2d lua cmd image with the path location of the sprite and coordination and cs2d lua cmd timer with cs2d cmd explosion with the same coordination like where you place the sprite.

Make sure the damage parameter of cs2d cmd explosion command must be 0 in case you don't want the explosion effect hurting nearby players.

alt Re: Sprite ask

Masea
Super User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
duration = 1000

imagePath = "gfx/block.bmp"
x = 320
y = 240

explosionDamage = 0
explosionSize = 24

addhook("startround","_s")
function _s()
	timer(duration, "_explosion")
end

function _explosion()
	image(imagePath, x, y, 0)
	parse("explosion "..x.." "..y.." "..explosionSize.." "..explosionDamage.." 0")
end
@user GeoB99: I don't get why you use cs2d lua hook endround instead of cs2d lua hook startround

alt Re: Sprite ask

Avo
User Off Offline

Zitieren
^ yeah, it's more like CS2D BOFCTG (bunch of functions changing the gameplay).

alt Re: Sprite ask

VaiN
User Off Offline

Zitieren
here ya go: cs2d lua cmd image
Zitat
Mode 201-232: draw over this player (id+200)

Example:
1
local img_id = image(imgpath, 1, 0, 200 + id)

alt Re: Sprite ask

Masea
Super User Off Offline

Zitieren
@user tos12345678: Okay? What. The. Fuck. Did you even try?

It should be 1 or 3. Between 201 and 232 are for player images.

alt Re: Sprite ask

tos12345678
User Off Offline

Zitieren
Ye i tried, later i searched that 1,2 for players
And 3,4 for cover pl map
Sorry all working
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht