Forum

> > CS2D > Scripts > Image as ammo, or same like this...
Forums overviewCS2D overview Scripts overviewLog in to reply

English Image as ammo, or same like this...

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

old Image as ammo, or same like this...

Mora
User Off Offline

Quote
Hello everyone
I wanna ask for something, if you dont wanna to do that, just don't do and don't comment...
Here is image arrow:
IMG:https://i.pixs.ru/storage/5/2/8/Jestarrowp_3937657_12497528.png

The image show's example is:
IMG:https://i7.pixs.ru/storage/6/3/5/228png_5393625_12497635.png

As you can see this image stop at wall and one thing: this image will hide after stop at wall by 1.0 to 0.0 and remove then.
Also the parametrs is
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
image = "gfx/Jestarrow.png"
speed = 3
dmg = 3

function initArray(m)
     local array = {}
     for i = 1, m do
          array[i]=m
     end
     return array
end

arrowthrow=initArray(32,0)

addhook("attack","atattack")
function atattack(id,weapon)
	if weapon == 50 then
		arrowthrow(id)
	end
end

addhook("always","chekar")
function chekar()
		updatearrowl(i)
	end
end
Do someone know about or already have?
Thanks for help)

old Re: Image as ammo, or same like this...

Rainoth
Moderator Off Offline

Quote
It seems you're talking about custom projectile.
Gimme a minute, I'll dig up a script I've been working on >.>

// Here it is. Mind that it's not only what you need so just take parts that you need.
The code >


/// No idea why code tags don't work. Anyone care to explain?

old Re: Image as ammo, or same like this...

AlcatrazZ
BANNED Off Offline

Quote
object(id,'x')
object(id,'y')

id = image id
image_id = image(...)
Other >

old Re: Image as ammo, or same like this...

Mora
User Off Offline

Quote
@user Rainoth: i talk about like this:
http://www.unrealsoftware.de/files_show.php?file=966
but is not stop at walls, and when i again use serveraction, the image is hide( as freeimage).
you just forget to put the "}" and here is new error.
1
LUA ERROR: sys/lua/7.lua:376: attempt to index global 'Player' (a nil value)
1
ERROR: cannot play sound 'sfx/RainingMammoths/Grenades/grenade_chill.wav' - file does
that i get:
IMG:https://i6.pixs.ru/storage/9/3/6/123123132p_8952244_12498936.png
edited 1×, last 10.06.14 05:46:21 pm

old Re: Image as ammo, or same like this...

Rainoth
Moderator Off Offline

Quote
I didn't tell you to run my lua. I told you to take parts that you need as I know for sure that the bullets and bouncing bullets work perfectly and you want exactly those. The errors can happen cause I dropped that project and it might not work how intended, also you don't have image and sound files so you get those errors too.

old Re: Image as ammo, or same like this...

Alpha Beta
User Off Offline

Quote
Spoiler >
edited 7×, last 27.06.14 08:34:30 pm

old Re: Image as ammo, or same like this...

Mora
User Off Offline

Quote
@user Alpha Beta: the code is work, but
1
LUA ERROR: sys/lua/AT.lua:45: attempt to index field '?' (a nil value)
i think this error dont get me for make more arrows by one attack, and hide image when it stop at wall...

old Re: Image as ammo, or same like this...

Rainoth
Moderator Off Offline

Quote
The Code >


If you need the image. Tell me.
edited 1×, last 10.06.14 06:41:33 pm

old Re: Image as ammo, or same like this...

Alpha Beta
User Off Offline

Quote
user Mora has written
@user Alpha Beta: the code is work, but
1
LUA ERROR: sys/lua/AT.lua:45: attempt to index field '?' (a nil value)
i think this error dont get me for make more arrows by one attack, and hide image when it stop at wall...


I made it like that, because it would be unfair if you shot 1000 arrows at the same time.
And do you mean to fade out the arrow? I found it not so important, either.

old Re: Image as ammo, or same like this...

Mora
User Off Offline

Quote
@user Rainoth: i make by myself grenade, but i always got error that i can't load it, i make folders for this path, and just image 'grenade.bmp' rename to 'bullet.bmp' and i dont get it, i have error when attack : here is:
1
LUA ERROR: image - can't load image at 'gfx/sprites/RainingMammoths/Jail/bullet.bmp'
@user Alpha Beta:
I will make it for machete, so i will shot it not so fast, and i do it for admin.
Fade out, yeah, when it stop at wall(not obstacle) it will fade out for 3 sec, just hide from 1.0 to 0.0 and remove complecty...
sorry my english is terrible than my internet...
edited 1×, last 10.06.14 07:16:08 pm

old Re: Image as ammo, or same like this...

Mora
User Off Offline

Quote
@user Rainoth: is not wrong, i'm sure 100%, i make in the cs2d/gfx/RainingMammoths/Jail/bullet.bmp folder, with my art(as bullet.bmp)
but!
i remake it to Jesarrow.png and it work, but it spawns on my tile, where i coming, i'll take screen now...
:
IMG:https://i7.pixs.ru/storage/7/8/6/123123132p_6106375_12500786.png

When i attack...

old Re: Image as ammo, or same like this...

Rainoth
Moderator Off Offline

Quote
Apologies, It seems that I had only the bouncing bullet flying mechanics. Lemme update it real quick.

// Here it is
The code >


I tested and it works.

old Re: Image as ammo, or same like this...

Mora
User Off Offline

Quote
@user Rainoth: when it come at wall i get error:
LUA ERROR: sys/lua/AT.lua:118: attempt to index local 'projectile' (a nil value)
i think this get error that i can't hide it when stoped.
And it not stop at player.
@user Alpha Beta: Is again not stop's at wall and hide, also i can't make more arrows.
Guys, i try to make "GIF" image for show.
IMG:https://catchmypicture.com/mzGEeN.jpg

But when it stop at player it will just hide fast.
Arrow unlimited flying.
edited 5×, last 11.06.14 11:51:27 am

old Re: Image as ammo, or same like this...

Mora
User Off Offline

Quote
@user Alpha Beta: maybe i better know what i need? lol.
i need it.
And how i can remake imagecolor from:
1
imagecolor(arrowstuff.arrows[n].img, math.random(255), math.random(255), math.random(255))
to:
1
parse("effect \"flare\" arrowstuff.arrows[n].img 32 32 255 0 0")

old Re: Image as ammo, or same like this...

Alpha Beta
User Off Offline

Quote
If you don't want colored arrows, change the line
1
arrowstuff.colored = true
to
1
arrowstuff.colored = false

And when should that flare effect appear? When you kill a player?
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview