Lua Scripts/Questions/Help
89 replies
is there a way to make a ai/bot hud position a weapon?
you can set weapon_x and weapon_y and weapon_position in the AI script, though bot can be cheater with that (cause that's manipulating with weapon's script!)
anyway, for that you should check some collisions, 'cuz I made bot set turrets, and that bot puts it into a wall outside radius!
(that's possible for A.I. cuz they can change wpn variables, as I said in previous post)

How to get how many players alive atm ?
i tried
but failed
Havent worked with tables yet.
i tried
Code:
1
tostring(playertable(0.0))
but failed

Havent worked with tables yet.
It should work like that
Code:
the variable numberoflivingplayers is the number of players 1
numberoflivingplayers=#playertable(0,1)

http://www.carnagecontest.com/help_cmds.php?cat=player#cmd_playertable
nearly correct, just wrong parameters. second (include dead players) must be 0 of course.
nearly correct, just wrong parameters. second (include dead players) must be 0 of course.
Code:
1
numberoflivingplayers=#playertable(0,0)
I messed with that variable yesterday, but i thought its wrong because of an error.
Thanks. Now iam coming back to n++ and CC
Thanks. Now iam coming back to n++ and CC

To avoid creating another thread, I want to request something here, someone knows how to make a simple vertical laser moving to the right (always the same speed), that appears on x=0 when the player x<50?
instant kill the player on contact (yes, it's for a mission)

Should I come back and make one last map for CS2D?
How can i check if nubmer can divide to 50 and be integer, i mean like "5" not "5.2147535" ?
EDIT:
woops, nevermind, Wikipedia ftw, lol.
I found answer in that russian page http://en.wikipedia.org/wiki/Modulo_operation english have answer too.
I didnt have idea to found it there o-o'
EDIT:
woops, nevermind, Wikipedia ftw, lol.
I found answer in that russian page http://en.wikipedia.org/wiki/Modulo_operation english have answer too.
I didnt have idea to found it there o-o'
Can anyone please give me an expample of object which will fall down with constant speed for mission? Cant make "sy" work
P.S. Attention! The last action in this thread happened 434 days ago. Please do only answer if it still makes sense!
P.S.S. What? Cooldown is higher then 200!

P.S. Attention! The last action in this thread happened 434 days ago. Please do only answer if it still makes sense!

P.S.S. What? Cooldown is higher then 200!

Why don't you just modify an object script like the shield generator ? It doesn't fall with constant speed but it should be quite easy to adjust that.
It's me again
(lol)
Can anyone help me please?
For example, i have image1.png...image8.png, how can i make them be "animated" like it's image1.png and next second its image2.png and so until image8.png?
I thought about timer and array, but i do not know how to make and operate array, so i'll try something with timer for a while.
Any help will be appreciated with cookies
Edit: Lurkin' in PM folder gave me a little help, 01.10.11 when
Holzchopf gave me a lesson about arrays, so i now have a picture in my mind how to realize it using array and a timer. (maybe)
P.S. Damn, im so stupid in lua
Edit2: Well, i figured out that i dont need an array
Edit3: I figured out how to do it, but when it goes to certain frame it goes wild like shit and look stupid
I mean it goes a bit offset, whats the problem? Maybe i should use BMP instead of PNG?

Can anyone help me please?
For example, i have image1.png...image8.png, how can i make them be "animated" like it's image1.png and next second its image2.png and so until image8.png?
I thought about timer and array, but i do not know how to make and operate array, so i'll try something with timer for a while.
Any help will be appreciated with cookies

Edit: Lurkin' in PM folder gave me a little help, 01.10.11 when

P.S. Damn, im so stupid in lua

Edit2: Well, i figured out that i dont need an array

Edit3: I figured out how to do it, but when it goes to certain frame it goes wild like shit and look stupid

edited 4×, last 08.07.13 01:16:12 am







Why didnt i thought of this...i like the way he did it with "for" (just dont know how is this called in english, lol >_>) but i already managed to make one with timer and its pretty cool

By the way thanks for responding \o/
Here you go:

P.S. I also figured the reason why it gone wild like shit, it wasn't smooth enough, i simply multiplied timer by 2 and added math.ceil. Goddamn thing works perfectly.
P.S.S. Sorry for posting before trying to solve, my bad

30.01.14 EDIT:
Well, it's me again, and again there is something that makes my brain hurt because i don't know how to solve that.
Is there any way to make object act like foreground image? I mean image would not collide in any known way with player. I tried

And the second question, how to make that object "see" player only when there is no map between them?
edited 1×, last 30.01.14 08:46:07 pm
You can only create an object which doesn't collide with anything at all by setting no collision image in
addobject.
Having an object which doesn't collide with players but does collide with other stuff is actually not possible I guess. Maybe with a tricky hack but I can't think of one. Of course you can still react to collisions by using the
collision command but you can't make projectiles etc. collide with it as if there was a rigid collision object (at least not in a universal and clean way).
For the seeing stuff: Take a look at the script of the sentry gun. It only shoots if there is no terrain between it and the player it aims at. It's basically a loop with a
collision command in it. But be aware that such checks are slow. You shouldn't perform them too often.

Having an object which doesn't collide with players but does collide with other stuff is actually not possible I guess. Maybe with a tricky hack but I can't think of one. Of course you can still react to collisions by using the

For the seeing stuff: Take a look at the script of the sentry gun. It only shoots if there is no terrain between it and the player it aims at. It's basically a loop with a

http://www.carnagecontest.com/help_missions.php
Why just 99? ._.
If there any solution for this if i actually need 1000?
So i need to write custom script for ammo and check it instead of using that one?
Quote:
5 is the amount for this weapon. It must be 0-99. Don't specify this value if you want an infinite amount (which is the default). Note that you always have to specify a cooldown if you want to specify an amount as well (otherwise Carnage Contest will think that your amount is the value for the cooldown)
Why just 99? ._.
If there any solution for this if i actually need 1000?
So i need to write custom script for ammo and check it instead of using that one?