Results 1 to 6 of 6

Thread: Lost in CreateUnit'ing

Hybrid View

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

    Icon1 Lost in CreateUnit'ing

    Not sure if anyone else has had any success in this area, but i'd love to know if anyone can un-boggle it for me.

    I've read over some tutorials, and looked in and out through Alpaca's scripting tuts, but theres something i havnt been able to get kicking so far for the life of me:
    A basic trigger to add units to a general when he recruits mercenaries

    I've been tooling in the campaign script with
    monitor_event UnitTrained UnitType Mercenary Spearmen
    and FactionType england
    console_command add_money england, 20000
    end_monitor

    Just to see if i can add money, as spawning alone is a trouble, i suspect i'm missing quotes? Or shouldn't have added UnitType?

    BUT if i wanted to add the units being created with CreateUnit (or maybe Spawn Army?), onto the general, where would i even begin? I couldnt set the General as a location, could i?

  2. #2
    No, that isn't a banana
    Join Date
    Aug 2004
    Location
    Ontario, Canada
    Posts
    5,216

    Default Re: Lost in CreateUnit'ing

    Since you haven't gotten an answer yet, I'll bump your post for you!

  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: Lost in CreateUnit'ing

    Well first off you dont train mercenaries, you recruit them, so that trigger will never fire when you recruit.

    What you need is:
    HireMercenaries
    A General has hired some mercenaries
    nc_character_record, character_record, faction, region_id, character_type
    ET_HIRE_MERCENARIES


    That will fire when you recruit a mercenary and then you will be able to add_money to england. Once you get that working you can try using e_select_character to reference the General and then assign him more units, but I have doubts about this because the e_selects are buggy.

  4. #4

    Default Re: Lost in CreateUnit'ing

    Just come to that conclusion today myself, GrnEyedDvl!

    Appreciate the feedback, i'll be sure to look into e_selects. I presume there's no console command that could be more direct and less prone to bugs


    Been trying to find a way to check if a general recruits a specific unit, my monitor looks roughly like so:

    monitor_event HireMercenaries and I_TurnNumber > 0
    and FactionType england
    and TrainedUnitCategory infantry
    console_command add_money england, 10000
    end_monitor
    the "Add_money" simply existing to see if the conditions are working properly. I've tried "UnitType" in place of TrainedUnitCategory, but it hasnt worked so far, meaning i've had to broaden from whenever he recruits mercenary spearmen to whenever he recruits any pure infantry marked unit

  5. #5
    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: Lost in CreateUnit'ing

    I think the I_TurnNUmber should be used with an If statement. Also if you want to use e_select then you have to reference the character in the monitor_event line, so try something like this:

    monitor_event CharacterTurnEnd and HireMercenary and FactionType england
    add_money

    If you get that working then you can add other conditions.

  6. #6

    Default Re: Lost in CreateUnit'ing

    AH interesting, giving that a shot now, appreciated

Posting Permissions

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