Page 4 of 5 FirstFirst 12345 LastLast
Results 61 to 80 of 92

Thread: Lesson 2

  1. #61
    ♔Jean-Luc Picard♔'s Avatar Domesticus
    Join Date
    Feb 2007
    Location
    North Carolina, USA
    Posts
    2,181

    Default Re: Lesson 2

    glad to be of assistance

    It is my great honour to have my poem Farmer in the Scriptorium here.

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

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

    Default Re: Lesson 2

    Nice Theodotos.

    Icedie of South also PMed me his work, and after helping him fix a few errors has completed the second lesson.

  3. #63

    Default Re: Lesson 2

    Done:
    Spoiler Alert, click show to read: 

    Spoiler Alert, click show to read: 



    Spoiler Alert, click show to read: 


    Spoiler Alert, click show to read: 




    Spoiler Alert, click show to read: 


    Spoiler Alert, click show to read: 


    Spoiler Alert, click show to read: 


    Last edited by Icedie El Guaraní; July 04, 2009 at 07:30 PM.
    Contribuitor IBIICB-WOTN-Modeler-Scripter


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

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

    Default Re: Lesson 2

    You are right there is one thing left on yours. Check your PM box, and I marked you as pending for now.

    Dewy, nice job. You have been added.

  5. #65

    Default Re: Lesson 2

    Okay a couple of questions,

    If i look in the text file in the mymod folder there are 2 versions of the historic events file a txt one and a .bin one. Which one do i edit, do i still need to convert the .bin file.

    In historic events there is a long list of events for the game. do i need to clear these or just add my scripts to the bottom of the list.

  6. #66

    Default Re: Lesson 2

    you edit the txt one and delete the string.bin one. the engine will regenerate the string.bin file
    Contribuitor IBIICB-WOTN-Modeler-Scripter


  7. #67
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Lesson 2

    Quote Originally Posted by Alex-ander View Post
    In historic events there is a long list of events for the game. do i need to clear these or just add my scripts to the bottom of the list.
    Just add yours anywhere in the file. Strings files only work as references, meaning junk code in strings files doesn't do any harm. You could enter a gazillion strings that never get referenced by anything and it wouldn't hurt the game. The only problem you encounter is if a string does get referenced and it isn't there. If you make a mod though I do recommend you remove unnecessary string entries from most strings files to lessen the risk of a duplicate.

  8. #68

    Default Re: Lesson 2

    i pmed my one to Ged my script just doesnt work ingame nothing appears... any ideas? The script is fine as i copied GED's exactly

  9. #69

    Default Re: Lesson 2

    Quote Originally Posted by Nakharar View Post
    i pmed my one to Ged my script just doesnt work ingame nothing appears... any ideas? The script is fine as i copied GED's exactly
    Send it to me and I'll see what I can do. No promises.
    Son of PW

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

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

    Default Re: Lesson 2

    Quote Originally Posted by Nakharar View Post
    i pmed my one to Ged my script just doesnt work ingame nothing appears... any ideas? The script is fine as i copied GED's exactly
    I thought I PMed you back on that.

    You need to add the event to historic_events. The events file you sent me only has the new event in it which means the rest of the events cant run. What shows up in your log file?

  11. #71
    Benz282's Avatar Vicarius
    Join Date
    May 2008
    Location
    East Coast, US
    Posts
    2,955

    Default Re: Lesson 2

    Script:
    Spoiler Alert, click show to read: 
    monitor_event FactionTurnEnd FactionIsLocal
    historic_event test_event1
    terminate_monitor
    end_monitor

    ;count turn numbers
    monitor_event FactionTurnEnd FactionIsLocal
    inc_counter TurnNumber 1
    set_event_counter RandomFired 0

    if I_CompareCounter TurnNumber == 2
    if RandomPercent > 50
    and I_EventCounter RandomFired == 0
    historic_event random_event
    set_event_counter RandomFired 1
    end_if

    historic_event ten_turns
    set_counter TurnNumber 0
    end_if
    end_monitor

    monitor_event FactionTurnEnd FactionIsLocal
    if event_counter RandomFired == 1
    and I_SettlementUnderSiege York
    and event_counter York_army_spawned == 0
    create_unit York, Peasants, num 2, exp 1, arm 0, wep 0
    historic_event York_reinforcements
    set_event_counter York_army_spawned 1
    end_if
    end_monitor

    monitor_event FactionTurnEnd FactionIsLocal
    if not I_SettlementUnderSiege York
    and event_counter York_army_spawned == 1
    set_event_counter York_army_spawned 0
    historic_event York_reinforcements_away
    end_if
    end_monitor

    Screens:
    Spoiler Alert, click show to read: 

    Before:





    After:

    Reset:


    That should be it, I suppose. I followed the lesson up till I started testing the unit spawning portion. I didn't want to have to wait 10 or 20 turns to test it, so I lowered the turn required to 2.
    Last edited by Benz282; July 08, 2009 at 10:07 PM.

  12. #72

    Default Re: Lesson 2

    Spoiler Alert, click show to read: 




    Spoiler Alert, click show to read: 




    Spoiler Alert, click show to read: 




    Spoiler Alert, click show to read: 




    Spoiler Alert, click show to read: 








    Spoiler Alert, click show to read: 

    ;
    ; Campaign script
    ;
    script
    monitor_event FactionTurnEnd FactionIsLocal
    historic_event test_event1
    terminate_monitor
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal

    if I_SettlementUnderSiege Hamburg
    and I_EventCounter Hamburg_army_spawned == 0
    historic_event Hamburg_besieged
    if RandomPercent > 50
    create_unit Hamburg, Archer Militia, num 4, exp 0, arm 0, wep 0
    set_event_counter Hamburg_army_spawned 1
    historic_event Hamburg_reinforced
    end_if
    end_if
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    if not I_SettlementUnderSiege Hamburg
    and I_EventCounter Hamburg_army_spawned == 1
    set_event_counter Hamburg_army_spawned 0
    historic_event Hamburg_relieved
    end_if
    end_monitor
    ;keep script unfinished until last monitor termination
    wait_monitors
    end_script
    Last edited by Odoaker; July 13, 2009 at 09:39 AM.
    Developer of Rising Sumer
    Beta-tester for ChC; Mapper of Colonialism-TW;

  13. #73
    aduellist's Avatar Push the button Max!
    Join Date
    Mar 2005
    Location
    Shenandoah Valley
    Posts
    1,822

    Default Re: Lesson 2

    Sorry I'm so far behind. Today's the first chance I've had to do this.

    Garrison script code:

    Spoiler Alert, click show to read: 
    Code:
    ; Test York garrison script
    
    monitor_event FactionTurnEnd FactionIsLocal
    
       if I_SettlementUnderSiege York
       and I_EventCounter York_army_spawned == 0
          historic_event York_besieged
    
          if RandomPercent > 50
             create_unit York, Town Militia, num 3, exp 1, arm 0, wep 0
             create_unit York, Archer Militia, num 2, exp 1, arm 0, wep 0
             set_event_counter York_army_spawned 1
             historic_event York_reinforced
          end_if
    
       end_if
    
    end_monitor
    
    monitor_event FactionTurnEnd FactionIsLocal
    
       if not I_SettlementUnderSiege York
       and I_EventCounter York_army_spawned == 1
          set_event_counter York_army_spawned 0
          historic_event York_relieved
       end_if
    
    end_monitor


    Screenies below.

    Spoiler Alert, click show to read: 


    Before siege



    Reinforcements arrive



    York reinforced



    Siege lifted


    Last edited by aduellist; July 11, 2009 at 10:12 PM.
    Under the patronage of TheFirstONeill
    Proud team member of
    THERA, A New Beginning


    "The trouble with fighting for human freedom is that one spends most of one's time defending scoundrels. For it is against scoundrels that oppressive laws are first aimed, and oppression must be stopped at the beginning if it is to be stopped at all." H. L. Mencken

    "Liberty is meaningless where the right to utter one’s thoughts and opinions has ceased to exist. That, of all rights, is the dread of tyrants. It is the right which they first of all strike down." Frederick Douglass

  14. #74
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Lesson 2

    Quote Originally Posted by Benz282 View Post
    Script:
    Spoiler Alert, click show to read: 
    monitor_event FactionTurnEnd FactionIsLocal
    historic_event test_event1
    terminate_monitor
    end_monitor

    ;count turn numbers
    monitor_event FactionTurnEnd FactionIsLocal
    inc_counter TurnNumber 1
    set_event_counter RandomFired 0

    if I_CompareCounter TurnNumber == 2
    if RandomPercent > 50
    and I_EventCounter RandomFired == 0
    historic_event random_event
    set_event_counter RandomFired 1
    end_if

    historic_event ten_turns
    set_counter TurnNumber 0
    end_if
    end_monitor

    monitor_event FactionTurnEnd FactionIsLocal
    if event_counter RandomFired == 1
    and I_SettlementUnderSiege York
    and event_counter York_army_spawned == 0
    create_unit York, Peasants, num 2, exp 1, arm 0, wep 0
    historic_event York_reinforcements
    set_event_counter York_army_spawned 1
    end_if
    end_monitor

    monitor_event FactionTurnEnd FactionIsLocal
    if not I_SettlementUnderSiege York
    and event_counter York_army_spawned == 1
    set_event_counter York_army_spawned 0
    historic_event York_reinforcements_away
    end_if
    end_monitor

    Screens:
    Spoiler Alert, click show to read: 

    Before:





    After:

    Reset:


    That should be it, I suppose. I followed the lesson up till I started testing the unit spawning portion. I didn't want to have to wait 10 or 20 turns to test it, so I lowered the turn required to 2.
    Does this script function entirely? You seem to have started using "event_counter" instead of I_EventCounter for your conditions in the latter half of the script, which to my knowledge should not work.

    @ Odoaker: I assume you're still working on it?

    Quote Originally Posted by aduellist View Post
    Sorry I'm so far behind. Today's the first chance I've had to do this.

    Garrison script code:

    Spoiler Alert, click show to read: 
    Code:
    ; Test York garrison script
    
    monitor_event FactionTurnEnd FactionIsLocal
    
       if I_SettlementUnderSiege York
       and I_EventCounter York_army_spawned == 0
          historic_event York_besieged
    
          if RandomPercent > 50
             create_unit York, Town Militia, num 3, exp 1, arm 0, wep 0
             create_unit York, Archer Militia, num 2, exp 1, arm 0, wep 0
             set_event_counter York_army_spawned 1
             historic_event York_reinforced
          end_if
    
       end_if
    
    end_monitor
    
    monitor_event FactionTurnEnd FactionIsLocal
    
       if not I_SettlementUnderSiege York
       and I_EventCounter York_army_spawned == 1
          set_event_counter York_army_spawned 0
          historic_event York_relieved
       end_if
    
    end_monitor


    Screenies below.

    Spoiler Alert, click show to read: 


    Before siege



    Reinforcements arrive



    York reinforced



    Siege lifted


    Looks good.

  15. #75

    Default Re: Lesson 2

    Finished lesson 2 here are the pictures,

    Spoiler Alert, click show to read: 





    Spoiler Alert, click show to read: 




    Spoiler Alert, click show to read: 




    Finally my code. I am sure it could be optimised but it works so..

    Spoiler Alert, click show to read: 

    ;
    ; Reinforcements script
    ; Needs 2 monitors one for when York is under siege. One for when York is not under siege.
    script

    declare_counter Reinforce
    set_event_counter Reinforce 0

    monitor_event FactionTurnEnd FactionIsLocal
    if I_SettlementUnderSiege York
    if RandomPercent > 10
    and I_EventCounter Reinforce == 0
    historic_event uprising
    create_unit York, Archer Militia, num 2, exp 1, arm 0, wep 0
    set_event_counter Reinforce 1
    end_if
    end_if
    end_monitor

    monitor_event FactionTurnEnd FactionIsLocal
    and not I_SettlementUnderSiege York
    and I_EventCounter Reinforce
    historic_event saved
    set_event_counter Reinforce 0
    end_monitor

    ; keep script unfinished until last monitor termination
    wait_monitors

    end_script

  16. #76
    Hesus de bodemloze's Avatar The Gaul
    Civitate Patrician Content Emeritus

    Join Date
    Aug 2006
    Location
    Belgium
    Posts
    12,313

    Default Re: Lesson 2

    I finally got mine done,

    Code:
    create_unit Rennes, Archer Militia, num 2, exp 1, arm 0, wep 0
    create_unit Rennes, Spear Militia, num 2, exp 1, arm 0, wep 0
    Spoiler Alert, click show to read: 


    Spoiler Alert, click show to read: 


    Spoiler Alert, click show to read: 
    Horum omnium fortissimi sunt Belgae :
    Hesus 's Photo Gallery
    The Writers Study|Ex-Global Moderator|Moderation Mentor| Ex - Librarian of the Scriptorium|PoTW|MAARC|ToTW
    SPQR Forum Moderator

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

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

    Default Re: Lesson 2

    Alex-ander:
    Looks good, except for two minor things. First, you declared a counter named Reinforce, and then you are setting an event_counter named Reinforce. They are two different objects as far as the game engine is concerned. What you did is reserve a spot in memory for a counter that is not used.

    Second, in your second monitor it says:
    monitor_event FactionTurnEnd FactionIsLocal
    and not I_SettlementUnderSiege York
    and I_EventCounter Reinforce
    Since you did not set a number for that event_counter it will always fire true. It needs to say and I_EventCounter Reinforce == 1. I will add you to the list for finishing this lesson, just keep in mind that you have to be specific when you are checking counters and event_counters or your script will drive you nuts. In this case it probably wont hurt the script to have that one always fire true, but in other scripts it will.


    Hesus can you post your script please?

  18. #78
    Subuatai de Bodemloze's Avatar No rest for the wicked
    Join Date
    Mar 2008
    Location
    50 degrees, 26.2 minutes North, 119 degrees, 12.4 minutes West
    Posts
    2,436

    Default Re: Lesson 2

    I think you should have broke this lesson into part A and B.. lol I am trying to work on it in the time I have avail.

  19. #79
    B. Ward's Avatar ★★★★ RockNRolla ★★★★
    Join Date
    Feb 2007
    Location
    East Coast, United States
    Posts
    4,376

    Default Re: Lesson 2

    I will have this up by Sunday evening along with Lesson 3.

  20. #80
    Romanos IV's Avatar The 120th Article, § 4
    Join Date
    Jun 2008
    Location
    the hell outta here (Athens, European Client State of Greece)
    Posts
    3,882

    Default Re: Lesson 2

    Yayyyy, after so many hours I got it to work!


    Spoiler Alert, click show to read: 
    create_unit York, Peasants, num 8, exp 3, arm 1, wep 0

    Spoiler Alert, click show to read: 











    Under the noble patronage of Jimkatalanos

Page 4 of 5 FirstFirst 12345 LastLast

Posting Permissions

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