English [Q]freeimage()

4 replies
Goto Page
To the start Previous 1 Next To the start
03.02.12 07:33:56 pm
Up
Iamle0
User
Offline Off
Hey.:) Can you tell me? Why when i move from "property"==11 (snow) to the normal floor (any other) freeimage(id) wont work, but when i move from snow to metal("property"==15) it works perfect.


Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
addhook("movetile","speed")

function speed(id,x,y)
freeimage(id)
        if (tile(x,y, "property")==15) then
          parse("speedmod "..id.." 20")
        elseif (tile(x,y, "property")==11) then
          parse("speedmod "..id.." 0")
          id1=image("gfx/sprites/block.bmp",1,1,132+id,id)
          imagecolor(id1,0,0,0)
          imagealpha(id1,0.9)
          imagescale(id1,640,480)
     else
          parse("speedmod "..id.." 0")
     end
end
03.02.12 07:45:09 pm
Up
Zins
User
Offline Off
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
addhook("movetile","speed")

 function speed(id,x,y)
 freeimage(id)
 if (tile(x,y, "property"==11) then
           parse("speedmod "..id.." 20")
 elseif (tile(x,y, "property"==11) then
           parse("speedmod "..id.." 0")
           id1=image("gfx/sprites/block.bmp",1,1,132+id,id)
           imagecolor(id1,0,0,0)
           imagealpha(id1,0.9)
           imagescale(id1,640,480)
      else
           parse("speedmod "..id.." 0")
      end
 end

try this maby it work's
edited 1×, last 03.02.12 08:10:32 pm
04.02.12 04:32:09 am
Up
MikuAuahDark
User
Offline Off
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("movetile","speed")
function speed(id,x,y)
        if tile(x,y,"property")==15 then
          parse("speedmod "..id.." 20")
        elseif tile(x,y, "property"==11) then
          parse("speedmod "..id.." 0")
          id1=image("gfx/sprites/block.bmp",1,1,132+id,id)
          imagecolor(id1,0,0,0)
          imagealpha(id1,0.9)
          imagescale(id1,640,480)
     else
          parse("speedmod "..id.." 0")
     end
     freeimage(id1)
end

untested!
Hello? Are you there, Tae Hanazono?
04.02.12 08:50:28 am
Up
Iamle0
User
Offline Off
It wont work for me.. Look what i mean here:
http://youtu.be/pSW1os3-xlo
04.02.12 10:07:57 am
Up
MikuAuahDark
User
Offline Off
im tired now. im busy. so later!
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
fimage=true
addhook("movetile","speed")
function speed(id,x,y)
     if tile(x,y,"property")==15 then
          parse("speedmod "..id.." 20")
          if fimage==false then
               freeimage(id+1)
               fimage=true
          end
     elseif tile(x,y, "property"==11) then
          parse("speedmod "..id.." 0")
          id+1=image("gfx/sprites/block.bmp",1,1,132+id,id)
          imagecolor(id1,0,0,0)
          imagealpha(id1,0.9)
          imagescale(id1,640,480)
          fimage=false
     else
          parse("speedmod "..id.." 0")
          if fimage==false then
               freeimage(id+1)
               fimage=true
          end
     end
end
Hello? Are you there, Tae Hanazono?
To the start Previous 1 Next To the start