Forum

> > CS2D > Scripts > Lua prob - images
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua prob - images

23 replies
Page
To the start Previous 1 2 Next To the start

old Re: Lua prob - images

Flacko
User Off Offline

Quote
Change that ugly abominable code you posted before to the following:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
local turretimg = {
	image(config.turretimg, 0, 1, 1),
	image('gfx/sprites/flare1.bmp', 0, 1, 1),
	image(config.turretshooterimg, 0, 1, 1)
}
for i=1, 3 do
	imagepos(turretimg[i], x*32+16, y*32+16,0)
end
laserturrets[#laserturrets+1] = { --harder, better, faster, stronger
	x = x,
	y = y,
	turretimg = turretimg[1],
	turretlightingimg = turretimg[2],
	turretshooterimg = turretimg[3],
	object = obj,
	lasers = 0,
	cntdown = 0,
	team = player(id,'team'),
	player = id,
	rotation = player(id,'rot'),
	rootrotation = player(id,'rot'),
	rotationvar = 1,
	rotcntdown = config.turretrotationcooldown
}

I can't tell why you're seeing them in the right position. Images spawn at position (0;0) by default.
edited 1×, last 10.06.12 03:44:55 pm

old Re: Lua prob - images

Yates
Reviewer Off Offline

Quote
user SkullzOrig has written
Flacko went offline cause he didnt know what he was saying.

Will you shut that arrogant mouth of yours. Flacko is right, if you both paid attention to what cs2d.com help has to offer.. You wouldn't have this problem.

@user Infinite Rain: Use imagepos. I don't get how this would be so hard.

old Re: Lua prob - images

Deleted User

Quote
x, y IS WORKING WELL
we use this:
x<=0: do not rotate with player
x>0: rotate img with player
y<=0: only draw if not covered by fog of war
y>0: draw always

ONLY IF Mode is > 100 THAT's ALL!
Therefor the help says: Special meaning of x and y when drawing at player

And I ALWAYS see the images on right X|Y, and other players dont see images even on 0|0

-.-

Edit: ALso alistaire (IDK WHY) saw the images on the turret.

So Flacko is wrong
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview