ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Clear Sky Forum » Mod discussion
Need a good modding tutorial

1 2 | Next 10 events »| All Messages
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  17:52:30  14 May 2013
profilee-mailreply Message URLTo the Top
kyfohatl
(Novice)
 
On forum: 10/07/2011
Messages: 36
Need a good modding tutorial

Hi all,

I want to get into modding this game so I've been looking at some modding tutorials, but unfortunately they mostly deal with things like adding new weapons. I want to mod things like AI behavior, so I think I'll need a more in-depth understanding of the scripting language for this game and how the files work. Is there a tutorial like that?

Regarding my experience: I have done some scripting for a ArmA 2, and a little bit for skyrim, but overall my programming knowledge is very limited. I am a noob, but I'm willing to learn
  03:01:22  15 May 2013
profilee-mailreply Message URLTo the Top
kyfohatl
(Novice)
 
On forum: 10/07/2011
Messages: 36
Ok I looked around some more and I found this thread:
http://forums.filefront.com/s-t-l-k-e-r-soc-modding-mapping-editing/365852-q-introduction-stalker-scripting.html

Ok so I think I will need to learn the Lua programming language, and I also need to have a look at the file "lua_help.script" according to one of the posts; except I can't find this file in the main directory. Where can I find lua_help.script?? Could someone please help?

Sorry for being a massive noob
  03:27:56  15 May 2013
profilee-mailreply Message URLTo the Top
SetaKat
Ex modder, Zones only ferret and will someday release a game
(Resident)

 

 
On forum: 02/20/2010
Messages: 6340
You need to unpack the games files to get to lua_help.script
lua_help is more a list of the c++ objects (and methods) that can be accessed/used via the games Lua scripts than an API interface.

Modding the AI is kinda difficult, as most of it is bundled up in the engine. We can add some new AI functionality via script, and I can provide you with a few links once I get home.
Modding the Alife is even tricker, as it is mostly all done via Lua, and the code is spread out over multiple scripts. Your best bet is to find a mod that alters* alife behaviour, and compare its scripts with vanilla, and see what changes have been made.

* a lot of mods alter alife behaviour, but most of them are just ltx file edits. Very few alter the script files to actually change alife functionality instead of just tweaking it. For CS, look at The Faction War mod for a dramatic overhaul of Alife. If you want a more toned down, simplified Alife (but still quite indepth and functional), look at The Zones Call demo (I think). Those are the only 2 mods here in development that actually change alife by changing the games scripts.
  04:36:13  15 May 2013
profilee-mailreply Message URLTo the Top
kyfohatl
(Novice)
 
On forum: 10/07/2011
Messages: 36
Thanks for the quick reply. Yeah Alife is mostly what I'm interested in working on, like changing faction warfare/activity to my liking, massively increasing the presence of mutants and making bandits hostile (the zone in CS is way too safe imo).

Regarding AI behavior I mostly want to change how the mutants behave; I HATE how they only chase you within a very small circle, and once you are outside that circle you can just stand there and shoot them and all they will do is run around aimlessly... I want to remove this limit and allow mutants to chase the player over much longer distances.

Finally I was thinking of implementing - and I dunno if this is possible - a "predator" type behavior in some mutants like blood suckers, where once they spot a stalker, they cloak, sneak up on him and follow him, and wait until he wonders away from his group, then attack and kill.

Anyway thanks for the info, I'm looking at the faction war's scripts right now
  05:08:11  15 May 2013
profilee-mailreply Message URLTo the Top
SetaKat
Ex modder, Zones only ferret and will someday release a game
(Resident)

 

 
On forum: 02/20/2010
Messages: 6340
1) Increasing the presence of Bandits and mutants - easiest way is via ltx. Changing the relations of the bandits - easiest is done via ltx and a new game.

2) That sort of AI behaviour is hardcoded. The chase limit is IIRC based on smart terrain, and can possible be disabled via script. The problem is, each mutant lives in a squad (under normal circumstances), and each squad is in a certain smart terrain, and if you lure a mutant out of its next smart terrain and over to another with Stalkers in it (done it before), neither of them will respond to each other, since the combat conditions aren't being satisfied for the squad. Might be possible to change it, will have to look at the scripts to check.

3) Not possible. Mainly because AI is controlled via engine. It might be possible to use AI schemes to override this, but it will involve some heavy duty and complex scripting to get it acting dynamically. Be much easier to do so in a scripted scene. Less code execution overhead, which is what CS needs, since the vanilla scripts are CPU intensive. TFW is even more so, but thats because of all the extra AI schemes and other new alife features it has.

CS does have the best alife implementation in all 3 games, the only issue is that is it heavily shackled by the vanilla code. TFW has rewritten a lot of vanilla code, and does have quite a dynamic alife system, but it has changed a lot compared to vanilla. In fact, very little of the alife code left is vanilla. TZC on the other hand, is still based off vanilla alife, and is quite an unshackled, dynamic system compared to vanilla (Well, the current code is, not sure about the demo)
  05:54:56  15 May 2013
profilee-mailreply Message URLTo the Top
nashathedog
Senior Resident
 

 
On forum: 01/31/2011
Messages: 8012
If you change the relations with the Bandits you lose the use of there base and you will be unable to do a lot of the Garbage bits as there is a side storyline and many quests associated with them, If you do not mind that note that the SEVA outfit can only have some it's top upgrades done by there tech so you may want to set it up so you can do the upgrades elsewhere. Personally I think it is the best outfit in the CS zone and a lot of people (not everyone) agree with that. There important upgrades for the suit aswell. Myself I like how keeping the Bandits on side until you've done the upgrades actually makes things a little bit harder and once I've got my suit maxed out then there easy game it no longer matters. Also when you first reach the Garbage there trader can provide early access to some things.
  14:30:33  15 May 2013
profilee-mailreply Message URLTo the Top
SetaKat
Ex modder, Zones only ferret and will someday release a game
(Resident)

 

 
On forum: 02/20/2010
Messages: 6340
http://sdk.stalker-game.com/en/index.php?title=Schemes
This covers off creating AI schemes, which is custom behaviour and action used by npcs and mutants ingame. This is a very basic tutorial, so my might want to use this to get an overview, and then dive into some of the games scripts. xr_*.script are usually AI schemes like this.

http://sdk.stalker-game.com/en/index.php?title=Logic
This is also related, as some of this logic is the implementation of many of the games AI schemes applied to NPC's

http://sdk.stalker-game.com/en/index.php?title=Inheritance
Some Lua here...

http://sdk.stalker-game.com/en/index.php?title=Online_and_offline_alife
Heres some more info, mainly SoC related, don't know how accurate it is compared to CS's alife schemes.
  14:42:53  15 May 2013
profilee-mailreply Message URLTo the Top
kyfohatl
(Novice)
 
On forum: 10/07/2011
Messages: 36
@davideverett: True, if I become good enough to actually make the mod, I'll be sure to add some way for the player to become friendly with bandits, maybe a special quest to join them, for players who want acess to depot.

@SetaKat: ok, I've been looking at the ltx scripts in the gamedata folder of mods (like TFW) to try and figure out how things work, but I could only understand a little bit. So I figured I should go and have a look at some lua tutorials. The problem is, because of my lack of programming experience, I can'r draw a link between what I'm learning and how that could help understand stalker scripts.

I mean, in ArmA 2 or Skyrim, you have a specific scripting language, and you can do things like, "_myVar = _soldier1 hasWeapon "m16"" or "_n0Crew = count (crew _vehicle1)" but I don't think the lua programming language has commands like "hasWeapon" or "getUnitType", so I don't understand how learning lua could help me manipulate stalker scripts and understand them. How do you figure out, say, how much ammo a unit has without the commands I mentioned?

Anyway I will take another look at the scripts and see if I can understand them better.
  23:43:12  15 May 2013
profilee-mailreply Message URLTo the Top
SetaKat
Ex modder, Zones only ferret and will someday release a game
(Resident)

 

 
On forum: 02/20/2010
Messages: 6340
ltx files are mere logic configs. Some parts of them do have conditions and tests like you mentioned, but mostly, its just item/object declarations. Look at the files in gamedata/configs/scripts/ folder, and you'll see some files do have such logic.
It is possible to do such tests in the Lua scripts as well, you just need to acquire the game object for whatever you want to check/test, and then call the appropriate engine functions (if they have been made available via lua)
  02:14:26  16 May 2013
profilee-mailreply Message URLTo the Top
Firmament
Senior Resident
 

 
On forum: 06/02/2009
 

Message edited by:
Firmament
05/16/2013 2:25:39
Messages: 268

---QUOTATION---

Regarding AI behavior I mostly want to change how the mutants behave; I HATE how they only chase you within a very small circle, and once you are outside that circle you can just stand there and shoot them and all they will do is run around aimlessly... I want to remove this limit and allow mutants to chase the player over much longer distances.

---END QUOTATION---



In the squad_descr.ltx for each location, find the proper squad and add a:

attack_power = 1000

You will see very noticeable results. Like in this vid: https://www.youtube.com/watch?v=4By2Y9G7EfE, or this one: https://www.youtube.com/watch?v=if8fShZ0FbA
(Look how the pseudo-giant you begin to see at 1:02 on first vid hunts the player on long distance, and, later on, how the bloodsucker at 4:13 kills these Monolith soldiers, and then comes right to the player to attack him. Yes, that's the result of a high attack_power.
In the second vid, you can clearly see where the circle starts, in red forest and where it ends, near the bridge. This is a huge distance compared to the vanilla game where the attack_power by default must be hardcoded around something like 200. Note that I don't know what the limit is; I personnally never needed to go over 1000, mainly because doing so may cause some mutants to attack ANY location at ANY time, which is purely game/story/quest breaker if you know what I mean).

It should be noticed however that to increase attak_power also requires a modification of the xr_combat_ignore.script, forcing the NPCs not to ignore the mutants roaming everywhere. Because technically, the said mutants do actually belong to locations that are located far away from them, and thus (due to the way the engine works), they don't even think about shooting at them.

Smoq2 is the modder who kindly made that script for me, I hear the script that allows NPCs not to ignore mutants that randomly attack them when moving into their now large circle. If that solution of the modified attack_power value is what you were looking for, just tell and I'll send you the required script that goes with it.

It's late and I must really go to sleep, now
 
Each word should be at least 3 characters long.
Search:    
Search conditions:    - spaces as AND    - spaces as OR   
 
Forum Index » S.T.A.L.K.E.R.: Clear Sky Forum » Mod discussion
 

All short dates are in Month-Day-Year format.


 

Copyright © 1995-2019 GSC Game World. All rights reserved.
This site is best viewed in Internet Explorer 4.xx and up and Javascript enabled. Webmaster.
Opera Software products are not supported.
If any problem concerning the site functioning under Opera Software appears apply
to Opera Software technical support service.