ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
Some questions about task creating

1 2 3
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  15:58:18  8 January 2013
profilee-mailreply Message URLTo the Top
The Xenus
(Senior)
 
On forum: 03/09/2011
Messages: 144
Some questions about task creating

I have made some new tasks for shoc and now i have some questions :

1. How i can make a mapspot for a special task npc, spawned by script ?

2. How i can make it that a mission is completed when the player has eliminate all stalkers in a smart_terrain ?

For the moment thats all
  00:48:29  9 January 2013
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
01/09/2013 0:48:57
Messages: 6349

---QUOTATION---
Some questions about task creating

I have made some new tasks for shoc and now i have some questions :
1. How i can make a mapspot for a special task npc, spawned by script ?
---END QUOTATION---


local s_obj = alife():create(my_dude)
level.map_add_object_spot(s_obj.id, "green_location", "my_hint")




---QUOTATION---
2. How i can make it that a mission is completed when the player has eliminate all stalkers in a smart_terrain ?
---END QUOTATION---



I dont have vanilla files infront of me, but if you check xr_gulag.script, there should be a function summin like get_gulag_population(gulag), so you would say something like
if xr_gulag.get_gulag_population("my_gulag_name") == 0 then
     --all are dead
end

  11:19:54  9 January 2013
profilee-mailreply Message URLTo the Top
The Xenus
(Senior)
 
On forum: 03/09/2011
Messages: 144

---QUOTATION---
if xr_gulag.get_gulag_population("my_gulag_name" == 0 then
--all are dead
end
---END QUOTATION---



And this function i write in a separate scriptfile ?
  18:53:02  9 January 2013
profilee-mailreply Message URLTo the Top
The Xenus
(Senior)
 
On forum: 03/09/2011
Messages: 144
Okay i would like to know another

How i can make it that when the gulag is clear from npc, a ingame message popup(with icon, sender name and text) ?
(maybe a example with both fuctions in one script ? )
  23:20:26  9 January 2013
profilee-mailreply Message URLTo the Top
Vintar
a bit of this and a lot of that
(Resident)

 

 
On forum: 08/08/2008
Messages: 6349

---QUOTATION---
Okay i would like to know another

How i can make it that when the gulag is clear from npc, a ingame message popup(with icon, sender name and text) ?
(maybe a example with both fuctions in one script ? )
---END QUOTATION---



Function check_and_report()
     if xr_gulag.get_gulag_population("my_gulag_name") == 0 then
          news_manager.send_tip_hud(header, text, sender, time, sound)  
     end
end



again, I dont have the vanilla files at hand, so just check that news_manager function name and params.
  12:12:10  16 January 2013
profilee-mailreply Message URLTo the Top
The Xenus
(Senior)
 
On forum: 03/09/2011
Messages: 144
Okay i have try it out and it works. The problem is that the textmessage not stops and always repeated. How can i stop this and made it that the message only one time showed up ?

Here is the script i use:


 function check_escape_event_1()
     if xr_gulag.getGulagPopulation("esc_bridge") == 0 then
        actor:give_info_portion("esc_blockpost_leader_dead")
     end
end

function check_escape_event_1_1()
	if has_alife_info("esc_blockpost_leader_dead") then
          news_manager.send_tip( db.actor, "tips_esc_soldier_sos", nil, "soldier", nil ) 
	end
end 

  18:43:51  20 January 2013
profilee-mailreply Message URLTo the Top
The Xenus
(Senior)
 
On forum: 03/09/2011
 

Message edited by:
The Xenus
01/20/2013 18:44:11
Messages: 144

local s_obj = alife():create(my_dude)
level.map_add_object_spot(s_obj.id, "green_location", "my_hint")



This function don`t work for me


I use this to spawn an npc and give him a mapspot.


create("esc_sids_courier",27.173040390015,1.1927669048309,24.741792678833,306643,90)
level_tasks.add_location(esc_sids_courier, "green_location", "esc_sids_courier")



But the npc is not mark when i start my task and he should be marked on the map.

Anyone knows how i can give my script spawned npc an mapspot for tasks ?
  23:25:31  20 January 2013
profilee-mailreply Message URLTo the Top
Vintar
a bit of this and a lot of that
(Resident)

 

 
On forum: 08/08/2008
Messages: 6349

alife():create("esc_sids_courier", vector():set(27.173040390015,1.1927669048309,24.741792678833), 306643,90)



Like that.
  12:30:12  21 January 2013
profilee-mailreply Message URLTo the Top
The Xenus
(Senior)
 
On forum: 03/09/2011
Messages: 144

---QUOTATION---

alife():create("esc_sids_courier", vector():set(27.173040390015,1.1927669048309,24.741792678833), 306643,90)



Like that.
---END QUOTATION---



Yes the npc spawn, after i activate the task. And the spot is too see on the map. But the spot is on the wrong position

Here is a screen:
[link]http://s7.directupload.net/file/d/3142/z6sicyti_jpg.htm[/link]
  14:10:32  21 January 2013
profilee-mailreply Message URLTo the Top
Vintar
a bit of this and a lot of that
(Resident)

 

 
On forum: 08/08/2008
Messages: 6349
Because you are adding th location where you spawn your guy but he has no logic aand walks away. You must add map spot to his id.
  14:22:40  21 January 2013
profilee-mailreply Message URLTo the Top
The Xenus
(Senior)
 
On forum: 03/09/2011
Messages: 144

---QUOTATION---
Because you are adding th location where you spawn your guy but he has no logic aand walks away. You must add map spot to his id.
---END QUOTATION---



Sure he has a logic and he don`t walk away. And i spawn my npc at the location they red marked on the screen i posted before.

How i can add a map spot to his id ?
  00:41:13  23 January 2013
profilee-mailreply Message URLTo the Top
Vintar
a bit of this and a lot of that
(Resident)

 

 
On forum: 08/08/2008
Messages: 6349

---QUOTATION---
Because you are adding th location where you spawn your guy but he has no logic aand walks away. You must add map spot to his id.

Sure he has a logic and he don`t walk away. And i spawn my npc at the location they red marked on the screen i posted before.

How i can add a map spot to his id ?
---END QUOTATION---



But i already told you how in my very first response to this thread...
  11:54:01  23 January 2013
profilee-mailreply Message URLTo the Top
The Xenus
(Senior)
 
On forum: 03/09/2011
Messages: 144

---QUOTATION---

But i already told you how in my very first response to this thread...
---END QUOTATION---



Yes but i told that this not work for me.

When i do it so, like in your first post then the mapspot is over the actor and not over the spawned npc. When i add not mapspot with a script and add a mapspot in tasks_escape then the the spot is like in the screenshot that i post before.
  20:33:50  23 January 2013
profilee-mailreply Message URLTo the Top
ThunderFreak
Senior Resident
 

 
On forum: 08/07/2009
 

Message edited by:
ThunderFreak
01/23/2013 20:34:10
Messages: 685
Additionally to Vintar's first answer to your question, I would suggest to use this map spot function
level.map_add_object_spot_ser(spawn_id,"esc_sids_couri er","green_location")

instead of the function you are using.
  22:54:49  23 January 2013
profilee-mailreply Message URLTo the Top
Vintar
a bit of this and a lot of that
(Resident)

 

 
On forum: 08/08/2008
Messages: 6349

---QUOTATION---
Additionally to Vintar's first answer to your question, I would suggest to use this map spot function
level.map_add_object_spot_ser(spawn_id,"esc_sids_couri er","green_location")

instead of the function you are using.
---END QUOTATION---



It makes no difference, he is clearly doing something wrong, the code in my first post will work.
  07:46:39  24 January 2013
profilee-mailreply Message URLTo the Top
Alundaio
Sad Clown
(Resident)

 

 
On forum: 04/05/2010
 

Message edited by:
Alundaio
01/24/2013 7:56:06
Messages: 2230

---QUOTATION---
level_tasks.add_location(esc_sids_courier, "green_location", "esc_sids_courier"
---END QUOTATION---



level_tasks.add_location(story id number,map_spot,hint)

Is esc_sids_courier in the first parameter a variable that holds the NPCs story id? It must be a number.

If you don't have a story id defined for the NPC you have no choice but to do it the way it has already been suggested, which is like this:


local se_obj = alife():create("esc_sids_courier",vector():set(27.173040390015,1.1927669048309,24.741792678833),306643,90)
level.map_add_object_spot_ser(se_obj.id, "green_location", "esc_sids_courier")



If it is following the actor then you are missing the step of using the NPCs id.
  17:03:55  24 January 2013
profilee-mailreply Message URLTo the Top
The Xenus
(Senior)
 
On forum: 03/09/2011
Messages: 144
I spawned the NPC with a script, so this npc hasn`t an story id. The script function, they Vintar posted works not for me. But Thunder freak give me the right script function. The problem is that the spot is to see on the map, but i can use it in following of an mission.

I try to explain this:
In vanilla ShoC you can after you take a mission, to your pda and select the target. The Mapview goes to the selected target and you see the "questspot" from this target.

With the function they Thunder Freak posted is a spot to see, but i can`t switch to this target like in vanilla.

I hope you understand what i try to say.
(Sorry my english is terrible)
  21:41:11  24 January 2013
profilee-mailreply Message URLTo the Top
ThunderFreak
Senior Resident
 

 
On forum: 08/07/2009
 

Message edited by:
ThunderFreak
01/24/2013 21:41:30
Messages: 685
Did you remove this line (shown in bold)?

<objective>
<text>Meet the courier and take the document</text>
<map_location_type hint="esc_sids_courier">green_location</map_location_type>
<object_story_id>esc_sids_courier</object_story_id>
<infoportion_complete>esc_sids_courier_meet</infoportion_complete>
</objective>
  23:06:07  24 January 2013
profilee-mailreply Message URLTo the Top
nashathedog
Senior Resident
 

 
On forum: 01/31/2011
Messages: 8278
@ The Xenus, Seeing your work here I'm wondering does this mean the Moddb Clear sky mod you where promoting has been replaced with a SHOC one?
  11:57:32  25 January 2013
profilee-mailreply Message URLTo the Top
The Xenus
(Senior)
 
On forum: 03/09/2011
Messages: 144

---QUOTATION---
Did you remove this line (shown in bold)?

<objective>
<text>Meet the courier and take the document</text>
<map_location_type hint="esc_sids_courier">green_location</map_location_type>
<object_story_id>esc_sids_courier</object_story_id>
<infoportion_complete>esc_sids_courier_meet</infoportion_complete>
</objective>
---END QUOTATION---



Yes i do it, but thats not the solotion for my problem.

I use your script function Thunderfreak, and remove this lines in the tasks_escape.xml. The spot for my npc is to see on the map.

Here is a screen:
http://s14.directupload.net/file/d/3146/2o9sybe2_jpg.htm



@davideverett
No i have stop the work on my Clear Sky mod for the moment. because i must start to translate all written textfiles from the mod from german to english. I have found no helper to do this for me. And this translation need a long time, because it is so many written text in the mod and my english is not the best. So i take more time for a good translation
When i translate the exsisting textfiles to english, then i start to finish the mod. And then i will write all future textfiles in german and english.

This questions for shoc are only for a little shoc project i have start.
My mod for Clear Sky is not dead !
  22:48:51  25 January 2013
profilee-mailreply Message URLTo the Top
Vintar
a bit of this and a lot of that
(Resident)

 

 
On forum: 08/08/2008
Messages: 6349
You need to use story ids to add "buttons" or objective markers to the pda.
  22:54:26  25 January 2013
profilee-mailreply Message URLTo the Top
The Xenus
(Senior)
 
On forum: 03/09/2011
Messages: 144

---QUOTATION---
You need to use story ids to add "buttons" or objective markers to the pda.
---END QUOTATION---



Okay and this, i can only do when i spawn my npc with the all.spwan, right ?
Or can i write a story id in the game_story_id.ltx ?
  20:58:41  28 January 2013
profilee-mailreply Message URLTo the Top
ThunderFreak
Senior Resident
 

 
On forum: 08/07/2009
Messages: 685
How's the status? Could you manage to get it working?
  14:37:01  29 January 2013
profilee-mailreply Message URLTo the Top
The Xenus
(Senior)
 
On forum: 03/09/2011
Messages: 144

---QUOTATION---
How's the status? Could you manage to get it working?
---END QUOTATION---



unfortunately not

But I think I can live with it, that the "mapspot" is to see on the map but can`t selcet in the "task section" of the pda. I add a "remove mapspot" function after the task is complete. So it's fine.

The only way to add objective markers to pda, is to spawn the npc with all.spawn. Like Vintar said
 
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-2021 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.