Forum

> > CS2D > Scripts > Walking on a sprite.
Forums overviewCS2D overview Scripts overviewLog in to reply

English Walking on a sprite.

13 replies
To the start Previous 1 Next To the start

old Walking on a sprite.

Xirot
User Off Offline

Quote
The title say everythings.
Who can make this script?
When I made a sprite. It sounds like a metal floor , also peoples can walk on it.
I think it's impossible.

old Re: Walking on a sprite.

Rainoth
Moderator Off Offline

Quote
He said "walking on a sprite" so we can assume that he wants to make a sprite and then be able to walk over it.

You can do it in following way :

• Read the mode types
• Set your sprite
• Make a tile as "floor metal"
• Place it under the sprite.

old Re: Walking on a sprite.

Rainoth
Moderator Off Offline

Quote
Can you wait some time or a day ? I'm kinda playing LoL with few people (don't mean to go off topic)

I'll start writing it as soon as I can.

1
2
3
4
5
6
7
8
9
10
11
img = {}
img.image = image("gfx/sprites/potato.jpg"),x,y,0)

addhook("say","yes")
function yes(id,t)
	if t == "RainingMammoths" then
		img.image -- erm I forgot.
	elseif t=="Demonn" then
		freeimage(img.image)
	end
end

Not sure if this is correct. Let others fix it if it's wrong. I've never liked anything that has to do with images or sounds >.>
edited 1×, last 04.07.13 12:43:19 am

old Re: Walking on a sprite.

Xirot
User Off Offline

Quote
Well , I'll wait you son.
Just don't forget about me
The code
1
2
3
4
5
6
7
8
9
10
11
img = {}
img.image = image("gfx\!!!Demon-SAW2!!!\floors\floor-complicked1.bmp"),x,y,0)

addhook("say","yes")
function yes(id,t)
     if t == "RainingMammoths" then
          img.image -- erm I forgot.
     elseif t=="Demonn" then
          freeimage(img.image)
     end
end
The bug
1
sys/lua/a.txt:2 unexpected symbol near ')'
edited 1×, last 04.07.13 01:22:57 am

old Re: Walking on a sprite.

sheeL
User Off Offline

Quote
Try this

1
img.image = image("gfx/!!!Demon-SAW2!!!/floors/floor-complicked1.bmp"),x,y,0)

old Re: Walking on a sprite.

Rainoth
Moderator Off Offline

Quote
1
img.image = image("gfx/!!!Demon-SAW2!!!/floors/floor-complicked1.bmp",x,y,0)

Seriously. How hard is it to delete one bracket when it even tells you so in the error ? Also. I noticed that you wrote path with "\" instead of "/" so don't do that in the future.

EDIT : Why do you want it to be scripted ? Can't you just make it when mapping --" ?

old Re: Walking on a sprite.

Unnamed404
BANNED Off Offline

Quote
Well , I'm user Xirot:'s friend.
And while he's banned , I'm here to talk in his place.
He tested the codes and he wants to say :
user sheeL: The same bug message error still.
user Rainoth: Can you fix it , and give the full code in a comment please?

old Re: Walking on a sprite.

Rainoth
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
img = {}
img.image = image("gfx/!!!Demon-SAW2!!!/floors/floor-complicked1.bmp",x,y,0)

addhook("say","yes")
function yes(id,t)
     if t == "RainingMammoths" then
          img.image -- erm I forgot.
     elseif t=="Demonn" then
          freeimage(img.image)
     end
end

TIP :
• Place Env_sprite on map
• Click it
• In settings choose "Sprite covers pl." as uncrossed
• Done

This way you won't need a freaking script >.>
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview