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

20 replies
Goto Page
To the start Previous 1 2 Next To the start
Up
Mora_rus
User
Offline Off
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:http://i.pixs.ru/storage/5/2/8/Jestarrowp_3937657_12497528.png

The image show's example is:
IMG:http://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
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
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)
10.06.14 05:09:53 pm
Up
Rainoth
Moderator
Offline Off
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?
10.06.14 05:21:25 pm
Up
AlcatrazZ
BANNED
Offline Off
Code:
object(id,'x')
object(id,'y')

id = image id
image_id = image(...)
Other >
Ban Reason: Multiple Accounts
10.06.14 05:33:37 pm
Up
Mora_rus
User
Offline Off
@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.
Code:
1
LUA ERROR: sys/lua/7.lua:376: attempt to index global 'Player' (a nil value)

Code:
1
ERROR: cannot play sound 'sfx/RainingMammoths/Grenades/grenade_chill.wav' - file does

that i get:
IMG:http://i6.pixs.ru/storage/9/3/6/123123132p_8952244_12498936.png
edited 1×, last 10.06.14 05:46:21 pm
10.06.14 05:43:01 pm
Up
Rainoth
Moderator
Offline Off
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.
10.06.14 05:48:23 pm
Up
Mora_rus
User
Offline Off
@user Rainoth: but i dont understeand what i can take from...
i never work with images...
10.06.14 06:10:06 pm
Up
Rainoth
Moderator
Offline Off
Ok I'll try to cut out the parts you need.
Also, you don't mind if I send you the image through your mail?
10.06.14 06:24:14 pm
Up
Mora_rus
User
Offline Off
@user Rainoth: not, of course) (i mean you can, why ask?)
edited 1×, last 10.06.14 06:29:47 pm
10.06.14 06:24:20 pm
Up
Alpha Beta
User
Offline Off
Spoiler >
edited 7×, last 27.06.14 08:34:30 pm
10.06.14 06:29:17 pm
Up
Mora_rus
User
Offline Off
@user Alpha Beta: the code is work, but
Code:
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...
10.06.14 06:32:32 pm
Up
Rainoth
Moderator
Offline Off
The Code >


If you need the image. Tell me.
edited 1×, last 10.06.14 06:41:33 pm
10.06.14 06:34:15 pm
Up
Alpha Beta
User
Offline Off
user Mora_rus has written:
@user Alpha Beta: the code is work, but
Code:
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.
10.06.14 06:45:54 pm
Up
Mora_rus
User
Offline Off
@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:
Code:
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
10.06.14 07:31:01 pm
Up
Rainoth
Moderator
Offline Off
Then you either created wrong folder names or the file format is wrong. If you really can't do it, I could TeamView you.
10.06.14 07:40:21 pm
Up
Mora_rus
User
Offline Off
@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:http://i7.pixs.ru/storage/7/8/6/123123132p_6106375_12500786.png

When i attack...
10.06.14 09:00:16 pm
Up
Rainoth
Moderator
Offline Off
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.
11.06.14 06:07:55 am
Up
Mora_rus
User
Offline Off
@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:http://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
11.06.14 12:24:02 pm
Up
Alpha Beta
User
Offline Off
You don't need that fade-out crap.
I updated my code. It can now do multiple arrows.
11.06.14 12:44:32 pm
Up
Mora_rus
User
Offline Off
@user Alpha Beta: maybe i better know what i need? lol.
i need it.
And how i can remake imagecolor from:
Code:
1
imagecolor(arrowstuff.arrows[n].img, math.random(255), math.random(255), math.random(255))

to:
Code:
1
parse("effect \"flare\" arrowstuff.arrows[n].img 32 32 255 0 0")
11.06.14 01:00:08 pm
Up
Alpha Beta
User
Offline Off
If you don't want colored arrows, change the line
Code:
1
arrowstuff.colored = true

to
Code:
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