Forum

> > CS2D > Scripts > Walking on a sprite.
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Walking on a sprite.

13 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Walking on a sprite.

Xirot
User Off Offline

Zitieren
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.

alt Re: Walking on a sprite.

Rainoth
Moderator Off Offline

Zitieren
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.

alt Re: Walking on a sprite.

Rainoth
Moderator Off Offline

Zitieren
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 >.>
1× editiert, zuletzt 04.07.13 00:43:19

alt Re: Walking on a sprite.

Xirot
User Off Offline

Zitieren
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 ')'
1× editiert, zuletzt 04.07.13 01:22:57

alt Re: Walking on a sprite.

Rainoth
Moderator Off Offline

Zitieren
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 --" ?

alt Re: Walking on a sprite.

Unnamed404
BANNED Off Offline

Zitieren
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?

alt Re: Walking on a sprite.

Rainoth
Moderator Off Offline

Zitieren
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 >.>
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht