Forum

> > Carnage Contest > Lua Scripts/Questions/Help
ForenübersichtCarnage Contest-ÜbersichtEinloggen, um zu antworten

Englisch Lua Scripts/Questions/Help

89 Antworten
Seite
Zum Anfang Vorherige 1 2 3 4 5 Nächste Zum Anfang

alt Re: Lua Scripts/Questions/Help

Vectarrio
User Off Offline

Zitieren
user Loooser hat geschrieben
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!)

alt Re: Lua Scripts/Questions/Help

Vectarrio
User Off Offline

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

alt Re: Lua Scripts/Questions/Help

Nem
User Off Offline

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

alt Re: Lua Scripts/Questions/Help

Loooser
User Off Offline

Zitieren
It should work like that

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

alt Re: Lua Scripts/Questions/Help

Nem
User Off Offline

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

alt Re: Lua Scripts/Questions/Help

Unknown_Soldier
User Off Offline

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

alt Re: Lua Scripts/Questions/Help

VADemon
User Off Offline

Zitieren
Spoiler >

Found it, thanks
1× editiert, zuletzt 30.01.12 14:39:49

alt Re: Lua Scripts/Questions/Help

Nem
User Off Offline

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

alt Re: Lua Scripts/Questions/Help

DC
Admin Off Offline

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

alt Re: Lua Scripts/Questions/Help

Nem
User Off Offline

Zitieren
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?
4× editiert, zuletzt 08.07.13 01:16:12

alt Re: Lua Scripts/Questions/Help

DC
Admin Off Offline

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

alt Re: Lua Scripts/Questions/Help

Nem
User Off Offline

Zitieren
user DC hat geschrieben
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?
1× editiert, zuletzt 30.01.14 20:46:07

alt Re: Lua Scripts/Questions/Help

DC
Admin Off Offline

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

alt Re: Lua Scripts/Questions/Help

Nem
User Off Offline

Zitieren
http://www.carnagecontest.com/help_missions.php
Zitat
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?
Zum Anfang Vorherige 1 2 3 4 5 Nächste Zum Anfang
Einloggen, um zu antwortenCarnage Contest-ÜbersichtForenübersicht