Results 1 to 30 of 102

Thread: A Beginner's Guide to Scripting & Scripting "How To"s

Hybrid View

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

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Thanks Makanyane,
    thats the second time you've bailled me out when I've made a stupid mistake

    Sorry, but Ive got another question. Ive tested out the script and works fine now, however when I save the game and reload the script wont work. I figured I'd have to reload the script using show-me how but even then it does nothing

  2. #2

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Yes, the only way to relaunch the script after reloading the game is to use the show-me button.
    Depending on how did you implement the script and the show-me advice to launch it, sometimes it is not possible to reactivate the script until you restart the game. At least it happens to me, I'm not sure if other scripts have the same problem...

  3. #3
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Quote Originally Posted by Bardo
    Yes, the only way to relaunch the script after reloading the game is to use the show-me button.
    Depending on how did you implement the script and the show-me advice to launch it, sometimes it is not possible to reactivate the script until you restart the game. At least it happens to me, I'm not sure if other scripts have the same problem...
    AFAIK you cannot launch another script (for example in another campaign) or even the same script starting the same campaign with another faction, if you don't restart the game.

  4. #4

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Europa Barbarorum used a workarround in his previous version, that I have been using for long time, but I do not really recomend it since it is possible to duplicate the actived scripts, and after many tested, I still do not know how it acts exactly.
    The method is simple, just introduce the whole script inside a while loop. Then it is always possible to relaunch the script without exiting the game. But I recomend always to restart the game before starting a new campaign, as Monkwarrior said.

  5. #5

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    After looking at some historical battle scripts, I thought I'd do a little experimenting with the play_sound_event command. I added a bunch of new events to descr_sounds_narration.txt, plus the mp3s for them. It seems to work in the most basic form, but I ran into some strange behavior when trying to add a counter condition to the monitor.

    This works fine:
    Code:
    monitor_event SettlementSelected SettlementName Rome
        play_sound_event RomeSelected
    end_monitor
    This also works:
    Code:
    declare_counter PlaySpeech
    set_counter PlaySpeech 1
    
    monitor_event SettlementSelected SettlementName Rome
             and I_CompareCounter PlaySpeech = 1
        play_sound_event RomeSelected
    end_monitor
    This produces a "Sound event TEUTOBURG_SPEECH_00 not found." error when closing the game.
    Code:
    declare_counter PlaySpeech
    ;don't initialize or initilize to something other than 1
    ;set_counter PlaySpeech 1
    
    monitor_event SettlementSelected SettlementName Rome
             and I_CompareCounter PlaySpeech = 1
        play_sound_event RomeSelected
    end_monitor
    Ideally, rather than having them always on, I'd like to let the player toggle them on/off at any time, something along the lines of:

    Code:
    declare_counter PlaySpeech
    
    monitor_event ScrollAdviceRequested ScrollOpened helpScroll
        if I_CompareCounter PlaySpeech = 0
             set_counter PlaySpeech 1
        end_if
        if I_CompareCounter PlaySpeech = 1
             set_counter PlaySpeech 0
        end_if
    end_event
    
    monitor_event SettlementSelected SettlementName Rome
             and I_CompareCounter PlaySpeech = 1
        console_command
        play_sound_event RomeSelected
    end_monitor
    Any thoughts?
    RTR VII Developer

  6. #6

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Err... "Sound event RomeSelected not found."
    RTR VII Developer

  7. #7

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Did you try to initialize the counter in this lastest case?

    declare_counter PlaySpeech
    set_counter PlaySpeech 0

    monitor_event ScrollAdviceRequested ScrollOpened helpScroll
    if I_CompareCounter PlaySpeech = 0
    set_counter PlaySpeech 1
    end_if
    if I_CompareCounter PlaySpeech = 1
    set_counter PlaySpeech 0
    end_if
    end_event

    monitor_event SettlementSelected SettlementName Rome
    and I_CompareCounter PlaySpeech = 1
    play_sound_event RomeSelected
    end_monitor

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO