Search results for query: *

  1. Dain Ironfoot

    OSP Kit Combat Battlefield Tactics kit. Multiple formations per team+command revamp!

    Only thing I've noticed is that archers in formation have a tendency to move their formation without orders, player formations and AI tend to end up circling each other sometimes. Could be due to my buggy attempt at getting AI archers to use the new archer formations.
  2. Dain Ironfoot

    Modding Q&A [For Quick Questions and Answers]

    Anyone know how to generate a random number at the beginning of a script? store_random_in_range right?
  3. Dain Ironfoot

    OSP Kit Combat Battlefield Tactics kit. Multiple formations per team+command revamp!

    Ah, bugger. It is a weird one then. That's what the script returns. In which case it is checking it to the modified pos1.. which means the script should work.. formation_minimum_spacing is in cm right?

    Less than 100 is working fine it seems Have yet to try it with a script that immobilises an agent when they are in position, but my hold fire when unformed script is working nicely.
  4. Dain Ironfoot

    OSP Kit Combat Battlefield Tactics kit. Multiple formations per team+command revamp!

    motomataru said:
    Dain Ironfoot said:
    Ok, the debug reveals what I suspected, that each agent tries to use the same pos1 (first agents position) rather than their own modified pos1, as changed later in the script. While they are all in within 100 of this position, even when in a larger formation, I suspect this would break if we tried to use :dist > 100 as a check as they shuffle past pos1.

    So I guess we need to have the script looking for pos1 after it has been moved for each agent?

    ??? I don't understand how all agents in a large formation could possibly be within 100 cm of the same position.

    It is a weird one. Perhaps it's not cm?
  5. Dain Ironfoot

    OSP Kit Combat Battlefield Tactics kit. Multiple formations per team+command revamp!

    Ok, the debug reveals what I suspected, that each agent tries to use the same pos1 (first agents position) rather than their own modified pos1, as changed later in the script. While they are all in within 100 of this position, even when in a larger formation, I suspect this would break if we tried to use :dist > 100 as a check as they shuffle past pos1.

    So I guess we need to have the script looking for pos1 after it has been moved for each agent?

  6. Dain Ironfoot

    OSP Kit Combat Battlefield Tactics kit. Multiple formations per team+command revamp!

    Ok, so here's a question, should we be making the distance check before or after pos1 is moved?
  7. Dain Ironfoot

    OSP Kit Combat Battlefield Tactics kit. Multiple formations per team+command revamp!

    Also, I don't understand why you repeat the test section of your code.

    I was trying to work out if the 2nd rank could detect they were in position as well, I was experimenting with preventing all archers in a formation from firing until they came into position initially before deciding to rewrite it. Will try it with the debug script!
  8. Dain Ironfoot

    OSP Kit Combat Battlefield Tactics kit. Multiple formations per team+command revamp!

    I'm going to continue experimenting. Perhaps it also needs to check for negative distance too? Perhaps we should use the pos1 already defined in the forming up scripts, rather than getting a new position with the get_scripted_location. There seems to be one agent in the centre which can detect that it is in formation. Perhaps some sort of debug script may be in order to work out exactly what is going on.

    EDIT: Bah, no. Here is my current script, using the equip melee weapon as a test. If it works, the unit will switch to melee once they form up.

    Code:
    (gt, ":column", ":rank_dimension"),	#next rank?
    				(position_move_y, pos1, ":neg_distance", 0),
    				(try_begin),
    					(neq, ":form_left", 1),
    					(assign, ":form_left", 1),
    					(position_move_x, pos1, ":neg_distance", 0),
    				(else_try),
    					(assign, ":form_left", 0),
    					(position_move_x, pos1, ":distance", 0),
    				(try_end),			
    				(assign, ":column", 1),
    				(val_add, ":rank", 1),
    			(end_try),
    			(try_begin),
    (agent_get_position, pos2, ":agent"),
    						(get_distance_between_positions,":dist",pos1,pos2),
    						(eq, ":rank", 1),
    (try_begin),
    (le, ":dist", formation_minimum_spacing),
    (call_script, "script_equip_best_melee_weapon", ":agent", 0, 1),
    (else_try),
    (gt, ":dist", formation_minimum_spacing),
    (try_end),
           (else_try),
           (agent_get_position, pos2, ":agent"),
    						(get_distance_between_positions,":dist",pos1,pos2),
    						(eq, ":rank", 1),
    						(try_begin),
    (le, ":dist", formation_minimum_spacing),
    (call_script, "script_equip_best_melee_weapon", ":agent", 0, 1),
    (else_try),
    (gt, ":dist", formation_minimum_spacing),
    	(try_end),	
    		(try_end),
    		(end_try),
  9. Dain Ironfoot

    OSP Kit Combat Battlefield Tactics kit. Multiple formations per team+command revamp!

    You know, :distance IS the distance between troops. So you'd want to move HALF of that right or left as rank changes, right in the code you quoted:

    Great, that worked perfectly! Thanks!

    You know, a new slot would be overkill. I suggest the following making your calls to the brace spear functions in your section of script_form_infantry. Such as:

    That sounds good! Given me an idea about stopping archers firing until they've formed up too!

    EDIT: Ok, done various experiments and I think the check that the game doesn't know when the agents are in formation as they just keep acting as if they haven't formed up yet (using the method you posted above)

    Regards bracing scripts: I'll give it a go, but here's a stupid question (As I said, I'm very new to coding)

    when you refer to

    Code:
    (spear is not braced?),
    								(brace spear),

    How do I check for the bracing without checking for a slot?
  10. Dain Ironfoot

    OSP Kit Combat Battlefield Tactics kit. Multiple formations per team+command revamp!

    So if I replace :distance with an integer that is a little more or less than half the distance between troops, that would have the desired effect?

    Actually, this is a problem I haven't solved. The AI makes similar decisions based on the average position of the troops -- not terribly ideal. I suppose you could write a script that would loop through all agents, pick the ones in the formation, and compare position with scripted destination, then make some judgments about how many are how close...

    Eep. Sounds tricky. What I'm trying to do is fire off a script which causes the front rank to brace spears, easy enough to do.. except they become immobile, which can result in the first rank getting left behind. And I guess I'd need a stand up script for every movment etc. Flibbertigibbet.
  11. Dain Ironfoot

    SP Fantasy LOTR mod for warband

    HEY GUYS!!! im making a LOTR mod for warband and i could do with some help with items, map etc, i have already made a start and i just need some more people to help me make it, Gondor are already done and Rohan are nearly, elves and harad are under consturction/tweaking but i cant show you because if I do the magical fairies making it will dissolve.
  12. Dain Ironfoot

    Modding Q&A [For Quick Questions and Answers]

    Gah, I am still trying to solve my problem. Right. Here is the script.

    Code:
    ("get_centering_amount", [
    	(store_script_param, ":troop_formation", 1),
    	(store_script_param, ":num_troops", 2),
    	(store_script_param, ":extra_spacing", 3),
    	(store_script_param, ":sd_type", 4),
    	(store_mul, ":troop_space", ":extra_spacing", 50),
    	(val_add, ":troop_space", formation_minimum_spacing),
    	(assign, reg0, 0),
    	(try_begin),
          (eq, ":troop_formation", formation_wedge),
          (eq, ":sd_type", sdt_archer),
          (val_add, ":troop_space", 500),
          (store_mul, reg0, ":num_troops", ":troop_space"),
          (val_div, reg0, 2), #archers in 2 ranks
          (val_sub, reg0, ":troop_space"),
       (else_try),
    		(eq, ":troop_formation", formation_square),
    		(convert_to_fixed_point, ":num_troops"),
    		(store_sqrt, reg0, ":num_troops"),
    		(val_mul, reg0, ":troop_space"),
    		(convert_from_fixed_point, reg0),
    		(val_sub, reg0, ":troop_space"),
    	(else_try),

    etc

    here is how I am calling it, either

    Code:
    (call_script, "script_get_centering_amount", ":fformation", ":num_troops", ":formation_extra_spacing", sdt_archer),

    or when it isn't an archer

    Code:
    (call_script, "script_get_centering_amount", formation_default, ":num_troops", ":formation_extra_spacing", 0),
    (I sort of assumed I could just throw a null thingy in there.

    And the error I am getting is still
    Code:
    SCRIPT ERROR ON OPCODE23: INVALID SCRIPT PARAMETER ID: 3; LINE NO; 3
    At script get centering amount

    Which is odd because the parameter I added was parameter 4
  13. Dain Ironfoot

    Modding Q&A [For Quick Questions and Answers]

    Ah, do I need to update all the scripts that fire this script?
  14. Dain Ironfoot

    Modding Q&A [For Quick Questions and Answers]

    I was referring to this:

    Dain Ironfoot said:
    Can anyone give me a paw with this code?

    Code:
    ("get_centering_amount", [
    	(store_script_param, ":troop_formation", 1),
    	(store_script_param, ":num_troops", 2),
    	(store_script_param, ":troop_type", 3),
    	(store_script_param, ":extra_spacing", 4),
    	(store_mul, ":troop_space", ":extra_spacing", 50),
    	(val_add, ":troop_space", formation_minimum_spacing),
    	(assign, reg0, 0),
    	(try_begin),
          (eq, ":troop_formation", formation_wedge),
          (eq, ":troop_type", grc_archers),
          (val_add, ":troop_space", 500),
          (store_mul, reg0, ":num_troops", ":troop_space"),
          (val_div, reg0, 2), #archers in 2 ranks
          (val_sub, reg0, ":troop_space"),
       (else_try),

    In-game I get an error about parameter ID 3 being invalid. I haven't the foggiest why.
  15. Dain Ironfoot

    Modding Q&A [For Quick Questions and Answers]

    I blame my schizo copy-pasting.

    I don't suppose you have any thoughts on my frustrating problem above do you?
  16. Dain Ironfoot

    Modding Q&A [For Quick Questions and Answers]

    Ok, that sounds reasonable. I'll look into it once I fix this daft problem.

    So something like this:

    (agent_is_alive, ":agent"),
          (agent_is_non_player, ":agent"),
          (agent_get_troop_id, ":troop", ":agent"),
          (eq, ":troop", "trp_YOUR_TROOP"),
    (this_or_next|eq, ":troop", "trp_YOUR_TROOP"),
  17. Dain Ironfoot

    Modding Q&A [For Quick Questions and Answers]

    ( s t o r e _ s c r i p t _ p a r am , " : e x t r a _ s p a c i n g " , 4 , ) ,

    While that was a silly mistake, still getting the error.. it's unfortunate as this script failing causes troops to run to the edge of the map!

    Ok, while I'm here, is it possible to get an agent by troop name? Or do I have to hack something using troop has item equipped?
  18. Dain Ironfoot

    Modding Q&A [For Quick Questions and Answers]

    I'm not sure :razz: What does that mean?
  19. Dain Ironfoot

    OSP Kit Combat Battlefield Tactics kit. Multiple formations per team+command revamp!

    Hallo, me again.

    While I have succesfully got the spread out formation working (aside from a problem with centring, see the Q&A thread) I've been having a few more thoughts. I'd basically like the rear rank to take one step to their left or right, just for improved LOS. Now I'm guessing

    Code:
    (gt, ":column", ":rank_dimension"),	#next rank?
    				(position_move_y, pos1, ":neg_distance", 0),
    				(try_begin),
    					(neq, ":form_left", 1),
    					(assign, ":form_left", 1),
    					(position_move_x, pos1, ":neg_distance", 0),
    				(else_try),
    					(assign, ":form_left", 0),
    					(position_move_x, pos1, ":distance", 0),
    				(try_end),			
    				(assign, ":column", 1),
    				(val_add, ":rank", 1),

    Controls the rear rank position? Can I add some values there to cause them to take a few steps to the left?

    Also, I'd like to fire off a script only when a formation has finished forming..

  20. Dain Ironfoot

    Modding Q&A [For Quick Questions and Answers]

    Can anyone give me a paw with this code?

    Code:
    ("get_centering_amount", [
    	(store_script_param, ":troop_formation", 1),
    	(store_script_param, ":num_troops", 2),
    	(store_script_param, ":troop_type", 3),
    	(store_script_param, ":extra_spacing", 4,),
    	(store_mul, ":troop_space", ":extra_spacing", 50),
    	(val_add, ":troop_space", formation_minimum_spacing),
    	(assign, reg0, 0),
    	(try_begin),
          (eq, ":troop_formation", formation_wedge),
          (eq, ":troop_type", grc_archers),
          (val_add, ":troop_space", 500),
          (store_mul, reg0, ":num_troops", ":troop_space"),
          (val_div, reg0, 2), #archers in 2 ranks
          (val_sub, reg0, ":troop_space"),
       (else_try),

    In-game I get an error about parameter ID 3 being invalid. I haven't the foggiest why.
Back
Top Bottom