Programming & Scripting

View unanswered posts | View active topics


Post a new topicPost a reply
Previous topic | Next topic 

User avatar   Beginner BeginnerMember since: 21.08.2011, 11:31Posts: 71Location: Sweden Likes: 0
 

 Post Topic: References?? API docs?? (relating to LUA)
PostPosted 22.02.2012, 14:30 
Is there ANY official documentation available that helps you mod for crysis in terms of LUA scripting?

For example, right now I'm trying to spawn some weapons in a map on a server with laser or scope attachments. Very basic task, or rather it should be - except I have no idea what parameter to pass to the System.SpawnEntity function for these, and after trying various Modification ="LAMRifle", initialSetup ="LAMRifle" etc GUESSES I am forced to admit I simply cannot guess the correct parameter name and my weapons keep spawning with no attachments at all.

Of course I can always go bug some other admin who knows and get the answer that way, but so far, my entire experience with modding my Crysis server has been like this - guesswork. You guess parameter names, you guess what variables a function takes, you guess what format you might get the return values in, everything feels so random and every line of code you write feels like a visit to the dentist because you have no idea if you're following correct protocol or not, flying blind all the time :mad:

Here on the cryWiki for example is a long list of Entity: and System: functions, but most of them are greyed out and no help is available on them. How do you find out how these work? Have CryTek released any official documentation for things like these or is the modding community supposed to just guess one small piece at a time and then tell it to eachother and maybe in a few decades we'll all know how everything works by tedious trial and error?

Where do you all go to learn how all this works? I know some LUA entity definitions can be found in the Gamedata.pak but the weapons for example seem to not have anything like this, and of course all the actual entity manipulation functions are still a big mystery.

  Trainee TraineeMember since: 19.08.2011, 10:04Posts: 178Location: Prague, Czech Rep. Likes: 1
 

 Post Topic: Re: References?? API docs?? (relating to LUA)
PostPosted 22.02.2012, 15:55 
To be honest, i fully understand you. This is the most terrible documented piece of software. Ie. Trinigy had not so good renderer and terrain editor but it has brilliant documentation (C++ part and Lua too...). There is "nothing" and many years no one care...
User avatar   Beginner BeginnerMember since: 21.08.2011, 11:31Posts: 71Location: Sweden Likes: 0
 

 Post Topic: Re: References?? API docs?? (relating to LUA)
PostPosted 22.02.2012, 19:57 
Quote by AndOrXor:
There is "nothing" and many years no one care...


Oh so there is no real documentation to even find? :meh:

I'm guessing CryTek doesn't care anymore about Crysis 1 either because it's an "old" game. This is sad in that case, because it seems to be only now today that "average" people have the computer power to be able to play Crysis with decent FPS on anything but super low settings.

Every day on my server I get beginners come on and ask why it's so dead, they play for the first time and think the game is awesome - even many people have tried Crysis 2 but didn't like how much like COD-games it is, so they try Crysis 1 out of curiousity and fall in love with it right away and can't understand why it seems so abandoned.

In my opinion, Crysis 1 has a lot to offer still and it could easily have a second big "boom" of players online if it only was a bit better supported. The most awesome thing CryTek could possibly do for it, would be if it was possible to release another patch that enabled auto-map download. If people could design maps that servers could actually run without players having to download them first, this game could truly come alive again.

But I guess CryTek is a business and just keep moving on to the next big money-maker, who cares about a game that is over 4 years old... :sad:
  Trainee TraineeMember since: 19.08.2011, 10:04Posts: 178Location: Prague, Czech Rep. Likes: 1
 

 Post Topic: Re: References?? API docs?? (relating to LUA)
PostPosted 22.02.2012, 20:13 
You can try find something by yourself. Callback functions from code - undocumented, flowgraph nodes - undocumented, parameters for entities (Properties, gameParams etc.) - undocumented, script states - undocumented, and finaly methods from Lua ... guess ... undocumented (and if documented then without parameters and descriptions). So this is imho reason why many ppl use UDK. This isnt engine for making games from scratch like Unity, UDK, Construct, Shiva and others, this is literaly Crysis 2 editor, with assets cut out. If you want to make something else than FPS shooter like Crysis youre screwed and trust me cutting out nanosuit, thruster, cloaking and other things not needed for ie. Counter Strike is just small fun... :happy: ;( :sad:
User avatar   Beginner BeginnerMember since: 21.08.2011, 11:31Posts: 71Location: Sweden Likes: 0
 

 Post Topic: Re: References?? API docs?? (relating to LUA)
PostPosted 23.02.2012, 14:32 
Quote by AndOrXor:
You can try find something by yourself. Callback functions from code - undocumented, flowgraph nodes - undocumented, parameters for entities (Properties, gameParams etc.) - undocumented, script states - undocumented, and finaly methods from Lua ... guess ... undocumented (and if documented then without parameters and descriptions). So this is imho reason why many ppl use UDK. This isnt engine for making games from scratch like Unity, UDK, Construct, Shiva and others, this is literaly Crysis 2 editor, with assets cut out. If you want to make something else than FPS shooter like Crysis youre screwed and trust me cutting out nanosuit, thruster, cloaking and other things not needed for ie. Counter Strike is just small fun... :happy: ;( :sad:


Yes, but I don't want to create a new game. I'm a programmer so I could probably modify a lot of things with C++ too like most people in here seem to, but the thing is, my only modding needs and desires are that I want to enhance the experience for online players on my server. Since file versions have to match between server/client, that means I cannot mod the game itself, but am limited to what I can script with LUA and so forth (through Patriot which I'm using for server mod).

This is why I'm so baffled by the lack of documentation. I mean, CryTek aren't running any official Crysis servers but are leaving this completely to us end-users to do if we want to play online games with eachother, BUT nothing is documented either so we can't even modify and script things to customize our own game environment on the servers either without figuring absolutely everything out by trial-and-error? :unsure:

For example, what constantly gets me stuck is extremely simple stuff like in my first post, I just wanted to put some new guns with custom attachments like Reflex scope, LAMRifle lasers, Silencer etc, but just can't find anywhere which parameter to add to System.SpawnEntity(). As a long time programmer, the LUA language isn't exactly a challenge for me but I still can't accomplish much when I don't even know what parameter names are called or return value formats even consist of.

In my opinion this is such a basic level of modificiation it HAS to be documented somewhere? Or did CryTek seriously abandon the game as soon as it hit the shelf and are now considereding it a thing of the past just because 4 years have passed? :whatever:
User avatar   Trained Modder Trained ModderMember since: 06.10.2008, 18:38Posts: 289Location: Berlin, Germany Likes: 2
 

 Post Topic: Re: References?? API docs?? (relating to LUA)
PostPosted 02.03.2012, 15:18 
There is not much documentation, because honestly not much people use LUA in CryEngine. There is some documentation in FarCry and a lot of new one in the FreeSDK docs: http://freesdk.crydev.net/display/SDKDOC5/Home
Many functions there also work in Crysis 1.

For the most part you can find out what parameters a lua function is taking by looking at the included script files or the C++ code. The function is either fully exposed there or at least there is an equivalent C++ function which is documented.
Quote:
For example, what constantly gets me stuck is extremely simple stuff

Nothing is simple, because you can do only as much as Crytek wanted to be in the lua implementation = entity scripts and multiplayer behaviour. Nothing more really. It's not intended to replace C++.

So it's kinda awesome what you can do just with the available functions.

To your question: I don't think you can handle attachments with the spawn function. There should be another function available in the inventory or entity class.


Image
Released !!! DOWNLOAD NOW !!!
User avatar   Beginner BeginnerMember since: 21.08.2011, 11:31Posts: 71Location: Sweden Likes: 0
 

 Post Topic: Re: References?? API docs?? (relating to LUA)
PostPosted 08.03.2012, 18:20 
Quote by Hamers:
To your question: I don't think you can handle attachments with the spawn function. There should be another function available in the inventory or entity class.


Thanks for your reply, very interesting read. As far as this particular question I figured it out from looking at the XML data for the game, I just stuck for example an initialSetup="LAMRifle" variable in the parameters for the spawn function and it worked :))

But it sure takes a lot of fiddling around and trial and error to figure out all this stuff.