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 Lua prob - images

Deleted User

Quote
I got some problem with image! I load image and none can see them! I added all files in servertransfer.lst, I make sure that the path is correct but ONLY I can see them! Why! I even joined the same server from two clients, and both of them can see images! I send script to my friend and he can't see images even on HIS server D:! WTF D:<

Edit: Also files are in friends gfx folders, but still he dont see images
edited 1×, last 09.06.12 06:51:33 pm

old Re: Lua prob - images

TimeQuesT
User Off Offline

Quote
Image size? (file size)
Did you add an additional parameter after the mod?
like:

image("gfx/sprites/block.bmp",100,100,0,1); ?

old Re: Lua prob - images

Deleted User

Quote
I said, that NOT. And if I join to my server from two clients, I can see the images from both client

old Re: Lua prob - images

DC
Admin Off Offline

Quote
Show the code that is used to display the images. Also tell us the image file size (how many bytes / kb).

old Re: Lua prob - images

Deleted User

Quote
1
table.insert(laserturrets, {x = x, y = y, turretimg = image(config.turretimg, x * 32 + 16, y * 32 + 16, 1), turretlightingimg = image('gfx/sprites/flare1.bmp', x * 32 + 16, y * 32 + 16, 1), turretshooterimg = image(config.turretshooterimg, x * 32 + 16, y * 32 + 16, 1), object = obj, lasers = 0, cntdwn = 0, team = player(id, 'team'), player = id, rotation = player(id, 'rot'), rootrotation = player(id, 'rot'), rotationvar = 1, rotcntdown = config.turretrotationcooldown})

3.05 kb
494 bytes
70 bytes

And the last image have got EVERY player in their gfx folder (gfx/flare1)

P.S they don't see any of them

P.S2 Even when my friend start server with this script. HE CANT see the images!!! And still he got all the images in the GFX folder!!!
edited 1×, last 10.06.12 02:15:28 pm

old Re: Lua prob - images

SkullzOrig
User Off Offline

Quote
Its rather strange since they have the graphics, but when your friend ran the script?! Hmm, this is a thinker. Make sure to check your parameters. I myself have noticed this problem when running in my zombie server, they could not even see the wall image. I can but I am not able to see the laser. Im not sure, it could be the directory of the image typed in. Possible did not find the image when loading the lua and files.

old Re: Lua prob - images

Deleted User

Quote
user SkullzOrig has written
I will check for bugs, or unfinished lines. Hopefully the problem will be revealed.

Thanks, now I will try to make all images to PNG format
Edit: DAMN STILL.

old Re: Lua prob - images

SkullzOrig
User Off Offline

Quote
This is good thing but bad at same time. I found a problem with a hooke on line 32:

addhook('buildattempt', 'buildattempt_hook')


--Here is a msg from CS2D console--
laserturrets.lua:32: attempt to call global 'addhook' (a nil value)

hope this helps

old Re: Lua prob - images

Deleted User

Quote
user SkullzOrig has written
This is good thing but bad at same time. I found a problem with a hooke on line 32:

addhook('buildattempt', 'buildattempt_hook')


--Here is a msg from CS2D console--
laserturrets.lua:32: attempt to call global 'addhook' (a nil value)

hope this helps

WTF, how the heck addhook can be nil?! Confused x5464

old Re: Lua prob - images

Deleted User

Quote
user Yates has written
When you don't have a function for it.
Then it will not return NIL to function ADDHOOK!
It will be just Nil without line

old Re: Lua prob - images

SkullzOrig
User Off Offline

Quote
It funny how little things make bigger problems. I used Scite to double check on it and it says in the bug msg:

Message: laserturrets.lua:32: attempt to call global 'addhook' (a nil value)
[1]     Lua in ...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:1505 ***
[2]     addhook in [C]:-1
[3]     main in laserturrets.lua:32
[4]     C in [C]:-1

And the line it selected was 32 and the line reads:

addhook('buildattempt', 'buildattempt_hook')

I wasn't sure I was only seeing this or not.

old Re: Lua prob - images

Flacko
User Off Offline

Quote
OMFG. When will you people understand that image(path,x,y,m) does NOT fucking mean that x and y will be the image's starting coordinates. They don't have anything to do with that. If you read the fucking documentation (cs2d lua cmd image) you will find out that there is cs2d lua cmd imagepos to do so.
@user SkullzOrig: OFC SciTE's Lua interpreter doesn't have the cs2d lua cmd addhook function built in as it's CS2D-specific.

old Re: Lua prob - images

SkullzOrig
User Off Offline

Quote
So I was correct the first time about the parameters then? And I had seen the addhook prob in CS2D console when you start server.

old Re: Lua prob - images

Flacko
User Off Offline

Quote
user SkullzOrig has written
So I was correct the first time about the parameters then? And I had seen the addhook prob in CS2D console when you start server.

Vaguely, but yes, you were somewhat right. About your other addhook problem, triple-check it. Make sure you're not including any extra scripts. A call to setfenv can also make a call to addhook fail.

old Re: Lua prob - images

Deleted User

Quote
So how to fix it Flacko, And then why I can see them... and they are on correct position!
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview