1) We create file your_script_name.script in folder gamedata/scripts and write in it this:

snd = sound_object([[ambient\underground\rnd_giant]])
-- Check if we need to smoke. It calls out every 6 game minutes
function test_for_need_kur()
amk.save_variable("kur",amk.load_variable("kur",0)+1)
amk.g_start_timer("kur",0,0,6)
kur_reduce_health()
end
-- Health decrease, if actor hasn`t smoke for a long time
function kur_reduce_health()
local tmp = amk.load_variable("kur",0)
if tmp > 150 then
if db.actor.health > 0.15 then
db.actor.health = - 0.15
end
if not snd:playing() then
snd:play_at_pos(db.actor, vector():set(0,0,0), 0, sound_object.s2d)
end
end
end
-- Smoking
function kur_item(oid, time)
if alife():object(oid)==nil then
local tmp = amk.load_variable("kur",0) - time*10
if tmp < 0 then tmp = 0 end
amk.save_variable("kur", tmp)
kur_reduce_health()
end
end

Then we save changes and in this folder we create file exp|_mod.script and in it we write this:

--Script from NZK mod
--by zek
------------------------------------------------------------------------
--- Script of using things straight from invertory (In this case - using of the repair kit)
--- Work with bind_stalker.script/actor_binder:on_item_drop/
------------------------------------------------------------------------
function itemuse(what)
local obj_name = what:name()
if (string.find(obj_name, "repair_kit")) then
use_repair_kit(what)
-- If you want to add new trigger item, add script this line.
end
end
------------------------------------------------------------------------
--- The process of using of the repair kit
------------------------------------------------------------------------
function use_repair_kit(what)
local repair_slot_num = 0
local item_in_slot_1 = db.actor:item_in_slot(1)
local item_in_slot_2 = db.actor:item_in_slot(2)
local item_in_slot_6 = db.actor:item_in_slot(6)
if (item_in_slot_1 ~= nil) then
repair_slot_num = 1
end
if (item_in_slot_2 ~= nil) then
if (repair_slot_num == 0) then
repair_slot_num = 2
elseif (repair_slot_num == 1) then
if (item_in_slot_1:condition() > item_in_slot_2:condition()) then
repair_slot_num = 2
end
end
end
if (item_in_slot_6 ~= nil) then
if (repair_slot_num == 0) then
repair_slot_num = 6
elseif (repair_slot_num == 1) then
if (item_in_slot_1:condition() > item_in_slot_6:condition()) then
repair_slot_num = 6
end
elseif (repair_slot_num == 2) then
if (item_in_slot_2:condition() > item_in_slot_6:condition()) then
repair_slot_num = 6
end
end
end
if (repair_slot_num == 1) then
local rep_point = item_in_slot_1:condition() + 10
if (rep_point > 1) then
rep_point = 1
end
item_in_slot_1:set_condition(rep_point)
elseif (repair_slot_num == 2) then
local rep_point = item_in_slot_2:condition() + 10
if (rep_point > 1) then
rep_point = 1
end
item_in_slot_2:set_condition(rep_point)
elseif (repair_slot_num == 6) then
local rep_point = item_in_slot_6:condition() + 10
if (rep_point > 1) then
rep_point = 1
end
item_in_slot_6:set_condition(rep_point)
end
end

That is all! Now we can add it to some trader. (It will be in another lesson.)

That's all!Translation and editing : RafMadManP.S. Taken from Stalkerinside.

3.Before that you need to take weapons from Call of Pripyat and hands. They are stored in a folder weapons (meshes\dynamics\weapons\hand) and there will also be animations for these weapons, and translate it into a format .skls. And translate it into a format .object with this program.

5. We choose a weapon. press Load Meshes. Further Export skin object. Further select the desired animated example Draw (from the left column) and Idle on the right and press Load Anims. Further Export Motion. And so with all.

6. Further go to the folder where you saved it all and upload it SDK 0.4.

Ссылка на сообщение

Поделиться на других сайтах

Creation of simple dialog.Let‘s start the process of creation of our quest from creating a small dialog.

We open file gamedata\config\gameplay\character_desc_escape.xml and do this:- find string <actor_dialog>escape_trader_done_blockpost_box</actor_dialog> - and add after it a new one - <actor_dialog>escape_trader_oops</actor_dialog> - then we save changes.We have just added a new dialog branch to trader "Sidorovich", but not even a branch - just a link on it. The structure of the dialog is situated in file gamedata\config\gameplay\dialogs_escape.xml whicj we open and do this:- we find some free space between </dialog> and <dialog id="..."> - and add there a such construction:

Now we have a structure of a new dialog branch. But we have to do one more thing - to write strings, which actor will see in game instead of escape_trader_oops_....For it let‘s open a file gamedata\config\text\rus\stable_dialogs_escape.xml and do this:- find some free space between </string> и <string id="..."> - and write there such strings:

<string id="escape_trader_oops_0">
<text>Hey, sidor, we can talk about... vodka?</text>
</string>
<string id="escape_trader_oops_1">
<text>Vodka? Are you kidding me? I have no vodka! But I remember that Wolf had hidden some on attic... Can you get it for me?</text>
</string>
<string id="escape_trader_oops_2">
<text>All right, then... I‘ll find some.</text>
</string>
<string id="escape_trader_oops_3">
<text>Go, go...</text>
</string>

- save changes.So now we have a dialog. We can strat the game and test it. But now we have to "pin" a quest to this dialog.

Creation of quest.To "pin" activation of quest to a dialog is very easy. Just open file gamedata\config\gameplay\dialogs_escape.xml and do this:- let‘s change the content of <phrase id="2"> in this way:

We have just wriiten the data of quest: icons, names of it parts, loction of markers and so on.

We will return to this file in future, because a lot of things in it were made quickly and we didn‘t pay enough attention to it. I dont‘ know how to make the quest "Return with vodka to trader" appear in PDA, but i think it is not so bad - it works and we have no problems with the game. Let‘s continue.

Let‘s open file gamedata\config\gameplay\info_l01escape.xml and registrate in it some new infoportions(we will use them to start and to complete the quest).

Now we can test it. Now we can begin the third part. We forgot to give player ability to complete the quest.

Realization of ability to complete the quest.It is no so hard as it seems. All conditions are already created, now we only have to use them in the dialog. Let‘s change it: make it structure more branched and functional:

0. Hey, sidor, we can talk about... vodka? (switch-over to 1)1. Vodka? Are you kidding me? I have no vodka! But I remember that Wolf had hidden some on attic... Can you get it for me? (choice - switch-over to 2,4,5; initially we can use only 2)2. All right, then... I‘ll find some. (we start the quest , switch-over to 3, after this frase it disappears)3. Go, go... (the end of the dialog)4. Here is it!(appears only if actor has vodka in invertory, when you choose this answer vodka "carries" to trader, quest completes, switch-over to 7)5. Sorry, but i have no vodka... Can you wait some more?(appears only if we start the quest, switch-over to 6)6. Get out of here! Don‘t come back without vodka!!!(switch-over to 8)7. Oh, God... Yes, yes, now give it to me! Thank you, here is your reward.(gives player a reward, switch-over to 8)8. Fuck you!(the end of the dialog)

That‘s how it looks in file gamedata\config\gameplay\dialogs_escape.xml:

That's all!Translation and editing : RafMadManP.S. Taken from Stalkerinside. And sorry for my not perfect English. If you have some problems with it - write me, may be I had made some mistakes in code/words.

Изменено 14 Октября 2015 пользователем RafMadMan

× 3

Поделиться этим сообщением

Ссылка на сообщение

Поделиться на других сайтах

So, let‘s start, ok? We have connected(linked up) the location to game, situated map of location in the PDA, etc. And now we have a question: how to create a mark on the map in PDA? So, i‘ll tell you how to. For example: I have created an anomaly zone "Garbage" at linked up Pripyat(on the stadium). In alife_l11_pripyat.ltx:

Then we built the spawn (Also - delete old all.spawn from the folder). Then we run the compilator. After compilation we get a file new.spawn, rename it into all.spawn and then find the folder gamedata/scripts. Open file pda.script. In this script there are registered different things in PDA, including marks on the map. We need only this table:

zero_b1_spot - SID of our mark, st_zero_b1_name - id of our mark. Then close this file and save changes. Oh, and now go to the folder configs/text/somefile(At this moment I could make a mistake, ‘cos I don‘t know how does this folder differ from english one, but I exactly know that it differs. So, just find folder with the "string_.." files(like "string_table_enc_equipment.xml" and so on)), open any file you want and add somewhere this:

<string id="st_zero_b1_name">
<text>Here you write the text, that appears when cursor is on mark.</text>
</string>

I hope you undestand why xml-section is called "st_zero_b1_name". Also, I want to add, that all names of marks in vanilla CoP are situated in the file configs/text/st_land_names.xml (IT‘S IMPORTANT: I don‘t know where the string-files in english version of CoP are situated, so be carefull.)

Author: Zero cool (cavenagi) (uin-1514138).Translation: I asked man called RafMadMan(Yup, I know he‘s from Russia(I can speak Russian, not fluently but can.)) to translate it for me, and he asked me to post it here. So, it isn‘t my work, I take no credits for posting it here.

First you must create anm-file, and put it here gamedata\anims\camera_effects\scenario_cam\name_of_location\. Then decompile all.spawn and create in alife-file of location you need a section of anomaly: