ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
spawning through a script help

« Previous 10 events | 1 2 3 | Next 10 events »| All Messages
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  05:49:52  26 February 2013
profilee-mailreply Message URLTo the Top
Alundaio
Sad Clown
(Resident)

 

 
On forum: 04/05/2010
Messages: 2230
There is not much difference between spawning by script or from the all.spawn. There is no magical thing that makes spawns random or randomly in different locations unless the script itself does it. The only issue I see where an NPC wouldn't spawn at a given position is if it's an invalid vertex id. If the spawn count is doubling after reloads that means you need to store the ids of the created objects to persist through saves.

It's entirely safe and healthy to spawn by script. In Call of Pripyat, for example, that's the only way NPCs are spawned.
  17:25:31  26 February 2013
profilee-mailreply Message URLTo the Top
insanelazarez
Yeah, Good Luck With That...
(Resident)

 

 
On forum: 01/31/2009
Messages: 1070

---QUOTATION---
There is not much difference between spawning by script or from the all.spawn. There is no magical thing that makes spawns random or randomly in different locations unless the script itself does it. The only issue I see where an NPC wouldn't spawn at a given position is if it's an invalid vertex id. If the spawn count is doubling after reloads that means you need to store the ids of the created objects to persist through saves.

It's entirely safe and healthy to spawn by script. In Call of Pripyat, for example, that's the only way NPCs are spawned.
---END QUOTATION---



Well, if the spawn script has an issue that is a problem. But consider this...

On purpose lets create a npc via all.spawn but on a invalid location... result the game will crash. And why... because the spawn location is invalid. Test it again... and again will crash. And so on.

Now keep the coordenates and delete the all.spawn. Now create a 'Magic script' to produce the same npc... in the same coordenates.

Start a new game... and remember the location is still invalid... but now in 50% of the tests... the game wont crash at all. Why? Does this mean the 'Magic Script' is better than all.spawn? For some modders, maybe. For me it just means one thing, the 'Magic Script' is not creating the npc where it should... at all. For some reason the game doesn't crash. This is easy to understand.

I know in cop the spawns are generated by script. And result is one hell of a mess.

Cop game files here... actor in zaton:

;zat_a1_logic.ltx


---QUOTATION---


[logic]
active = sr_idle@game_start

[sr_idle@game_start]
on_info = {=actor_on_level(zaton)} sr_idle@game_start_2 %=damage_actor_items_on_start%

[sr_idle@game_start_2]
on_info = sr_idle@timer %+zat_a1_game_start%

[sr_idle@timer]
on_game_timer = 3000 | sr_idle@free %+zat_a1_simulation_start%
on_info = {+about_skadovsk_dialog_done -zat_a2_reach_base} %+zat_a2_reach_base =give_task(zat_a2_reach_base)%
on_info2 = {-zat_a2_reach_base =actor_in_zone(zat_a2_sr_noweap)} %+about_skadovsk_dialog_done +zat_a2_reach_base%
on_info3 = {-zat_a2_reached_skadovsk =actor_in_zone(zat_a2_sr_noweap)} %+zat_a2_reached_skadovsk =scenario_autosave(st_save_zat_a2_reached_skadovsk)%


---END QUOTATION---



Remember the lag when the game starts? Take a good guess... '+zat_a1_simulation_start'... the info is checked by 'zat_sim_29.ltx'


---QUOTATION---

[spawn_stalker@novice]
spawn_squads = stalker_sim_squad_novice
spawn_num = {+zat_a1_simulation_start -zat_b28_heli_3_searched -zat_b100_heli_2_searched -zat_b101_heli_5_searched} 4, 0

[spawn_stalker@advanced]
spawn_squads = stalker_sim_squad_novice, stalker_sim_squad_advanced
spawn_num = {+jup_b218_pripyat_group_gathering} 0, {+zat_a1_simulation_start +zat_b28_heli_3_searched} 4, {+zat_a1_simulation_start +zat_b100_heli_2_searched} 4, {+zat_a1_simulation_start +zat_b101_heli_5_searched} 4, 0

[spawn_stalker@master]
spawn_squads = stalker_sim_squad_advanced, stalker_sim_squad_advanced, stalker_sim_squad_veteran
spawn_num = {+zat_a1_simulation_start +jup_b218_pripyat_group_gathering} 4, 0


---END QUOTATION---



So in 3 seconds the game, is creating npcs assigned to smart terrains (the smart terrains... you know... the worst feature of the stalker games... duh!!!).

And this doesn't include the 'auto save' feature enabled. How many times the game crashes when you load an auto save? It's like 70% ctds, maybe more.

I like to create things by script too... like this:


---QUOTATION---


[sr_idle@game_start_2]
on_info = sr_idle@timer %=spawn_npc_in_zone(scientific_outfit:zat_a2_sr_noweap) +zat_a1_game_start%


---END QUOTATION---




See? We have a nice suit in that location now... but a suit is just a suit. Unless you have a smart terrain for it ahahaha...

People don't like all.spawn because it is time consuming... and it's easier to use a 'Magic script'... to create squads... for smart terrains (and other things).

And btw, you can create npcs by all.spawn too... but the 'spawn condition function' (if present) was changed by gsc. And it becomes obsolete, the item will spawn always from the start. Some 'Magic Scripter' decided that the function 'to spawn an npc if a condition is present'... is not good, WOW!!!

To compensate us... gsc gave us a nice autosave feature, for 3 seconds later to recreate some very nice... smart terrains, ahahah.

My post reflects an opinion, in this case... my opinion.

Well, i just added a coop npc to my 'Stalker survival' game mode.

Here...

[link]

http://www.youtube.com/watch?v=43zqU-qC4_I

[/link]

But believe, or not the hostile waves are created by script... and i have an autosave feature too (betwen waves of course). Do you see any lag?

Well, that's it...
  17:56:41  26 February 2013
profilee-mailreply Message URLTo the Top
Alundaio
Sad Clown
(Resident)

 

 
On forum: 04/05/2010
Messages: 2230
The long load times in Call of Pripyat isn't due to script spawning it's because the levels are much larger and that the gulag is generated from scratch.
  18:19:18  26 February 2013
profilee-mailreply Message URLTo the Top
ThunderFreak
Senior Resident
 

 
On forum: 08/07/2009
 

Message edited by:
ThunderFreak
02/26/2013 18:19:55
Messages: 685
There are reasons to use the all.spawn but there are also reasons to use a 'Magic Script'. Specially when it comes to dynamic features, then you are forced to use Magic Scripts. (I like that name - Magic Script. Sounds cool. I am serious. )
In my ShoC mod project 'Project Invasion' i have dynamic anomalies which means after every blowout the anomalies disappear from their current position and appear again on a totally different position. This can be done only by a Magic Script. If you like I can give you much more examples when it's better to use a spawn script or when you can't use the all.spawn.
  20:45:32  26 February 2013
profilee-mailreply Message URLTo the Top
insanelazarez
Yeah, Good Luck With That...
(Resident)

 

 
On forum: 01/31/2009
Messages: 1070

---QUOTATION---
The long load times in Call of Pripyat isn't due to script spawning it's because the levels are much larger and that the gulag is generated from scratch.
---END QUOTATION---




I never said anything about loading times, mate.
  21:21:57  26 February 2013
profilee-mailreply Message URLTo the Top
insanelazarez
Yeah, Good Luck With That...
(Resident)

 

 
On forum: 01/31/2009
Messages: 1070

---QUOTATION---


I like that name - Magic Script. Sounds cool. I am serious...


---END QUOTATION---



You are welcome... and i am serious too...

But i also think all.spawn, deserves a new name:

All.spawn definition:

'Non Dynamic Crappy File - Should be Deleted by Magician after update'

In fact why not create a mod where you move the all.spawn... to the recycle bin? I mean... nobody is using it, right?

Imagine the Magic we can do if we delete the 'Non Dynamic Crappy File'. See? We already have HDDs with 5TB... but 4.5 Mb more is always a good idea. We can always call it... Magic.

Duh...

Guys, i am messing around... but like i said in the my previous post... it was just an opinion.

Btw, you can't move anomalies via all.spawn... only because the script support for that doesn't exist. We just need to create it. I mean, to open a locked door you need a key. It doesn't mean the door (or the key) are bad. Both things are required.

If you guys, don't agree with me... well... you can always blame that guy from youtube...

[link]http://www.youtube.com/watch?v=A-H_AJPrhL8[/link]

Disclaimer:

No 'Magic Script' or 'Non Dynamic Crappy File' were used to upload the previous video. Only 'Firefox'...

You're Welcome...
  12:18:30  27 February 2013
profilee-mailreply Message URLTo the Top
ThunderFreak
Senior Resident
 

 
On forum: 08/07/2009
Messages: 685
Now he got it wrongly. What I tried to say is not every thing can be done with the all.spawn. For dynamic stuff you need a script. That's all what I tried to say.
  12:45:35  27 February 2013
profilee-mailreply Message URLTo the Top
Alundaio
Sad Clown
(Resident)

 

 
On forum: 04/05/2010
Messages: 2230
It's fine you want to use the all.spawn, nothing wrong with that. But you were making silly claims about spawning by script being random and laggy.
  16:53:33  27 February 2013
profilee-mailreply Message URLTo the Top
Rattertat
(Novice)
 
On forum: 02/20/2013
Messages: 4
Hi ThunderFreak, ok I have found the issue I think. I had a script for making bolts limited and I think for what ever reason that was messing up the spawn scripts. I removed that from my game and now the spawn scripts work great. I loaded and reloaded many many many time to test. The zombies spawn in the same place each time with the correct number . I have now used that script as a template to spawn chimeras too!!! I tested that many many time and it works great.

One more thing I would like to know if possible. Rather then making the script from a function (like when I select a text when talking to a NPC) is it possibloe to spawn a monster when entering a level? Is that more complicated to write out?

Thank you very much
  17:05:46  27 February 2013
profilee-mailreply Message URLTo the Top
insanelazarez
Yeah, Good Luck With That...
(Resident)

 

 
On forum: 01/31/2009
Messages: 1070

---QUOTATION---
It's fine you want to use the all.spawn, nothing wrong with that. But you were making silly claims about spawning by script being random and laggy.
---END QUOTATION---



Sorry, but it's a fact the things get messy by script. For some reason i use the all.spawn. Consider this... create a medkit by script somewhere. Make sure you memorize the position and repeat the spawn after say 15 seconds... is the second medkit in the same spot? And the coordenates are the same... so... why?

Btw, you guys are actually modding the all.spawn? I mean you guys actually tried to mod it? The point is, if a modder uses both techniques all.spawn and scripts... it should be pretty obvious the things with script are faster and easier. But everything gets messy. But if spawning by script is the only process you use... there's no comparison possible.

Lets face it, if we don't change all.spawn... how can we confirm someone's theory about using it? Jesus Christ...
 
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.