Results 1 to 13 of 13

Thread: Specify Image Path for historic_event

  1. #1
    Callistonian's Avatar Ducenarius
    Join Date
    May 2018
    Location
    somewhere in the continental US
    Posts
    944

    Default Specify Image Path for historic_event

    We all know that historic_events will use messenger.tga as their default image if no image corresponding to the event name can be found in the UI folder. My question is if it's possible to specify a different image file similarly to how unit types in EDU can use info_pic_dir and card_pic_dir without having to make a new .tga with a file name corresponding to the event name.

    I have a number of events which use different text but the same image and I'd rather not have a ton of duplicate image files needlessly increasing the mod file size.

    I'm wondering if it's possible to do something like:

    Code:
    add_events
         event historic    event_name factions { england, }
         date        0
         position    x, y
         image image_name.tga   ;made this up
    end_add_events
    On the same note, is it possible to have multiple historic events in one add_events block as in:

    Spoiler Alert, click show to read: 

    Code:
    add_events
         event historic    event_name_1 factions { england, }
         event historic    event_name_2 factions { france, }
         date        0
         position    x, y
    end_add_events

  2. #2
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Specify Image Path for historic_event

    Question 1: I don't believe so. If all other historic events do have pictures then the fallback one (reading monk in vanilla) isn't used, so you could replace that fallback one with your own, thereby used by your "duplicate" events.

    Question 2: pretty sure you can, hence the plural "add_events", but the syntax might be more like...

    Code:
    add_events
         event historic    event_name_1 factions { england, }
         date        0
         position    x, y
         event historic    event_name_1 factions { france, }
         date        0
         position    x, y
    end_add_events
    Warning: date 0 doesn't work with all turns-per-year settings, e.g. 12TPY. It does work in the first turn.

  3. #3
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

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

    Default Re: Specify Image Path for historic_event

    One normally only uses the add_events format for historic events if you wish to make use of the locator button, it is by far more convenient to use the simple historic_event command.

    You actually don't have to worry about file size of duplicated TGAs in installers afaik - I have seen often enough that duplicates hardly require space in the installer, different story on the hard disk. But even then using TGA compression will greatly reduce the file size:

    The default, uncompressed map_climates file size is 656KB (Targa Type 2), the compressed size is 28KB (Targa Type 10). Once again the installer will compress the default file that much during compiling but it will install with the full size.










  4. #4
    Callistonian's Avatar Ducenarius
    Join Date
    May 2018
    Location
    somewhere in the continental US
    Posts
    944

    Default Re: Specify Image Path for historic_event

    It seems that specifying factions for add_events doesn't work. I.e. the part in red below has no effect and this event will be sent out to all factions.

    Code:
    add_events
         event historic    event_name factions { england, }
         date        0
         position    x, y
    end_add_events
    Does anyone know of any way to address this besides converting all instances of add_events back to regular historic_events? I like the location finder feature (position x, y) that comes with add_events, but I need to send these messages only to specific factions.

  5. #5

    Default Re: Specify Image Path for historic_event

    Quote Originally Posted by Callistonian View Post
    It seems that specifying factions for add_events doesn't work. I.e. the part in red below has no effect and this event will be sent out to all factions.

    Code:
    add_events
         event historic    event_name factions { england, }
         date        0
         position    x, y
    end_add_events
    Does anyone know of any way to address this besides converting all instances of add_events back to regular historic_events? I like the location finder feature (position x, y) that comes with add_events, but I need to send these messages only to specific factions.
    Why don't you use both?

    Like in this example:

    Spoiler Alert, click show to read: 
    Code:
                    add_events
                         event storm    
                         date 0
                         position 112, 132      ; near Atig 
                    end_add_events
                    set_event_counter fleet_disasterb 1       
                    historic_event HE_STORM_IN_ATIG  factions { f_carthage, }

  6. #6
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

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

    Default Re: Specify Image Path for historic_event

    In my experience the event (at least the volcano) only fires for factions that can see the tile in question, that could be used by spawning before and immediately killing a character of that faction after triggering the event. See more details here.










  7. #7
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Specify Image Path for historic_event

    Quote Originally Posted by Callistonian View Post
    I like the location finder feature (position x, y) that comes with add_events, but I need to send these messages only to specific factions.
    You could put the add_events inside an IF that tests the local faction, thus limiting it to specific player faction(s) that way. That's of no help in hotseat though - all player factions will see it.

  8. #8
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

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

    Default Re: Specify Image Path for historic_event

    Use 'not I_IsFactionAIControlled [faction name]' - that works in hotseat as well.










  9. #9
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Specify Image Path for historic_event

    Sure. For both "not I_IsFactionAIControlled england" and "I_LocalFaction england" an add_events historic message will be only shown at all if the player is england (that's good) but it will be shown to all player factions (that's bad). In a single player campaign that's not a problem, in hotseat it is. Whereas "factions { england, }" means "only show it to england".

    It's a shame that historic_event doesn't have a "position" parameter.

  10. #10
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

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

    Default Re: Specify Image Path for historic_event

    Damn you're right, the IF sequence only pertains to the firing of the add_event, not the restriction of the message display. A work around would be a faction limited 'true' historic_event, eg the 'yes' answer to the question: 'do you want to go to the event?' will move the screen to the location. Underneath an abbreviated example from RotK how we approached it:
    Code:
        monitor_event FactionTurnStart FactionType france
            if not I_IsFactionAIControlled france
                historic_event liu_missions true factions { france, }
            end_if
            if I_IsFactionAIControlled france
                terminate_monitor
            end_if
    
            while I_EventCounter liu_missions_accepted = 0
                and I_EventCounter liu_missions_declined = 0
            end_while
    
            if I_EventCounter liu_missions_accepted > 0
                reveal_tile 105, 104
                snap_strat_camera 97, 104
                zoom_strat_camera 0.4
                terminate_monitor
            end_if
            if I_EventCounter liu_missions_declined > 0
                terminate_monitor
            end_if
        end_monitor
    
    Note: there is a slave end turn hide_all_revealed_tiles command in the overall script, 
    for hotseats this might have to be changed into a generic faction turn end
    The first part is actually part of a 'calendar' script, eg tons of commands\event messages wrapped in 'if I_Turn_number' sequences, I have merged it with the second part (standard event_counter event) using the 'while' principle.
    In other 'accepted' monitors we select a just spawned and labeled target character to highlight him (the enclosing line animation marking is a bit bugged in my opinion) and\or used additional arrow markers.
    Last edited by Gigantus; November 10, 2020 at 04:33 AM.










  11. #11
    Callistonian's Avatar Ducenarius
    Join Date
    May 2018
    Location
    somewhere in the continental US
    Posts
    944

    Default Re: Specify Image Path for historic_event

    It looks like I'll have to use missions. It will mean more code and unavoidable bugs but the performance should be about the same.

    Thanks for the feedback guys.

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

    Default Re: Specify Image Path for historic_event

    Well, I thought it's known because this feature used in Call of Warhammer - faction specified historic_events are realized by
    historic_event event_name false factions { }

    Doesn't matter which faction is player.

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

  13. #13
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

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

    Default Re: Specify Image Path for historic_event

    Quote Originally Posted by OP
    It seems that specifying factions for add_events doesn't work. I like the location finder feature (position x, y) that comes with add_events, but I need to send these messages only to specific factions.
    You can't have both - either a faction restriction (historic_event) OR a location button (add_events). Hence why he contemplated missions.










Posting Permissions

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