Forum

> > Carnage Contest > Lua Scripts/Questions/Help
Forums overviewCarnage Contest overviewLog in to reply

English Lua Scripts/Questions/Help

89 replies
Page
To the start Previous 1 2 3 4 5 Next To the start

old Re: Lua Scripts/Questions/Help

Vectarrio
User Off Offline

Quote
user Loooser has written
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!)

old Re: Lua Scripts/Questions/Help

Vectarrio
User Off Offline

Quote
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)

old Re: Lua Scripts/Questions/Help

Nem
User Off Offline

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

old Re: Lua Scripts/Questions/Help

Loooser
User Off Offline

Quote
It should work like that

1
numberoflivingplayers=#playertable(0,1)
the variable numberoflivingplayers is the number of players

old Re: Lua Scripts/Questions/Help

Nem
User Off Offline

Quote
I messed with that variable yesterday, but i thought its wrong because of an error.
Thanks. Now iam coming back to n++ and CC

old Re: Lua Scripts/Questions/Help

Unknown_Soldier
User Off Offline

Quote
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)

old Re: Lua Scripts/Questions/Help

VADemon
User Off Offline

Quote
Spoiler >

Found it, thanks
edited 1×, last 30.01.12 02:39:49 pm

old Re: Lua Scripts/Questions/Help

Nem
User Off Offline

Quote
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!

old Re: Lua Scripts/Questions/Help

DC
Admin Off Offline

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

old Re: Lua Scripts/Questions/Help

Nem
User Off Offline

Quote
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 user 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?
edited 4×, last 08.07.13 01:16:12 am

old Re: Lua Scripts/Questions/Help

DC
Admin Off Offline

Quote
user Holzchopf's file cc Nyan Cat uses animation. Take a look at this. It's now included in CC by default so you don't even have to download ot. Or also the original rat / hitler / osama / santa scripts (but those all have just 2 frames)

old Re: Lua Scripts/Questions/Help

Nem
User Off Offline

Quote
user DC has written
user Holzchopf's file cc Nyan Cat uses animation. Take a look at this. It's now included in CC by default so you don't even have to download ot. Or also the original rat / hitler / osama / santa scripts (but those all have just 2 frames)

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: cookies
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 cc cmd collision, but it just wont work the way i wanted - player get stuck in object even with player ignore.
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

old Re: Lua Scripts/Questions/Help

DC
Admin Off Offline

Quote
You can only create an object which doesn't collide with anything at all by setting no collision image in cc cmd 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 cc cmd 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 cc cmd collision command in it. But be aware that such checks are slow. You shouldn't perform them too often.

old Re: Lua Scripts/Questions/Help

Nem
User Off Offline

Quote
http://www.carnagecontest.com/help_missions.php
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?
To the start Previous 1 2 3 4 5 Next To the start
Log in to replyCarnage Contest overviewForums overview