Page 5 of 5 FirstFirst 12345
Results 81 to 93 of 93

Thread: Creating a World - Disasters and the add_events command

  1. #81

    Default Re: Creating a World - Disasters and the add_events command

    Oh wow! Thanks Callistonian! That's a lot of good information. I think, as Gigantus was saying, the script editor is maybe telling that certain lines like "region the sea" are not necessary, so I will strip them out and see what happens.

    I do have one question about the label thing, Callistonian. Are you saying that I can just write "label idiot1" where the name usually goes? Like this:

    character label idiot1, general, age 30, x 109, y 144

    or do I still need to write it like this:

    character John, general, age 30, x 109, y 144 label idiot1

    The first instance would be the best and easiest way, but I'm not sure if the game allows that. Is that what you were telling me to do?


    Also, I found an even better way to spawn storms. I now use a Heretic, who dies in the storm and is not even mentioned in the storm panel, but sometimes you can see him dying if no one is standing where he spawns. If I don't need to use specific slave names for the heretics, then that would be great. On the other hand, I kind of want the heretic to survive so that the player thinks that the arrival of a heretic or maybe a witch was the cause of the storm. LOL...

    (Maybe I shouldn't kill him. )

  2. #82

    Default Re: Creating a World - Disasters and the add_events command

    Well, I learned something about the spawn command. It appears that there are only two that work: spawn_army or spawn_character. (I'm sure most scripters probably already knew that.) I was trying to figure out why errors appeared in the system.log file, and tried spawn_agent, but that caused the game to crash. I also wanted to do what Calisstonian suggested and also eliminated the odd captain character. While using heretic, it worked, but I noticed that I had not changed the spawn_army command. I thought this was the source of the errors, so I changed it to spawn_character, but that failed to produce the heretic and the storm.

    It appears that spawn_army can produce an agent that can then be killed. I'm not sure why that is, but spawn_character failed repeatedly for me. I also changed the names of the heretics to simply label idiot1, etc., but this only works in the following set-up:

    Code:
    character    label idiot1, heretic, age 30, x 122, y 99 label idiot1
    If I chop off label idiot1 at the end, it doesn't work. Nothing happens and nothing appears. Still, it saves room for heretics who need names from a fairly limited list (I plan to expand it) and allows more heretics to spawn than normal (which I like). Anyway, just something I noticed through trial and error.

  3. #83
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,131
    Blog Entries
    35

    Default Re: Creating a World - Disasters and the add_events command

    This is a valid line from 1648 (spawn_agent is invalid):
    Code:
    spawn_character    france, random_name, priest, age 40, x 112, y 60
    It does not allow to add any of the character details that spawn_army allows, like portrait, label etc

    Using an agent name with spawn_army and the above mentioned details does work (most likely because the required bodyguard does not exist anymore) - however the agent dies when loading the save. See this discussion and Withnwar's conclusion.
    Last edited by Gigantus; October 25, 2023 at 10:23 PM.










  4. #84

    Default Re: Creating a World - Disasters and the add_events command

    Quote Originally Posted by Nordlaender View Post
    character label idiot1, general, age 30, x 109, y 144

    or do I still need to write it like this:

    character John, general, age 30, x 109, y 144 label idiot1
    The second line is correct except you're missing a comma after 144 (comma might actually be optional, idk). The first entry after character should be a valid name from the faction's name list in descr_names. I don't think the order of the other entries matters, I'm not even sure they need to be delimited by commas, that's just always how I've seen it done.

    I would guess that the heretic doesn't give a death message due to the storm simply because he belongs to a different faction (slave), so you could still use a named character (general) with a label just belonging to the slave faction.

  5. #85

    Default Re: Creating a World - Disasters and the add_events command

    Hey! Yeah, you're right. I tried it yesterday and it didn't work. Also, I initially put a comma behind the numbers before the "label idiot1" stuff, but I accidentally removed it and it didn't make any difference in the system.log file.

    Also, I got rid of persistent error messages in the log file that said <kill_character> blah, blah, blah, cannot recognize "label" by removing "label" and writing it just like this:

    Code:
    kill_character idiot1
    Another thing, you were right about the game ignoring a console command that damages a structure that has not been built yet or is not present in the settlement, but the system.log records it as an error:

    Code:
    18:58:10.918 [game.script.exec] [trace] exec <console_command> at line 265 in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    18:58:10.918 [game.script] [error] Script execution error for <console_command>, at line 265, in mods/Bare_Geomod/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    set_building_health Constantinople port 20 
    err: no building of this type in settlement
    I don't think it matters much. What I find disturbing in the system.log is the endless found/exists entries that I cannot figure out why they are there. I suspect that Bare Geomod does not contain everything from the Vanilla game and so these references are about not finding things in Geomod, but then finding them in the Vanilla version and then using that. I wish I could get rid of all that stuff so I can see the real errors I need to work on.

    I'm happy to say that I have finished my Mediterranean Cyclone, and it starts at Marseille and travels all the way to Constantinople. I'm very happy with the result. I'd like to start it in the middle of the sea near the Spanish islands on turn 0, but it would not show up there. Not sure why. Maybe I miscoded it somehow. I could not have done it without you and Gigantus helping me, so thanks a lot for that!

    I am now working on earthquakes for the Turks to deal with. My first one was hilarious, but it does not do hardly any damage. No building damage, only some citizens die. I will need some kind of if I_TurnNumber type bracket I think to get the console commands to do damage to Ceasarea. The in-game graphics for the earthquake are extraordinary, to say the least. It's only fair that it does a lot of damage to stone structures, so I'm working on that now. I have been looking at a script you wrote earlier in this thread, and I hope it will work for the earthquake damage.

  6. #86

    Default Re: Creating a World - Disasters and the add_events command

    Quote Originally Posted by Gigantus View Post
    This is a valid line from 1648 (spawn_agent is invalid):
    Code:
    spawn_character    france, random_name, priest, age 40, x 112, y 60
    It does not allow to add any of the character details that spawn_army allows, like portrait, label etc

    Using an agent name with spawn_army and the above mentioned details does work (most likely because the required bodyguard does not exist anymore) - however the agent dies when loading the save. See this discussion and Withnwar's conclusion.
    Wow, that was really interesting, but also disappointing. I want to spawn agents like heretics via script that stay in the game until they die by some other means. I don't know if that is possible, but I plan to find out. So far I have failed, but I'm sure my script is not correct in some way. Thanks for those links!

  7. #87
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: Creating a World - Disasters and the add_events command

    Quote Originally Posted by bitterhowl View Post
    Seems that I dealed with storms - they're vital for my mod.

    Event fires only with one line of coordinates scripted + named_character near. The coordinates of storm and named character shouldn't match, he should be near by in same region.

    Doesn't fire with region condition. Doesn't fire with any other character instead. Doesn't fire with admiral only fleet (didn't tested with army aboard).
    can you please post your script? both the disaster one AND the navy spawn one

  8. #88
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: Creating a World - Disasters and the add_events command

    Sorry for late reply, I didn't implement this into my mod as a complete script, just studied it for next versions of mod. I find this part of drafts and will test it in my mod again for complete part of the code. An then I'll post it here ofc.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  9. #89
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: Creating a World - Disasters and the add_events command

    Quote Originally Posted by Jadli View Post
    The OP says the floods are bugged, as the halfed mp and inability to build forts/watchtowers remains permanent, though that is not entirely true.

    It is possible to unbug it. There is a "working" example from Westeros Total War (they use it for Moat Cailin region)

    Code:
    event        flood
    frequency    1
    winter        false
    summer        false
    ;warning        false
    position 74, 204
    position 64, 202
    position 61, 195
    position 73, 191
    position 70, 194
    position 81, 141
    climate        swamp
    ;climate        unused1
    min_scale    2
    max_scale    5
    Im not sure if they knew about the bug or not... its possible they knew, but they didnt mind if it happened, as Moat Cailin is supposed to very inhospitable.

    Anyway, as this flood disaster is very frequent (the mod has like 2 or 4 TPY, so it happens quite often), after a few turns it is going to happen at the same position again (each time the disaster happens, one of the positions is apparently randomly picked... though they are all in the same region, so seemingly not much changes, except the position of the visual flood, if you can see it).

    And when it happens again at the same position, it gets unbugged! After the second flood at the same position the movement points are restored, and you can build forts/watchowers again, I tested this .

    So I think the OP should change, as you can use floods just fine, but you always have to add a second flood shortly after (unless you want a specific region to be "inhospitable") at the same position. Of course, this happens only to the affected region.

    (A funny side note, how I came to testing this... in a hotseat we struggled with endless "storm" in WTW.. suddenly all ships lost half their mp, and it lasted for many turns... However, as the storms are disabled in WTW, I eventually found out it must be actually caused by a bugged flood... and indeed, the last position in the sample script I show above is supposed to be in a swamp, but its actually in a sea river, therefore in sea region. And hence the same bug applies, but only to the sea region this time... and it gets unbugged the moment the flood happens in the same sea location again)

    I have this in my data/world/maps/base/descr_disasters.txt and it doesnt seem to be working

    Code:
    event        flood
    frequency    4    
    winter        false
    summer        false
    warning        false
    position 188, 219
    position 188, 220
    position 187, 220
    position 186, 220
    position 185, 220
    position 185, 221
    position 184, 221
    position 183, 221
    ;;;position 182, 221    ;;; thats where the giants are so no flood here
    position 181, 221
    position 180, 221
    position 180, 222
    position 179, 222
    position 178, 222
    position 177, 223
    ;climate        swamp
    ;climate        unused1
    min_scale    3
    max_scale    5
    any hint?
    Last edited by leo.civil.uefs; February 11, 2024 at 01:13 AM.

  10. #90
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: Creating a World - Disasters and the add_events command

    winter false
    summer false

    You should choose summer or winter to be true.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  11. #91
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: Creating a World - Disasters and the add_events command

    Quote Originally Posted by bitterhowl View Post
    winter false
    summer false

    You should choose summer or winter to be true.

    Code:
    here is a piece from the vanilla file:
    
    ; event			event_type
    ; frequency		in years
    ; winter		only occurs in winter
    ; summer		only occurs in summer
    ; warning		provides a one year warning
    ; position		position event can occur in strat coords [can specify multiple positions on consecutive lines]
    ; region		region event can occur by region name [can specify multiple regions on consecutive lines]
    ; climate		climate event can occur by climate name [can specify multiple climates on consecutive lines]
    ; min_scale		minimum size for event
    ; max_scale		maximum size for event
    
    
    event		earthquake
    frequency	20
    winter		false
    summer		false
    warning		false
    climate		rocky_desert
    min_scale	2
    max_scale	5
    the winter/summer lines are to make the disaster occur in only one of this season as the instructions in the vanilla file explains.
    my interpretation is that once you comment out both lines the disaster then occurs in any season.

  12. #92
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: Creating a World - Disasters and the add_events command

    Seems like this way you disabled it at all, since you say flood didn't happen in game.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  13. #93
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,131
    Blog Entries
    35

    Default Re: Creating a World - Disasters and the add_events command

    I think the default for winter\summer is 'true' - hence not entering it results in disabling the event as bitterhowl mentions.










Page 5 of 5 FirstFirst 12345

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •