Results 1 to 30 of 116

Thread: An Intermediate Guide to Scripting

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    J-23 Member Hans Kloss's Avatar
    Join Date
    Oct 2003
    Location
    Richmond upon Thames
    Posts
    245

    Default Re: An Intermediate Guide to Scripting

    Quick question Richard

    With use of script would that be possible to spawn mercenary unit for hire only for non-Roman factions (playable and non playable one) for example "Roman deserters".Obviously such a unit would not be available for Romans.Is that at all possible ?

  2. #2

    Default Re: An Intermediate Guide to Scripting

    Yes, perfectly possible - but obviously not through the existing mercenary mechanism. Look at the Client Kingdoms mod for one way of doing it for the player. For non-player factions you would have to do it in a background script using a monitor_event with whatever conditionals you want and a create_unit console command inside.
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  3. #3

    Default Re: An Intermediate Guide to Scripting

    a wonderful Thread...

    I'm posting for very first time in this forum but i'm not reading in this section for first time...my english is not very good..please forgive me some grammar faults!

    A quick question:
    has anybody checked the disable_ai console command if it works?
    I would like to make a script that disable all the ai_actions and combine this with the faction switcher script! I have some problems with this matter because in the faction switcher script the ai make some stuff at the end of every turn...
    i would like to execute this...

    could it be that the command terminate_script?

    here is the script:
    HTML Code:
    script
    
    declare_counter player_faction
    
    	if I_LocalFaction romans_julii
    		set_counter player_faction 1
    	end_if
    	if I_LocalFaction macedon
    		set_counter player_faction 2
    	end_if
    	if I_LocalFaction egypt
    		set_counter player_faction 3
    	end_if
    	if I_LocalFaction seleucid
    		set_counter player_faction 4
    	end_if
    	if I_LocalFaction carthage
    		set_counter player_faction 5
    	end_if
    	if I_LocalFaction parthia
    		set_counter player_faction 6
    	end_if
    	if I_LocalFaction pontus
    		set_counter player_faction 7
    	end_if
    	if I_LocalFaction gauls
    		set_counter player_faction 8
    	end_if
    	if I_LocalFaction germans
    		set_counter player_faction 9
    	end_if
    	if I_LocalFaction britons
    		set_counter player_faction 10
    	end_if
    	if I_LocalFaction armenia
    		set_counter player_faction 11
    	end_if
    	if I_LocalFaction dacia
    		set_counter player_faction 12
    	end_if
    	if I_LocalFaction greek_cities
    		set_counter player_faction 13
    	end_if
    	if I_LocalFaction numidia
    		set_counter player_faction 14
    	end_if
    	if I_LocalFaction scythia
    		set_counter player_faction 15
    	end_if
    	if I_LocalFaction spain
    		set_counter player_faction 16
    	end_if
    	if I_LocalFaction thrace
    		set_counter player_faction 17
    	end_if
    
    ;---------------------------------------------
    
    	if I_CompareCounter player_faction = 1
    		console_command disable_ai thrace
    	end_if
    	if I_CompareCounter player_faction = 2
    		console_command disable_ai romans_julii
    	end_if
    	if I_CompareCounter player_faction = 3
    		console_command disable_ai egypt
    	end_if
    	if I_CompareCounter player_faction = 4
    		console_command disable_ai seleucid
    	end_if
    	if I_CompareCounter player_faction = 5
    		console_command disable_ai carthage
    	end_if
    	if I_CompareCounter player_faction = 6
    		console_command disable_ai parthia
    	end_if
    	if I_CompareCounter player_faction = 7
    		console_command disable_ai pontus
    	end_if
    	if I_CompareCounter player_faction = 8
    		console_command disable_ai gauls
    	end_if
    	if I_CompareCounter player_faction = 9
    		console_command disable_ai germans
    	end_if
    	if I_CompareCounter player_faction = 10
    		console_command disable_ai britons
    	end_if
    	if I_CompareCounter player_faction = 11
    		console_command disable_ai armenia
    	end_if
    	if I_CompareCounter player_faction = 12
    		console_command disable_ai dacia
    	end_if
    	if I_CompareCounter player_faction = 13
    		console_command disable_ai greek_cities
    	end_if
    	if I_CompareCounter player_faction = 14
    		console_command disable_ai numidia
    	end_if
    	if I_CompareCounter player_faction = 15
    		console_command disable_ai scythia
    	end_if
    	if I_CompareCounter player_faction = 16
    		console_command disable_ai spain
    	end_if
    	if I_CompareCounter player_faction = 17
    		console_command disable_ai thrace
    	end_if
    
    ;----------------------------------------------
    	
    	console_command control slave
    if I_LocalFaction romans_julii
    	console_command control macedon
    	terminate_script
    end_if
    if I_LocalFaction macedon
    	console_command control egypt
    	terminate_script
    end_if
    if I_LocalFaction egypt
    	console_command control seleucid
    	terminate_script
    end_if
    if I_LocalFaction seleucid
    	console_command control carthage
    	terminate_script
    end_if
    if I_LocalFaction carthage
    	console_command control parthia
    	terminate_script
    end_if
    if I_LocalFaction parthia
    	console_command control pontus
    	terminate_script
    end_if
    if I_LocalFaction pontus
    	console_command control gauls
    	terminate_script
    end_if
    if I_LocalFaction gauls
    	console_command control germans
    	terminate_script
    end_if
    if I_LocalFaction germans
    	console_command control britons
    	terminate_script
    end_if
    if I_LocalFaction britons
    	console_command control armenia
    	terminate_script
    end_if
    if I_LocalFaction armenia
    	console_command control dacia
    	terminate_script
    end_if
    if I_LocalFaction dacia
    	console_command control greek_cities
    	terminate_script
    end_if
    if I_LocalFaction greek_cities
    	console_command control numidia
    	terminate_script
    end_if
    if I_LocalFaction numidia
    	console_command control scythia
    	terminate_script
    end_if
    if I_LocalFaction scythia
    	console_command control spain
    	terminate_script
    end_if
    if I_LocalFaction spain
    	console_command control thrace
    	terminate_script
    end_if
    if I_LocalFaction thrace
    	console_command control romans_julii
    	terminate_script
    end_if
    
    end_script

  4. #4
    J-23 Member Hans Kloss's Avatar
    Join Date
    Oct 2003
    Location
    Richmond upon Thames
    Posts
    245

    Default Re: An Intermediate Guide to Scripting

    Quote Originally Posted by Epistolary Richard
    Yes, perfectly possible - but obviously not through the existing mercenary mechanism. Look at the Client Kingdoms mod for one way of doing it for the player. For non-player factions you would have to do it in a background script using a monitor_event with whatever conditionals you want and a create_unit console command inside.
    Thx for your reply Richard

    Would something like this make any sens ?

    HTML Code:
    script
    if I_SettlementOwner Tarsus =(probably list of all non roman factions or is that another way ?)
    console_command create_unit Tarsus "merc roman deserters" 1
    end_if
    end_script
    Last edited by Hans Kloss; 11-28-2005 at 22:47.

  5. #5

    Default Re: An Intermediate Guide to Scripting

    pilatus I remember Myrddraal saying something about the disable_ai command when putting together the Hot Seat Mod. He certainly used halt_ai for that.

    Maly Jacek If that's an event script then you're better off putting the conditionals in the trigger. If that's a background script you need a loop to keep it running and a monitor event in there to tell the game when to check the conditionals.
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  6. #6

    Default Re: An Intermediate Guide to Scripting

    thx richard
    but i've already checked the halt_ai command in myrdaals script and there is the problem that you can't make all factions playable at yourself..only two of them...if you make more the script says good bye!

    I've also already checked the set_ai off command but i think this is only for the battle_ai...

    has nobody checked the disable_ai command ?

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