Page 2 of 2 FirstFirst 12
Results 21 to 32 of 32

Thread: Lesson 5, Finally

  1. #21

    Default Re: Lesson 5, Finally

    Yes pretty much; see it your self:
    {STOCK_PRODUCTION_TITLE}Stock Production
    {SELL_RESOURCE_20_BODY} You sold some of your stock for 2000 florines.
    {SELL_RESOURCE_20_TITTLE}Trade Resource 20%
    {SELL_RESOURCE_40_BODY}You sold some of your stock for 4000 florines.
    {SELL_RESOURCE_40_TITTLE}Trade Resource 40%
    {SELL_RESOURCE_60_BODY}You sold some of your stock for 6000 florines.
    {SELL_RESOURCE_60_TITTLE}Trade Resource 60%
    {SELL_RESOURCE_80_BODY}You sold some of your stock for 8000 florines.
    {SELL_RESOURCE_80_TITTLE}Trade Resource 80%
    {SELL_RESOURCE_100_BODY}You sold some of your stock for 10000 florines.
    {SELL_RESOURCE_100_TITTLE}Trade Resource 100%
    {SOLD_STOCK_20_BODY}You Have made a deal with one of your neighbouring tribes worth 2000 florines, leaving you with 80% available for this turn.
    {SOLD_STOCK_20_TITLE}Deal Made 20%
    {SOLD_STOCK_40_BODY}You Have made a deal with one of your neighbouring tribes worth 4000 florines, leaving you with 60% available for this turn.
    {SOLD_STOCK_40_TITLE}Deal Made 40%
    {SOLD_STOCK_60_BODY}You Have made a deal with one of your neighbouring tribes worth 6000 florines, leaving you with 40% available for this turn.
    {SOLD_STOCK_60_TITLE}Deal Made 60%
    {SOLD_STOCK_80_BODY}You Have made a deal with one of your neighbouring tribes worth 8000 florines, leaving you with 20% available for this turn.
    {SOLD_STOCK_80_TITLE}Deal Made 80%
    {SOLD_STOCK_100_BODY}You Have made a deal with one of your neighbouring tribes worth 10000 florines, leaving you with -100% available for this turn.
    {SOLD_STOCK_100_TITLE}Deal Made 100%
    {UNSOLD_STOCK_20_BODY}You just lost a trading client worth 20% of your stock.
    {UNSOLD_STOCK_20_TITLE}lost trading client 20%
    {UNSOLD_STOCK_40_BODY}You just lost a trading client worth 40% of your stock.
    {UNSOLD_STOCK_40_TITLE}lost trading client 40%
    {UNSOLD_STOCK_60_BODY}You just lost a trading client worth 60% of your stock.
    {UNSOLD_STOCK_60_TITLE}lost trading client 60%
    {UNSOLD_STOCK_80_BODY}You just lost a trading client worth 80% of your stock.
    {UNSOLD_STOCK_80_TITLE}lost trading client 80%
    {UNSOLD_STOCK_100_BODY}You just lost a trading client worth 100% of your stock.
    {UNSOLD_STOCK_100_TITLE}lost trading client 100%

    if it crashes at the end turn , than i think something's wrong with your first bit
    Yes i believe so, what i am thinking of is , what Archaon had told me about counters, could it be that the number < 19 is an invalid binary?, or something like that.

    EDITED:

    Not working either,
    this is the error:
    Code:
    16:34:41.421 [game.script.exec] [trace] exec <generate_random_counter> at line 1566 in mods/Vacuus_Kingdoms/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:34:41.421 [game.script.exec] [trace] exec <if> at line 1568 in mods/Vacuus_Kingdoms/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:34:41.421 [game.script.exec] [trace] exec <if> at line 1572 in mods/Vacuus_Kingdoms/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:34:41.421 [game.script.exec] [trace] exec <if> at line 1576 in mods/Vacuus_Kingdoms/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:34:41.421 [game.script.exec] [trace] exec <historic_event> at line 1576 in mods/Vacuus_Kingdoms/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:34:41.421 [system.rpt] [error] Uh oh. This isn't good. No idea why, but exiting now. Sorry pal.
    this lines are not causing the problem. i have no idea what is causing it.
    I am using the Bare_bone kingdoms installer as base mod and add a few files to it.
    Can some body add my code to his campaign_script and historic_event file and test it for me? please.
    Last edited by Icedie El Guaraní; September 11, 2009 at 11:50 AM.
    Contribuitor IBIICB-WOTN-Modeler-Scripter


  2. #22

    Default Re: Lesson 5, Finally

    Hi Icedie, when checking what the counter is up to should never cause an issue.

    When i explained counter cannot be checked at a negative because the limit of how high a low a counter can be is based on binary.

    It might sound silly but i have seen this before, personally the caps in the historical_events file needs to be copy/paste into the code, to ensure no typo and to ensure it is the same case (NO JOKE!).

  3. #23

    Default Re: Lesson 5, Finally

    Thanks for the help, i found the problem, however the accept/decline event never happen, only the first part of the script; historic_event sell_stock_X true, but not the EventCounter. what is that mean?
    Contribuitor IBIICB-WOTN-Modeler-Scripter


  4. #24

    Default Re: Lesson 5, Finally

    Rescripting the trait with EventCounter did not work, because EventCounter exports nothing except. . .eventcounter. Any suggestions on how to get the trait working?
    Son of PW

  5. #25

    Default Re: Lesson 5, Finally

    I have done it, and what huge mistake i made not having the descr_event_images in my mod folder

    Here is the image:
    Spoiler Alert, click show to read: 

    I think i have finish this lesson as well.
    Code:
    If Diego_has_Finish_Class GiveHimLotsOfReps
    and ForBeingTheFirst 4 class_in_Univ == 0
         historic_event First_with_more_diplomats
         inc_counter Ice_gets_lots_reps 100
    set_event_counter GED_and_AL_Rep_me 1
    end_if
    end_monitor
    Thanks to GED/AL for taking this class as professors and share with us noobs members their awesome knowledge in scripting.

    I also want to thanks all those members who were actively helping me through out the class + those whom were not part of the Scripting class and still felt the need to help via incursion(archaon ) or via pm.

    And not the least again to GED for not abandoning the class after serious health problems, seriously i feel grateful and i wish you to get well fast!!

    Thanks also to the Assistant of the Class Augustus Lucifer that help me with a ridiculously long script i sent him.

    Plus rep to all of you.

    end......
    Enough sucking up!!
    cheers
    thanks
    Contribuitor IBIICB-WOTN-Modeler-Scripter


  6. #26

    Default Re: Lesson 5, Finally

    No offence , but i already was kinda ready . All that needed to be done was add more options and details to it

    Secondly , your script's incorrect :

    Code:
    If Diego_has_Finish_Class GiveHimLotsOfReps
    and ForBeingTheFirst 4 class_in_Univ == 0
         historic_event First_with_more_diplomats
         inc_counter Ice_gets_lots_reps 100
    set_event_counter GED_and_AL_Rep_me 1
    end_if
    end_monitor
    Lacks a 'monitor_event' ! Major mistake !
    The 'If Diego_...' needs to be followed by a second condition , rather that a command !
    you didn't celare your counter
    Lack of 'script' , 'wait_monitors' and 'end_script' line !

    I advise you to restart the whole course

  7. #27

    Default Re: Lesson 5, Finally

    and i meant four courses not to be the first in this lesson.
    Contribuitor IBIICB-WOTN-Modeler-Scripter


  8. #28

    Default Re: Lesson 5, Finally

    Here's my final use of the RandomCounter (i'll be using it for a small mod of mine) :

    Spoiler Alert, click show to read: 
    Code:
    script
    
    declare_counter reset_choice
    
    ;; Turn 1
    
    monitor_event FactionTurnStart FactionIsLocal
      and I_LocalFaction england
      and not I_IsFactionAiControlled
      and I_TurnNumber = 0
    
    historic_event choicemass true
    
    end_monitor
    
    monitor_conditions I_EventCounter choicemass_accepted = 1
     and I_TurnNumber = 0
    
    set_event_counter masstroups 1
    
    terminate_monitor
    end_monitor
    
    monitor_conditions I_EventCounter choicemass_declined = 1
     and I_TurnNumber = 0
    
    historic_event choiceelite true
    
    terminate_monitor
    end_monitor
    
    monitor_conditions I_EventCounter choiceelite_accepted = 1
     and I_TurnNumber = 0
    
    set_event_counter elitetroups 1
    
    terminate_monitor
    end_monitor
    
    monitor_conditions I_EventCounter choiceelite_declined = 1
     and I_TurnNumber = 0
    
    historic_event choicemedium true
    
    terminate_monitor
    end_monitor
    
    monitor_conditions I_EventCounter choicemedium_accepted = 1
     and I_TurnNumber = 0
    
    set_event_counter mediumtroups 1
    
    terminate_monitor
    end_monitor
    
    monitor_conditions I_EventCounter choicemedium_declined = 1
     and I_TurnNumber = 0
    
    set_counter resetchoice 1
    
    terminate_monitor
    end_monitor
    
    monitor_event FactionTurnEnd FactionIsLocal
     and I_CompareCounter resetchoice = 1
    
    historic_event hurry
    
    terminate_monitor
    end_monitor
    
    ;; Turn 2
    
    monitor_event FactionTurnStart FactionIsLocal
      and I_CompareCounter resetchoice = 1
    
    historic_event choicemass true
    
    terminate_monitor
    end_monitor
    
    monitor_conditions I_EventCounter choicemass_accepted = 1
     and I_TurnNumber = 1
    
    set_event_counter masstroups 1
    set_counter resetchoice 0
    
    terminate_monitor
    end_monitor
    
    monitor_conditions I_EventCounter choicemass_declined = 1
     and I_TurnNumber = 1
    
    historic_event choiceelite true
    
    terminate_monitor
    end_monitor
    
    monitor_conditions I_EventCounter choiceelite_accepted = 1
     and I_TurnNumber = 1
    
    set_event_counter elitetroups 1
    set_counter resetchoice 0
    
    terminate_monitor
    end_monitor
    
    monitor_conditions I_EventCounter choiceelite_declined = 1
     and I_TurnNumber = 1
    
    historic_event choicemedium true
    
    terminate_monitor
    end_monitor
    
    monitor_conditions I_EventCounter choicemedium_accepted = 1
     and I_TurnNumber = 1
    
    set_event_counter mediumtroups 1
    set_counter resetchoice 0
    
    terminate_monitor
    end_monitor
    
    monitor_conditions I_EventCounter choicemedium_declined = 1
     and I_TurnNumber = 1
    
    set_counter resetchoice 2
    
    terminate_monitor
    end_monitor
    
    monitor_event FactionTurnStart FactionIsLocal
     and I_CompareCounter resetchoice = 2
    
     generate_random_counter RandomNumber 1 100
     
     if I_EventCounter RandomNumber > 0
      and I_EventCounter RandomNumber < 34
    
      historic_event choicemass
      set_counter resetchoice 0
    
     end_if
     
     if I_EventCounter RandomNumber > 33
      and I_EventCounter RandomNumber < 67
    
      historic_event choiceelite
      set_counter resetchoice 0
    
     end_if
    
     if I_EventCounter RandomNumber > 66
      and I_EventCounter RandomNumber < 100
    
      historic_event choicemedium
      set_counter resetchoice 0
    
     end_if
    
    terminate_monitor
    end_monitor
    
    wait_monitors
    end_script


    (to see the use of the randomcounter , scroll a bit down . I balded the lines .

    Concept : The eventcounter choicemass will allow you to get mass , cheap and sucky troops .
    The eventcounter choiceelite will allow you to get elite , small amount and expensive units .
    The eventcounter choicemedium will allow you to have between .

    When you haven't decided in 2 turns , the script will automatically and randomly choose something and then fire off a event to tell you what kind of troops you have

  9. #29

    Default Re: Lesson 5, Finally

    @Augustus Lucifer / GED
    Not to bother you guys but are we going to get the reputation reward? i know some people hate members that are rep thirsty so i desided to wait but it has been a while, so can you guys do something about it?

    Please don´t be mad at me!!! it wasn't me it was him
    Contribuitor IBIICB-WOTN-Modeler-Scripter


  10. #30
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

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

    Default Re: Lesson 5, Finally

    Quote Originally Posted by Icedie El Guaraní View Post
    @Augustus Lucifer / GED
    Not to bother you guys but are we going to get the reputation reward? i know some people hate members that are rep thirsty so i desided to wait but it has been a while, so can you guys do something about it?

    Please don´t be mad at me!!! it wasn't me it was him
    Since I'm not an admin it's better if I don't hand out arbitrary rep values. You could try poking GED about it, but then he's a lazy bum and hasn't even given himself a screwdriver upgrade yet.

  11. #31

    Default Re: Lesson 5, Finally

    Note : I'm not involved with Icedie's comment in any way.


  12. #32
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

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

    Default Re: Lesson 5, Finally

    I've moved this class to the archives since it's been stagnant for a while. All of the current submissions seem to be well in order, but if people need feedback on their scripts I advise they use the workshop, which I check fairly regularly as do others.

    For rep inquiries, poke GED.

Page 2 of 2 FirstFirst 12

Posting Permissions

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