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

DC
Admin Off Offline

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

old Re: Lua Scripts/Questions/Help

Nem
User Off Offline

Quote
user DC has written
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

old Re: Lua Scripts/Questions/Help

Lekken
User Off Offline

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

old Re: Lua Scripts/Questions/Help

MikuAuahDark
User Off Offline

Quote
user Lekken has written
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.

old Re: Lua Scripts/Questions/Help

Nem
User Off Offline

Quote
user DC has written
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 has written
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.

old Re: Lua Scripts/Questions/Help

Vectarrio
User Off Offline

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

old Re: Lua Scripts/Questions/Help

DC
Admin Off Offline

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

old Re: Lua Scripts/Questions/Help

Nem
User Off Offline

Quote
user DC has written
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 ._.
edited 4×, last 09.07.16 12:44:00 pm
To the start Previous 1 2 3 4 5 Next To the start
Log in to replyCarnage Contest overviewForums overview