Results 1 to 6 of 6

Thread: Need help with a repetitive random plague script please

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Need help with a repetitive random plague script please

    First of all, first post here so hi to all mod-semi gods and mod-peasants out there!

    What I want to do:

    I want to infect a number of regions with the plague within a given timescale randomly based on a percentage, not all at the same time,although it wouldn't hurt if this happened once or twice so no excluding factor has to be done. Once this works I want to alternate between plague, locusts and famine.

    My first idea was to do this entirely in the descr_events file. Wouldn't work due to the "not all at the same time" part. Second approach was to salvage a script written by alpaca and try to adapt it.

    Spoiler Alert, click show to read: 
    declare_counter plague_counter
    monitor_event FactionTurnStart I_TurnNumber >= 50
    if RandomPercent <= 25
    event plague position 281,163
    set_counter plague_counter 1
    end_if
    if I_TurnNumber = 53
    and I_CompareCounter plague_counter = 0
    event plague position 281,163
    end_if
    terminate_monitor
    end_monitor


    Would this work? Would the plague be recognized correctly with the position? How much would a thing like this in the campaign script affect performance if you do it for a lot of regions? Does anybody have a better idea? I would love to see the functionality in DLV and would give full credit to anybody helping me with this.

    The alternate idea is to make a console_command version that only deducts from the population, but this would take away the diminishing garrison, not much of a problem though if this is a lot easier to make and less performance affecting.
    Last edited by Furin; August 28, 2007 at 07:20 PM.

    Under the benevolent guidance of jimkatalanos

  2. #2
    Turbo's Avatar Civitate
    Join Date
    Oct 2004
    Location
    New Jersey
    Posts
    2,152

    Default Re: Need help with a repetitive random plague script please

    Instead of using the coordinates, I suggest using the name of the settlement. Otherwise try dropping Alpaca a PM and ask him.
    Work of God

  3. #3
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Need help with a repetitive random plague script please

    It should work with either coordinates or settlement name.

    You could set counters for each settlement if you wanted to limit the plague or locusts or whatever so it wouldnt happen that often. Then reset the counters randomly or based on turns.

    You can reduce population via script but I dont think you can reduce garrisons.

  4. #4

    Default Re: Need help with a repetitive random plague script please

    I have settled with an easier approach, doing half the minimod in the campaign script via console command (based on random and, if I manage, health) and settlement names, and the other half as plague directly in the events file.

    Thanks for your input guys, your suggestions were very good and valid. As soon as I have more understanding I will implement them.

    Under the benevolent guidance of jimkatalanos

  5. #5
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: Need help with a repetitive random plague script please

    By the way, you can use add_events (check the docudemon for how it's used) to schedule events via the event manager (i.e. create a plague event based on certain conditions).
    From your PM I thought you want to always have one within a certain time period which is why I suggested using the event file.

    No thing is everything. Every thing is nothing.

  6. #6

    Default Re: Need help with a repetitive random plague script please

    Hmm sorry, I am not a native speaker and sometimes I just fail to make myself clear.

    Under the benevolent guidance of jimkatalanos

Posting Permissions

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