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

DC
Admin Off Offline

Zitieren
It's "just" 99 because you never need a higher amount under "normal" circumstances for a "normal" weapon (considering that normal weapons are only used max a few times per round and that a match normally doesn't have that many rounds). 99 is already a very high value which should never be required. So yes, you would somehow have to script your own counter if you need an even higher amount.

You may also reconsider how your weapon works (this would be the better and cleaner solution obviously!). Maybe you can give like 10 shots per use or something like that. Highly depends on the weapon and how it works of course.

alt Re: Lua Scripts/Questions/Help

Nem
User Off Offline

Zitieren
user DC hat geschrieben
It's "just" 99 because you never need a higher amount under "normal" circumstances for a "normal" weapon (considering that normal weapons are only used max a few times per round and that a match normally doesn't have that many rounds). 99 is already a very high value which should never be required. So yes, you would somehow have to script your own counter if you need an even higher amount.

You may also reconsider how your weapon works (this would be the better and cleaner solution obviously!). Maybe you can give like 10 shots per use or something like that. Highly depends on the weapon and how it works of course.

Well yea, i guess so. Still, that would be better for thing that we doing right now.

Yep. I just wanted a machinegun with 200 ammo acting like normal one, so it wouldnt work for him the way it should.
Anyway, thanks for making this one clear

alt Re: Lua Scripts/Questions/Help

Lekken
User Off Offline

Zitieren
Is it possible to write\read variables from a file? I used
1
local file = io.open("path/file", "w \ r")
in mission_start(), but got an error "attempt to call field 'open' (a nil value)".

alt Re: Lua Scripts/Questions/Help

MikuAuahDark
User Off Offline

Zitieren
user Lekken hat geschrieben
Is it possible to write\read variables from a file? I used
1
local file = io.open("path/file", "w \ r")
in mission_start(), but got an error "attempt to call field 'open' (a nil value)".


io libraries(and other like os, etc.) is disabled in Carnage Contest.

alt Re: Lua Scripts/Questions/Help

Nem
User Off Offline

Zitieren
user DC hat geschrieben
I don't recommend to perform any file IO operations in Carnage Contest scripts.

Why?
CS2D allows you to dofile, and even saving your data somewhere (was it in tibia?), why CC does not allow this?
It would really help to write/read to/from file. REALLY help.

user MikuAuahDark hat geschrieben
io libraries(and other like os, etc.) is disabled in Carnage Contest.

I'm afraid not. One of my script uses os.time thingy (Blazzing guy made it for me a really long time ago when i didnt know how to do timers) and it works, although DC said it wouldnt, or it is not recomended, really long time ago, so i do not properly remember.

alt Re: Lua Scripts/Questions/Help

Vectarrio
User Off Offline

Zitieren
Changelog of version 0.0.2.5 explains it:
Zitat
CHANGED
Lua IO functions disabled (potential security vulnerability)
CHANGED
Lua OS.execute function disabled (potential security vulnerability)

alt Re: Lua Scripts/Questions/Help

DC
Admin Off Offline

Zitieren
CS2D scripts are running on the server only and they are not transferred automatically (except for map scripts). CC scripts run everywhere. You could easily write and distribute CC weapons which completely destroy the entire system when they are loaded.

alt Re: Lua Scripts/Questions/Help

Nem
User Off Offline

Zitieren
user DC hat geschrieben
CS2D scripts are running on the server only and they are not transferred automatically (except for map scripts). CC scripts run everywhere. You could easily write and distribute CC weapons which completely destroy the entire system when they are loaded.

So it is not possible in CC to store custom values in a file? (in-game variables resets after you close the game)
Maybe will allow to read and write file in mission folder only?

EDIT (2016.07.09): Is it possible to have a 'negative' effect on the screen?
I think CC doesnt have that ability ._.
4× editiert, zuletzt 09.07.16 12:44:00
Zum Anfang Vorherige 1 2 3 4 5 Nächste Zum Anfang
Einloggen, um zu antwortenCarnage Contest-ÜbersichtForenübersicht