Command Line Commands (i need them)

Users who are viewing this thread

No, but I've implemented that anyways since people were complaining about having to start new savegames everytime I release a patch.
Code:
  [anyone|plyr,"tavernkeeper_talk", [(ge, "$cheat_mode", 1)], "CHEAT: So I herd u liek troobz.", "ramun_buy",[]],
  [anyone,"ramun_buy", [], "Of course. What kind would you like?", "ramun_faction",[]],
  [anyone|repeat_for_factions|plyr,"ramun_faction", 
	[  (store_repeat_object, ":faction_no"),
	   (this_or_next|is_between, ":faction_no", npc_kingdoms_begin, kingdoms_end),
	   (this_or_next|is_between, ":faction_no", "fac_commoners", "fac_neutral"),
	   (is_between, ":faction_no", "fac_manhunters", "fac_mountain_bandits"),
	   #(assign, reg1, ":faction_no"),
		(try_begin),
			(is_between, ":faction_no", npc_kingdoms_begin, kingdoms_end),
			(faction_get_slot, ":str", ":faction_no", slot_faction_adjective),
			(str_store_string, s1, ":str"),
		(else_try),
			(str_store_faction_name, s1, ":faction_no"),
		(try_end),
	], "Some {s1} please.", "ramun_select",
	[(store_repeat_object, reg1),(str_store_faction_name, s1, reg1),]
	],
  [anyone|plyr,"ramun_faction",[], "Nevermind.", "start", []],
  
  [anyone,"ramun_select", [], "So you want some troops from the {s1}?", "ramun_troops",[]],
  
  [anyone|repeat_for_troops|plyr,"ramun_troops", 
	[
		(store_repeat_object, ":troop"),
		(is_between, ":troop", regular_troops_begin, "trp_kidnapped_girl"),#eliminates a load
		(store_faction_of_troop, ":faction", ":troop"),#eliminates the rest
		(eq, ":faction", reg1),#by faction obviously
		(neg|troop_is_hero, ":troop"),#patrol leaders
		(str_store_troop_name, s2, ":troop"),
		(assign, reg2, ":troop"),
	],
	"{s2}", "ramun_select", [(store_repeat_object, ":troop"),(party_add_members, "p_main_party", ":troop", 5)]],
  [anyone|plyr,"ramun_troops",[], "Let's try some other kind of grunts.", "ramun_buy", []],
Basically, talk to any tavernkeeper (using a menu option is inefficient since you'd have to include each troop by hand) with cheat mode enabled, and it will search for valid factions, which are the various npc kingdoms, in addition to commoners (mercenaries), manhunters, and the titular deserter faction. Ensure that all your troop entries have the proper faction - this certain wasn't the case for Native. After you select a faction, it loops through all the non-hero soldier troops, and when you select the dialog option, you get 5 of them.
 
Right, change
Code:
         (store_sub, ":faction_adj", ":faction_no", kingdoms_begin),
         (val_add, ":faction_adj", "str_kingdoms_adjectives"),
to
Code:
         (store_sub, ":faction_adj", ":faction_no", npc_kingdoms_begin),
         (val_add, ":faction_adj", "str_kingdom_1_adjective"),

Since those are already in-game. Alternatively, use (faction_get_slot, ":faction_adj", ":faction_no", slot_faction_adjective), since I believe those are stored at game start. I've modified my original post to reflect this.
 
Please entertain my learnings here. 

Wouldn't

(val_add, ":faction_adj", "str_kingdom_1_adjectives"),

limit the conversation to listing swadian troops only?  Seems there need to be another try_begin and else_try
between what you already have, such as"

(store_sub, ":faction_adj", ":faction_no", kingdoms_begin),
  (try_begin)
      (val_add, ":faction_adj", "str_kingdom_1_adjectives"),
  (else_try)
      (val_add, ":faction_adj", "str_kingdom_2_adjectives"),
  (etc)
  (try_end)


I'm curious if that would work, based on :faction_no or what?  Meanwhile I'll try your alternative.
 
No, we're abusing the fact that those string references (str_kingdom_1_adjective") are nothing more than numbers, more often than not in order. ":faction_adj" itself is already an index (its value is from our faction subtracted by npc_kingdoms_begin), so swadia is offset 0, vaegirs are offset 1, etc. If the strings themselves are listed in order, then there should be no problem - an offset of 1 is applied, to get str_kingdom_2_adjective, and that is stored in s1.
 
Thank you for that bit of education.  Alternative option works great! 

Now to try and get some numbers sent to screen, some money exchanged and maybe the ability to use it without cheat on.  Like "find items cheat", I figure if you're paying for it, then it isn't cheating, it's just a time saver for the player.
 
I whipped up something like that already. Change the dialog above "Let's try some other kind of grunts".
Code:
   "{s2}", "patrol_prisoner_take", [(store_repeat_object, "$temp")]],
  [anyone|plyr,"ramun_troops",[], "Let's try some other kind of grunts.", "ramun_buy", []],

  [anyone,"patrol_prisoner_take", 
    [(call_script, "script_game_get_join_cost", "$temp"),#this gets stuck in reg0 automatically
    ],
   "And how many {s2} are you willing to take? Each one'll cost {reg0} denars to feed and maintain and whatnot.", "patrol_prisoner_take_list",
   []
   ],
   
  [anyone|plyr,"patrol_prisoner_take_list", 
    [], "knothxbye.", "close_window",  []],
   
  [anyone|plyr|repeat_for_100,"patrol_prisoner_take_list", 
    [
    (store_repeat_object, ":prisoner_num"),
    (store_add, reg4, ":prisoner_num", 1),#gets rid of two problems - 0 selection and last prisoner remaining
    (is_between, reg4, 1, 6),#arbitrary limit
    (troops_can_join, reg4),
    (store_mul, ":cost", reg0, reg4),
    (store_troop_gold, ":gold", "trp_player"),
    (ge, ":gold", ":cost"),
    (str_store_troop_name_by_count, s2, "$temp", reg4),
    (str_store_string, s2, "@{!}{reg4} {s2} pl0x."),
    ],
   "{s2}.", "patrol_prisoner_take",#if we're too lazy to refresh our register, we go way back
   [(store_repeat_object, ":num"),
    (val_add, ":num", 1),#see above for reason
    (store_mul, ":cost", reg0, ":num"),
    (troop_remove_gold, "trp_player", ":cost"),
    #(troop_add_gold, "$g_talk_troop", ":cost"),#pointless for patrols
    (party_add_members, "p_main_party", "$temp", ":num"),
   ]
   ],
I quickly modified that from a hire prisoner thingie from patrols. Not guaranteed to work. Alternatively, you can use change_screen_buy_mercenaries after populating a party and using set_mercenary_source_party on your party depending on your selection or whatever.
 
sweet so i got it working, with at alternative method, and it all works great except my new factions are refered to as "NO STRING" when talking to the tavern keeper, so where do i have to add my new factions?

fyi: i already added my factions in under the adjectives but it didnt do anything.
 
You have to set the slots themselves. Otherwise, if your new faction isn't an active kingdom between kingdoms_begin, kingdoms_end, this
Code:
      (try_begin),
         (is_between, ":faction_no", npc_kingdoms_begin, kingdoms_end),
         (faction_get_slot, ":str", ":faction_no", slot_faction_adjective),
         (str_store_string, s1, ":str"),
      (else_try),
         (str_store_faction_name, s1, ":faction_no"),
      (try_end),
Will try to find the name you've declared in module_factions.
 
Couldn't incorporate the prisoner thing, but I looked for examples.  Here is what I've got so far, not exactly sure where to break it up so the player can choose to pay the cost or not. 
But I guess if you are worried about the costs, you shouldn't be in there...
Also, this line: "So you want some troops from the {s1}?", returns - "{(the amount of) denars?}"  No idea how that happened.
Code:
  [anyone|plyr,"tavernkeeper_talk", [(ge, "$cheat_mode", 0)], "So I herd u liek troobz.", "ramun_buy",[]],
  [anyone,"ramun_buy", [], "Of course. What kind would you like?", "ramun_faction",[]],
  [anyone|repeat_for_factions|plyr,"ramun_faction", 
	[  (store_repeat_object, ":faction_no"),
	   (this_or_next|is_between, ":faction_no", npc_kingdoms_begin, kingdoms_end),
	   (this_or_next|is_between, ":faction_no", "fac_commoners", "fac_neutral"),
	   (is_between, ":faction_no", "fac_manhunters", "fac_mountain_bandits"),
	   #(assign, reg1, ":faction_no"),
	   
		(try_begin),
			(is_between, ":faction_no", npc_kingdoms_begin, kingdoms_end),
			(faction_get_slot, ":str", ":faction_no", slot_faction_adjective),
			(str_store_string, s1, ":str"),
		(else_try),
			(str_store_faction_name, s1, ":faction_no"),
		(try_end),
	], "Some {s1} please.", "ramun_select",
	[(store_repeat_object, reg1),(str_store_faction_name, s1, reg1),]
	],
  [anyone|plyr,"ramun_faction",[], "Nevermind.", "start", []],
  
  [anyone,"ramun_select", [], "So you want some troops from the {s1}?", "ramun_troops",[]],
  
#  [anyone|plyr,"ramun_pre_troops",[],"Yes","ramun_troops",[]],
#  [anyone|plyr,"ramun_pre_troops",[],"Forget it.","close_window",[]],
  
  [anyone|repeat_for_troops|plyr,"ramun_troops", 
	[
		(store_repeat_object, ":troop"),
		(is_between, ":troop", regular_troops_begin, "trp_kidnapped_girl"),#eliminates a load
		(store_faction_of_troop, ":faction", ":troop"),#eliminates the rest
		(eq, ":faction", reg1),#by faction obviously
		(neg|troop_is_hero, ":troop"),#patrol leaders
		(str_store_troop_name, s2, ":troop"),
		(assign, reg2, ":troop"),
	],
	"{s2}", "ramun_select", [(store_repeat_object, ":troop"),
							 (party_add_members, "p_main_party", ":troop", 50),
							 (store_add, reg4, ":troop"),
							 (call_script, "script_game_get_join_cost", reg0),
							 (store_mul, ":cost", reg0, reg4),
							 (store_troop_gold, ":gold", "trp_player"),
							 (ge, ":gold", ":cost"),
							 (troop_remove_gold, "trp_player", ":cost"),
							 ]],
  [anyone|plyr,"ramun_troops",[], "Let's try some other kind of grunts.", "ramun_buy", []],

I'd like to add a volume selection, say 10, 30, 50, 100 troops.  I guess that would be simple enough by just following the example.

Something like [anyone,"ramun_pre_buy",[],"How many of those?","ramun_pre_buy1",[]],
                        [anyone|plyr,"ramun_pre_buy1",[],"I'd like ten.","ramun_buy_10",[]],
                        [anyone|plyr,"ramun_pre_buy1",[],"I'll take thirty.","ramun_buy_30",[]],etc...
[anyone,"ramun_buy_10",[
                        (store_repeat_object, ":troop"),
                        (party_add_members, "p_main_party", ":troop", 10),
                        (store_add, reg4, ":troop"),
        (call_script, "script_game_get_join_cost", reg0),
        (store_mul, ":cost", reg0, reg4),
        (store_troop_gold, ":gold", "trp_player"),
        (ge, ":gold", ":cost"),
        (troop_remove_gold, "trp_player", ":cost"),]],

Or would there be a better, more organized way?
 
{s1} is used by the game in script_game_get_money_text for obvious reasons. Same with reg1. Which is why I ended all my dialogs with close_window - much cleaner. And the code was already modified for hiring - just never tested since I changed it on the fly.

You can't use store_repeat_object here - you must use it in conjunction with repeat_for_100/1000/factions/troops.
And the purpose of that in my code was to fetch however many you selected from repeat_for_100, not the actual troop. You're mixing up a lot of code. reg4 was used to display the amount for the selection, and both of those were used in the condition, not in the consequence. Same with cost-checking - script_game_get_join_cost takes the troop as a parameter, and outputs to reg0 (as do many other scripts). If the player can't afford it, he/she shouldn't be able to select this option at all, which is why this shouldn't be in the consequences.

If you want them by groups of 10, do the following: Keep in mind that as long as the conditions aren't satisfied, the dialog won't show up at all for the player. So cost and party size restraints would be placed here - as long as any of them fail, the dialog won't be an option for the player to select. And you'll want to avoid recalculations, such as cost, which won't change for the troop. We can also do the same for other things, such as player party room, and player's gold, but that you can figure out on your own.
Code:
[anyone|plyr|repeat_for_100,"ramun_pre_buy1",[(store_repeat_object, reg1),
(store_mod, ":mod", reg1, 10),#this gets the remainder
(eq, ":mod", 0), #if divisible by 10
#do other checks (room, cost)
],"I'd like {reg1}.","ramun_buy_10",
[(store_repeat_object, reg1)]],

[anyone,"ramun_buy_10",[
           (store_mul, ":cost", reg0, reg4),
           (troop_remove_gold, "trp_player", ":cost"),], "Sure thing.", "close_window, 
  [
           (party_add_members, "p_main_party", "$temp", reg1), #or some other variable/register to hold the troop
  ] 
],
 
Edit:*Snip=stupid stuffs

Thanks so much for yer time and example!

In the mean time, you just write it all up for me!
whip.gif
:mrgreen:

Edit:Think I'll try from scratch and see how that goes.
 
I've gotten sporadic results making changes to register usage, global variables but no luck making it work as intended.  :evil:

Haven't tested since adding str_clear,"$tcost", before trying that, the sums would just pile up as you pick more troops.

I can't grasp how to carry over the selected troop to the other tuples, as of now, all I get are caravan guards.

Also, the check for "room" is working, yet the gold check is not.

Lastly, since this if drawing from an unlimited pool, I see no need in checking for available troops.

Code:
 [anyone|plyr,"tavernkeeper_talk", [], "So I herd u liek troobz.", "ramun_buy",[]],
 
 [anyone,"ramun_buy", [], "Of course. What kind would you like?", "ramun_faction",[]],

 [anyone|repeat_for_factions|plyr,"ramun_faction", 
	[  (store_repeat_object, ":faction_no"),
#	   (this_or_next|is_between, ":faction_no", npc_kingdoms_begin, kingdoms_end),
	   (is_between, ":faction_no", "fac_commoners", "fac_neutral"),
#	   (is_between, ":faction_no", "fac_manhunters", "fac_mountain_bandits"),
	   #(assign, reg1, ":faction_no"),
		(try_begin),
			(is_between, ":faction_no", npc_kingdoms_begin, kingdoms_end),
			(faction_get_slot, ":str", ":faction_no", slot_faction_adjective),
			(str_store_string, s2, ":str"),
		(else_try),
			(str_store_faction_name, s2, ":faction_no"),
		(try_end),
	], "Some {s2} please.", "ramun_select",
	[(store_repeat_object, reg2),(str_store_faction_name, s2, reg2),]
	],

  [anyone|plyr,"ramun_faction",[], "Nevermind.", "start", []],
  
  [anyone,"ramun_select", [], "So you want some troops from the {s2}?", "ramun_troops",[]],
  
  [anyone|repeat_for_troops|plyr,"ramun_troops", 
	[
		(store_repeat_object, ":troop"),
		(is_between, ":troop", regular_troops_begin, "trp_kidnapped_girl"),#eliminates a load
		(store_faction_of_troop, ":faction", ":troop"),#eliminates the rest
		(eq, ":faction", reg2),#by faction obviously
		(neg|troop_is_hero, ":troop"),#patrol leaders
		(str_store_troop_name, s3, ":troop"),
#		(val_add, "$seltroop", ":troop"),
		(val_add,reg3,":troop"),
	],
	"{s3}", "ramun_count", []],
	
	[anyone,"ramun_count",[],"How many?","ramun_crespond",[]],
	
	[anyone|plyr,"ramun_crespond",
		[
#			(store_mod, ":mod", reg1, 10),#this gets the remainder
#			(eq, ":mod", 0),#if divisible by 10
			#do other checks (room, cost)
			(party_get_free_companions_capacity,":room","p_main_party"),#(assign,reg3,":room"),
			(store_troop_gold,":gold","trp_player"),#(assign,reg6,":gold"),
			(call_script,"script_game_get_join_cost","$temp"),(store_mul,":cost",reg0,10),#(store_mul,reg4,reg5,10),
			(val_add,"$tcost",":cost"),
			(ge,":gold",":cost"),
			(ge,":room",10),
		],"I'd like ten.","ramun_buy",[	(troop_remove_gold, "trp_player", "$tcost"),
										(party_add_members, "p_main_party",reg3,10),
										(str_clear,"$tcost"),]],
			
	[anyone|plyr,"ramun_crespond",
		[
#			(store_repeat_object,"$seltroop"),
#			(store_mod, ":mod", reg1, 10),#this gets the remainder
#			(eq, ":mod", 0),#if divisible by 10
			#do other checks (room, cost)
			(party_get_free_companions_capacity,":room","p_main_party"),#(assign,reg3,":room"),
			(store_troop_gold,":gold","trp_player"),#(assign,reg6,":gold"),
			(call_script,"script_game_get_join_cost","$temp"),(store_mul,":cost",reg0,20),#(store_mul,reg4,reg5,10),
			(val_add,"$tcost",":cost"),
			(ge,":gold",":cost"),
			(ge,":room",20),
			
		],"I'd like twenty.","ramun_buy",[	(troop_remove_gold, "trp_player", "$tcost"),
											(party_add_members, "p_main_party",reg3,20),
											(str_clear,"$tcost"),]],
	
	[anyone|plyr,"ramun_crespond",
		[
#			(store_repeat_object,"$seltroop"),
#			(store_mod, ":mod", reg1, 10),#this gets the remainder
#			(eq, ":mod", 0),#if divisible by 10
			#do other checks (room, cost)
			(party_get_free_companions_capacity,":room","p_main_party"),#(assign,reg3,":room"),
			(store_troop_gold,":gold","trp_player"),#(assign,reg6,":gold"),
			(call_script,"script_game_get_join_cost",reg3,reg0),(store_mul,":cost",reg0,50),#(store_mul,reg4,reg5,10),
			(val_add,"$tcost",":cost"),
			(ge,":gold",":cost"),
			(ge,":room",50),
			
		],"I'd like fifty.","ramun_buy",[(troop_remove_gold, "trp_player", "$tcost"),
										 (party_add_members, "p_main_party",reg3,50),
										 (str_clear,"$tcost"),]],
		
	[anyone|plyr,"ramun_crespond",
		[
#			(store_repeat_object,"$seltroop"),
#			(store_mod, ":mod", reg1, 10),#this gets the remainder
#			(eq, ":mod", 0),#if divisible by 10
			#do other checks (room, cost)
			(party_get_free_companions_capacity,":room","p_main_party"),#(assign,reg3,":room"),
			(store_troop_gold,":gold","trp_player"),#(assign,reg6,":gold"),
			(call_script,"script_game_get_join_cost","$temp"),(store_mul,":cost",reg0,100),#(store_mul,reg4,reg5,10),
			(val_add,"$tcost",":cost"),
			(ge,":gold",":cost"),
			(ge,":room",100),
			
		],"I'd like one hundred.","ramun_buy",[	(troop_remove_gold, "trp_player", "$tcost"),
												(party_add_members, "p_main_party",reg3,100),
												(str_clear,"$tcost"),]],
		
	[anyone|plyr,"ramun_crespond",
		[
#			(store_repeat_object,"$seltroop"),
#			(store_mod, ":mod", reg1, 10),#this gets the remainder
#			(eq, ":mod", 0),#if divisible by 10
			#do other checks (room, cost)
			(party_get_free_companions_capacity,":room","p_main_party"),#(assign,reg3,":room"),
			(store_troop_gold,":gold","trp_player"),#(assign,reg6,":gold"),
			(call_script,"script_game_get_join_cost","$temp"),(store_mul,":cost",reg0,300),#(store_mul,reg4,reg5,10),
			(val_add,"$tcost",":cost"),
			(ge,":gold",":cost"),
			(ge,":room",300),
			
		],"I have no time for this tomfoolery! I need an army! I'll take three hundred!","ramun_buy_300",
				[	(troop_remove_gold, "trp_player", "$tcost"),
					(party_add_members, "p_main_party",reg3,300),
					(str_clear,"$tcost"),]],
 	
	[anyone|plyr,"ramun_crespond",[],"I shall return when I'm better prepared.","tavernkeeper_pretalk",[]],
	
	[anyone,"ramun_buy",[], "Sure thing.", "ramun_anythingelse",[]],
	
	[anyone,"ramun_buy_300",[], "What a greedy {ucker/*****} ye be!  I do this only for thee.", "ramun_anythingelse",[]],	
	
	[anyone,"ramun_anythingelse",[],"Will there be anything else?","ramun_demands",[]],
	
	[anyone|plyr,"ramun_demands",[],"No, I'm done as thou hadst served well","tavernkeeper_pretalk",[]],
	[anyone|plyr,"ramun_demands",[],"Yes, more of the same.","ramun_count",[]],
	[anyone|plyr,"ramun_demands",[],"I would have another look as the list anew.","ramun_buy",[]],

#	[anyone|plyr,"ramun_troops",[], "Let's try some other kind of grunts.", "ramun_buy", []],
 
(store_repeat_object) can be used both in the condition to validate the options available to the player and in the consequence to store the object  that the player actually selects.

Code:
(store_repeat_object, reg2),(str_store_faction_name, s2, reg2),
Using registers aren't ideal - I wrote that code from scratch, so it's probably better to reuse "$g_faction_selected" or a similar global already being used for such purposes.

Code:
[anyone|plyr,"ramun_faction",[], "Nevermind.", "start", []],
going back to the "start" dialog state isn't ideal either - that means it will reparse through every single dialog, checking every condition on the way. However, you already know you are either talking to a tavernkeeper - so if you wanted to continue the conversation, refer to tavernkeeper_pretalk instead - which then allows the same options as you intended. If you want to exit the dialog, use close_window instead.

Code:
(val_add,reg3,":troop"),
reg3 can be of any value before you add onto it. Keep in mind that for every possible troop that satisfies the conditions, reg3 will increase. Instead, use (store_repeat_object) in the consequence, which will actually fetch what the player selects.

Code:
(party_get_free_companions_capacity,":room","p_main_party"),
(store_troop_gold,":gold","trp_player"),
(call_script,"script_game_get_join_cost","$temp"),
(store_mul,":cost",reg0,100),
(val_add,"$tcost",":cost"),
(ge,":gold",":cost"),
(ge,":room",100),
It's probably better to check one condition at a time - if the first fails, there's no point in checking any further. Check (ge, ":room", 100) right after you fetch it. The cost isn't working since you haven't assigned anything to "$temp" - thus join cost is 0 since in all likelihood $temp is 0 which is the player character. Your use of (str_clear) is wrong - it should only work on a string register - instead assign tcost to 0 between ramun_count and ramun_crespond. In addition, it's probably better to actually store the number desired, since you're executing similar operations every time such as (remove_gold), (party_add_members), so you'd have something like this:
Code:
    [anyone|plyr,"ramun_crespond",
      [
         (party_get_free_companions_capacity,":room","p_main_party"),
         (ge,":room",100),
         (store_troop_gold,":gold","trp_player"),
         (call_script,"script_game_get_join_cost","$temp"),
         (store_mul,":cost",reg0,100),
         #(val_add,"$tcost",":cost"),
         (ge,":gold",":cost"),         
      ],"I'd like one hundred.","ramun_buy",[(assign, "$tcost", 100),]],

    [anyone,"ramun_buy",[], "Sure thing.", "ramun_anythingelse",
      [ (party_add_members, "p_main_party","$temp","$tcost"),
        (call_script,"script_game_get_join_cost","$temp"),
        (val_mul, "$tcost", reg0),
        (troop_remove_gold, "trp_player", "$tcost"),
        (assign, "$tcost", 0),
      ]
     ],
 
Thanks a million somebody.  Here is (what I'm calling) the finished product.
It works as intended, at least.  :grin:

Code:
#giz me troobz	
 [anyone|plyr,"tavernkeeper_talk", 
	[	
	(party_get_free_companions_capacity,":room","p_main_party"),
        (ge,":room",10),
        (store_troop_gold,":gold","trp_player"),        
        (ge,":gold",1000),
	], "So I herd u liek troobz.", "ramun_buy",[]],
 
 [anyone,"ramun_buy", [], "Of course. What kind would you like?", "ramun_faction",[]],

 [anyone|repeat_for_factions|plyr,"ramun_faction", 
	[  (store_repeat_object, ":faction_no"),
	   (this_or_next|is_between, ":faction_no", npc_kingdoms_begin, kingdoms_end),
	   (this_or_next|is_between, ":faction_no", "fac_commoners", "fac_neutral"),
	   (is_between, ":faction_no", "fac_manhunters", "fac_mountain_bandits"),
	   #(assign, reg1, ":faction_no"),
		(try_begin),
			(is_between, ":faction_no", npc_kingdoms_begin, kingdoms_end),
			(faction_get_slot, ":str", ":faction_no", slot_faction_adjective),
			(str_store_string, s2, ":str"),
		(else_try),
			(str_store_faction_name, s2, ":faction_no"),
		(try_end),
	], "Some {s2} please.", "ramun_select",
	[(store_repeat_object, reg2),(str_store_faction_name, s2, reg2),]
	],

  [anyone|plyr,"ramun_faction",[], "Nevermind.", "tavernkeeper_pretalk", []],
  
  [anyone,"ramun_select", [], "So you want some troops from the {s2}?", "ramun_troops",[]],
  
  [anyone|repeat_for_troops|plyr,"ramun_troops", 
	[
		(store_repeat_object, ":troop"),
		(is_between, ":troop", regular_troops_begin, "trp_kidnapped_girl"),#eliminates a load
		(store_faction_of_troop, ":faction", ":troop"),#eliminates the rest
		(eq, ":faction", reg2),#by faction obviously
		(neg|troop_is_hero, ":troop"),#patrol leaders
		(str_store_troop_name, s3, ":troop"),
		(assign,"$stroop",0),		
	],
	"{s3}", "ramun_count", [(store_repeat_object,reg3),(str_store_faction_name, s3, reg2),(str_store_troop_name_plural,s4,reg3),(assign,"$stroop",reg3),]],
	
	[anyone,"ramun_count",[],"How many {s4}?","ramun_crespond",[]],
	
	[anyone|plyr,"ramun_crespond",[],"I shall return when I'm better prepared.","tavernkeeper_pretalk",[]],

    [anyone|plyr,"ramun_crespond",
      [
         (party_get_free_companions_capacity,":room","p_main_party"),
         (ge,":room",10),
         (store_troop_gold,":gold","trp_player"),
         (call_script,"script_game_get_join_cost","$stroop"),
         (store_mul,":cost","$stroop",10),
         (ge,":gold",":cost"),         
      ],"I'd like ten.","ramun_buy_some",[(assign, "$tcost", 10),]],
	
    [anyone|plyr,"ramun_crespond",
      [
         (party_get_free_companions_capacity,":room","p_main_party"),
         (ge,":room",50),
         (store_troop_gold,":gold","trp_player"),
         (call_script,"script_game_get_join_cost","$stroop"),
         (store_mul,":cost","$stroop",50),        
         (ge,":gold",":cost"),         
      ],"I'd like twenty.","ramun_buy_some",[(assign, "$tcost", 50),]],

	
    [anyone|plyr,"ramun_crespond",
      [
         (party_get_free_companions_capacity,":room","p_main_party"),
         (ge,":room",100),
         (store_troop_gold,":gold","trp_player"),
         (call_script,"script_game_get_join_cost","$stroop"),
         (store_mul,":cost","$stroop",100),         
         (ge,":gold",":cost"),         
      ],"I'd like one hundred.","ramun_buy_some",[(assign, "$tcost", 100),]],

    [anyone|plyr,"ramun_crespond",
      [
         (party_get_free_companions_capacity,":room","p_main_party"),
         (ge,":room",300),
         (store_troop_gold,":gold","trp_player"),
         (call_script,"script_game_get_join_cost","$stroop"),
         (store_mul,":cost","$stroop",300),         
         (ge,":gold",":cost"),         
      ],"I have no time for this tomfoolery! I need an army! I'll take three hundred!","ramun_buy_300",[(assign, "$tcost", 300),]],

    [anyone,"ramun_buy_some",[], "Certainly.", "ramun_anythingelse",
	  [
		(party_add_members, "p_main_party","$stroop","$tcost"),
        (call_script,"script_game_get_join_cost","$stroop"),
        (val_mul, "$tcost", "$stroop"),
        (troop_remove_gold, "trp_player", "$tcost"),
        (assign, "$tcost", 0),
	  ]
    ],	
			
	[anyone,"ramun_buy_300",[], "What a greedy {****er/*****} ye be!  I do this only for thee.", "ramun_anythingelse",
	  [
		(party_add_members, "p_main_party","$stroop","$tcost"),
        (call_script,"script_game_get_join_cost","$stroop"),
        (val_mul, "$tcost","$stroop"),
        (troop_remove_gold, "trp_player", "$tcost"),
        (assign, "$tcost", 0),			
	  ]
	],	
	
	[anyone,"ramun_anythingelse",[],"What else?","ramun_demands",[]],
	
	[anyone|plyr,"ramun_demands",[],"No, I'm done as thou hadst served well","tavernkeeper_pretalk",[]],
	[anyone|plyr,"ramun_demands",[],"Yes, more of the same.","ramun_count",[]],
	[anyone|plyr,"ramun_demands",[],"I would have another look at the list anew.","ramun_buy",[]],

#	[anyone|plyr,"ramun_troops",[], "Let's try some other kind of grunts.", "ramun_buy", []],
#giz me troobz end
 
(store_repeat_object,reg3),(str_store_faction_name, s3, reg2),(str_store_troop_name_plural,s4,reg3),(assign,"$stroop",reg3),
Instead of using reg3, store_repeat_object to $stroop directly.
Also, your code after instances of (call_script,"script_game_get_join_cost","$stroop") is erroneous - just because $stroop is a parameter doesn't mean the script will pass on that value by reference. Instead, most scripts will output their result to reg0, and you should multiply the cost by reg0 instead of by $stroop.
 
Perhaps I'm mistaken, but I do seem to recall that storing directly to the global caused the compiler to piss and moan.  If that does work I'd be happy to keep the code trim... 

And the reg0 instructions.  I know them by now, really.  This was an act of hast I think.  See compiler error pic.

a15c6822.jpg

ED:
the above was with original code except changes to the multiple. 
Now, changes as follows:
(call_script,"script_game_get_join_cost",reg0,"$stroop"), <-?
(val_mul, "$tcost", reg0),

produce this:

38c49df1.jpg

meanwhile,

(call_script,"script_game_get_join_cost","$temp","$stroop"),
(store_mul,":cost",reg0,10),

makes them free of charge, but with no errors in game. :???:

ED2:
Okay, this works, so I guess assigning the repeat object to reg3 will remain -

(call_script,"script_game_get_join_cost",reg3),
(store_mul,":cost",reg0,10),
 
Back
Top Bottom