ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
How to mod Stalker (most questions answered)

« Previous 10 events | 1 ... 7 8 9 10 11 12 13 14 15 ... 67 | Next 10 events »
Posted by/on
Question/AnswerMake Oldest Up Sort by Ascending
  21:14:10  3 January 2011
profilee-mailreply Message URLTo the Top
gannebamm
has abondened XRay and uses Unity3D now
(Resident)

 

 
On forum: 05/02/2007
 

Message edited by:
gannebamm
01/03/2011 21:15:38
Messages: 1077

---QUOTATION---
Hello. I want to ask some questions.
But I am Japanese,so I think my English is sometimes wrong. Please forgive me.

I want to edit NPC's movement.
When I spawn NPCs,I want them to sit near small fire and play the guitar.
But I couldn't find file which is written about NPC's movement.
Which files should I edit?


Please tell me hints or solutions.



Then I used this way when I spawn NPCs.

1, I created a new file "join.script" in gamedatascripts.

2, I wrote this in that file.


function spawn(spawn_item) 
local actor_position = vector() 
actor_position = db.actor:position() 
actor_position.z = actor_position.z - 2 
return 
alife():create(spawn_item, vector():set(actor_position.x, actor_position.y, actor_position.z), db.actor:level_vertex_id(), db.actor:game_vertex_id()) 
end 

function stalkers() 
spawn("mil_stalker_respawn_2") 
end 



3, I edited "ui_main_menu.script"


function main_menu:OnKeyboard(dik, keyboard_action)  --virtual function
	CUIScriptWnd.OnKeyboard(self,dik,keyboard_action)
	local bind = dik_to_bind(dik)
	local console = get_console()
	
if keyboard_action == ui_events.WINDOW_KEY_PRESSED then
	if dik == DIK_keys.DIK_ESCAPE then
		if level.present() and (db.actor ~= nil) and db.actor:alive() then
		console:execute("main_menu off")
		end
	end

	if dik == DIK_keys.DIK_1 then 
	joinjoin.stalkers() 
	end


---END QUOTATION---


You could:
1. create a special scheme for that stalker you spawn which handles his movement and such.
2. give the spawned npc a custom data entry with logic. This logic could refer to a special smart_terrain (place to which jobs like playing guitar are linked to) and create in that smart_terrain a new job which is exclusive for your special npc

The spawned npc has no custom data entry with a smart_terrain link, so it´s movement is controlled by a standart scheme ( scheme´s are kind of finite state machines which check in which state (=scheme) the AI should act) and walking around with no real aim. In general all AI is linked to a smart_terrain (or at least a smart_terrain type [like general_lager/general_lair] which let them move to them and accept jobs in them. These jobs itself will tell the scheme handler to use a special scheme (eg. sitting around and camp, with periodically using the guitar or telling a joke).


---QUOTATION---
you should look around on mod wiki, and check smart terrain tutorial, or simply, use kamp scheme for fireplace.
---END QUOTATION---


indeed:
http://sdk.stalker-game.com/en/index.php?title=Schemes
http://sdk.stalker-game.com/en/index.php?title=Logic
http://sdk.stalker-game.com/en/index.php?title=Smart_Terrain_Tutorial
  21:00:30  3 January 2011
profilee-mailreply Message URLTo the Top
dezodor
level designer
(Resident)

 

 
On forum: 04/08/2007
Messages: 3803
you should look around on mod wiki, and check smart terrain tutorial, or simply, use kamp scheme for fireplace.
  08:52:23  3 January 2011
profilee-mailreply Message URLTo the Top
highmega3
(Novice)
 
On forum: 01/03/2011
 

Message edited by:
highmega3
01/03/2011 8:56:10
Messages: 18
Hello. I want to ask some questions.
But I am Japanese,so I think my English is sometimes wrong. Please forgive me.

I want to edit NPC's movement.
When I spawn NPCs,I want them to sit near small fire and play the guitar.
But I couldn't find file which is written about NPC's movement.
Which files should I edit?


Please tell me hints or solutions.



Then I used this way when I spawn NPCs.

1, I created a new file "join.script" in gamedatascripts.

2, I wrote this in that file.


function spawn(spawn_item) 
local actor_position = vector() 
actor_position = db.actor:position() 
actor_position.z = actor_position.z - 2 
return 
alife():create(spawn_item, vector():set(actor_position.x, actor_position.y, actor_position.z), db.actor:level_vertex_id(), db.actor:game_vertex_id()) 
end 

function stalkers() 
spawn("mil_stalker_respawn_2") 
end 



3, I edited "ui_main_menu.script"


function main_menu:OnKeyboard(dik, keyboard_action)  --virtual function
	CUIScriptWnd.OnKeyboard(self,dik,keyboard_action)
	local bind = dik_to_bind(dik)
	local console = get_console()
	
if keyboard_action == ui_events.WINDOW_KEY_PRESSED then
	if dik == DIK_keys.DIK_ESCAPE then
		if level.present() and (db.actor ~= nil) and db.actor:alive() then
		console:execute("main_menu off")
		end
	end

	if dik == DIK_keys.DIK_1 then 
	joinjoin.stalkers() 
	end

  21:28:06  20 October 2010
profilee-mailreply Message URLTo the Top
Nuor
Senior Resident
 

 
On forum: 03/10/2009
Messages: 735

---QUOTATION---
Don't you mean inventory_for_each()?

The biggest difference between inventory_for_each() and iterate_inventory() is that the latter includes quest items.
---END QUOTATION---



Yes - inventory_for_each().
  20:10:10  20 October 2010
profilee-mailreply Message URLTo the Top
notanumber
mod abuser & exploiter
(Resident)

 

 
On forum: 03/22/2008
Messages: 2818
Don't you mean inventory_for_each()?

The biggest difference between inventory_for_each() and iterate_inventory() is that the latter includes quest items.
  23:03:57  29 September 2010
profilee-mailreply Message URLTo the Top
Vintar
a bit of this and a lot of that
(Resident)

 

 
On forum: 08/08/2008
Messages: 6349
Thanks for the insight nuor. I have now found that using the server entity of npc bject() will also act on active slots
  22:34:47  29 September 2010
profilee-mailreply Message URLTo the Top
Nuor
Senior Resident
 

 
On forum: 03/10/2009
Messages: 735
Vintar - I haven't tested iterate_inventory but I have used iterate_for_each for a similar purpose and it reads the slots also.

A caveat - In my experience using iterate_for_each has caused problems in some situations. It has been erratic working on some installs and not on others with no clear explanation as to why.
  15:43:40  29 September 2010
profilee-mailreply Message URLTo the Top
Vintar
a bit of this and a lot of that
(Resident)

 

 
On forum: 08/08/2008
 

Message edited by:
Vintar
09/29/2010 15:46:45
Messages: 6349

---QUOTATION---
If only we could create a custom tracer section...

Not sure if this is what you're after, but by using the following line in each ammo section in weapons.ltx you can specify the color of tracer for each ammo type based on the color table at the top of the weapons.ltx file:

tracer_color_ID = x

where x is from the color table.
---END QUOTATION---



Yeah, but I need a really big and slow tracer, and if I edit the details, all tracers behave the same :/

I have two more questions :

1) Does anyone know if this function works :

function iterate_inventory(function<void>, object)

2) if yes then does it iterate on weapons in slots aswell ?

The reason I ask is that I think I have the function working like I want, but, it doesnt seem to act on items that are in slots already like pistol or rifle.

In death manager, it seems that the inventory is iterated, then weapons in slot 1 and 2 are treated separately, so perhaps it is so.
  06:16:47  26 September 2010
profilee-mailreply Message URLTo the Top
chuppa
Senior Resident
 

 
On forum: 04/11/2008
Messages: 409

---QUOTATION---
If only we could create a custom tracer section...
---END QUOTATION---



Not sure if this is what you're after, but by using the following line in each ammo section in weapons.ltx you can specify the color of tracer for each ammo type based on the color table at the top of the weapons.ltx file:

tracer_color_ID = x

where x is from the color table.
  08:57:02  6 September 2010
profilee-mailreply Message URLTo the Top
Vintar
a bit of this and a lot of that
(Resident)

 

 
On forum: 08/08/2008
Messages: 6349
If only we could create a custom tracer section...
 
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.: Shadow of Chernobyl Forum » Mod discussion
 

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


 

Copyright © 1995-2020 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.