Spouses,fathers and lovers

正在查看此主题的用户

 
  # script_cf_get_random_kingdom_hero_as_lover
  # Input: arg1 = troop_no (of the lady)
  # Output: reg0 = troop_no (of the hero) (Can fail)
  ("cf_get_random_kingdom_hero_as_lover",
    [
      #      (store_script_param_1, ":cur_lady"),
     
     
      #      (troop_get_slot, ":cur_father", ":cur_lady", slot_troop_father),
      #      (troop_get_slot, ":fathers_rank", ":cur_father", slot_troop_kingdom_rank),
      (assign, ":result", -1),
      (assign, ":count_heroes", 0),
      (try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
        (troop_slot_eq, ":troop_no", slot_troop_lover, 0),
        (troop_slot_eq, ":troop_no", slot_troop_spouse, 0),
        #        (troop_get_slot, ":cur_rank", ":troop_no", slot_troop_kingdom_rank),
        #        (lt, ":cur_rank", ":fathers_rank"), # Only heroes with lower ranks may be the lovers of the daughters
        (val_add, ":count_heroes", 1),
      (try_end),
      (store_random_in_range,":random_hero",0,":count_heroes"),
      (assign, ":count_heroes", 0),
      (try_for_range, ":troop_no", kingdom_heroes_begin, kingdom_heroes_end),
        (eq, ":result", -1),
        (troop_slot_eq, ":troop_no", slot_troop_lover, 0),
        (troop_slot_eq, ":troop_no", slot_troop_spouse, 0),
        #        (troop_get_slot, ":cur_rank", ":troop_no", slot_troop_kingdom_rank),
        #        (lt, ":cur_rank", ":fathers_rank"), # Only heroes with lower ranks may be the lovers of the daughters
        (val_add, ":count_heroes", 1),
        (gt, ":count_heroes", ":random_hero"),
        (assign, ":result", ":troop_no"),
      (try_end),
      (neq, ":result", -1),
      (assign, reg0, ":result"),
  ]),
 
 


Found this line of script messing about in python and i was just wondering if its been implemented into the game yet?
 
I'm looking at implementing this kind of thing in my mod, though I have yet to get time to start it... :wink:

I saw the slots defined for this before I've seen this code.  Might make a bit of my work easier...
 
Try searching for script_cf_get_random_kingdom_hero_as_lover and you'll see it is currently called in module_scripts when setting up the family relations in the game start code.
 
Ha ha! Spouses, lovers?...  :mrgreen:

I just KNEW this piece of code existed.

Now, do you think that this kind of code, once tweaked, could be applied to the player, to give him a lover, a rival, etc?
 
You don't have to use this code, you can make your own.  I have already started on the flow for my relationships code.  You just need to know what will influence them.
 
jik 说:
You don't have to use this code, you can make your own.  I have already started on the flow for my relationships code.  You just need to know what will influence them.

Same as with all women, mate... a big fat purse :grin:
 
MartinF 说:
jik 说:
You don't have to use this code, you can make your own.  I have already started on the flow for my relationships code.  You just need to know what will influence them.

Same as with all women, mate... a big fat purse :grin:

Don't forget, it works both ways.  The men have to want the women.  For that they want to see a nice round, but firm... dowry.  The hard part for me will be making the stats for the offspring, based on the parents...
 
jik 说:
The hard part for me will be making the stats for the offspring, based on the parents...

Bah. Why bother with kids?

- The conquest of Calradia rarely takes more than 3 or 4 in-game "years" to complete. I don't think that a 4 y-o kid will fight Steppe Bandits! Thus, Kids don't need stats.
Even if you have kids, you will have to wait till they reach adulthood and are able to fight. How many players will have the patience to play, say, 16 "years" on the same map?

- Anyway, who would really bother to model and fully animate small children? I reckon it would be great, but I think it's a DEV job, not a MOD job...


 
Lord Samuel 说:
- The conquest of Calradia rarely takes more than 3 or 4 in-game "years" to complete. I don't think that a 4 y-o kid will fight Steppe Bandits! Thus, Kids don't need stats.
Even if you have kids, you will have to wait till they reach adulthood and are able to fight. How many players will have the patience to play, say, 16 "years" on the same map?
Well, it can be solved by making one year to be counted as 16  :mrgreen:
No really, if we can cross whole Calradia in less then one day, we can sacrifice some more realism for that thing.

Hm, does somebody knows, is it possible to add new characters in runtime, with randomly selected names etc?

UPD: sorry for necroposting, i've just found that peace of code today and found it very interesting )
 
The Wedding Dance mod is going to have spouses and source code so you could always check that out as well. Not out yet though.
 
Lord Samuel 说:
jik 说:
The hard part for me will be making the stats for the offspring, based on the parents...

Bah. Why bother with kids?

- The conquest of Calradia rarely takes more than 3 or 4 in-game "years" to complete. I don't think that a 4 y-o kid will fight Steppe Bandits! Thus, Kids don't need stats.
Even if you have kids, you will have to wait till they reach adulthood and are able to fight. How many players will have the patience to play, say, 16 "years" on the same map?

- Anyway, who would really bother to model and fully animate small children? I reckon it would be great, but I think it's a DEV job, not a MOD job...

lol who says one map one world? it can be large across the seven seas and seven continents ;-p wide and vast it is
 
Kids could also be considered as new characters. So if you choose the retire option, you could opt to start a new game with stats and skills determined by your current character's "heir". And your heir's stats would be based on a combination of your current character's stats and his/her spouse.
 
Keedo420 说:
Kids could also be considered as new characters. So if you choose the retire option, you could opt to start a new game with stats and skills determined by your current character's "heir". And your heir's stats would be based on a combination of your current character's stats and his/her spouse.
Or if you die :smile:
 
My idea involves throwing all the non-used NPCs into a pool and have them pulled out and re-used after a period of time.  Cannot rename them (that I have found yet), but since my map has 8 families vying for the thrown, I can see maybe 40  NPCs in use at once.  Add in Permadeath and the numbers will probably not grow beyond that.

Also, I will be using time differently than in native.  None of this wander the land for days straight with no goal.  You have a town and fiefs to properly manage, armies to train, villages to protect, tournament to hold and participate in, courting a wife, etc.

In my mod weeks will pass by rather quickly.  You will most likely die at least once.  With out an heir the game ends for you then.
 
Sounds promising, and not just a little ambitious.

How will you manage little children heirs? Will they be pure 'abstractions' till they reach adulthood?
 
Lord Samuel 说:
Sounds promising, and not just a little ambitious.

How will you manage little children heirs? Will they be pure 'abstractions' till they reach adulthood?

Hoping to.  They will not actually have an NPC that can move around till they are of age (maybe 12).  You will also have to spend time training them (menu option that will take up time).  Still working that stuff out on paper, time is still the odd factor that needs the most work.
 
Wu-long 说:
lol who says one map one world? it can be large across the seven seas and seven continents ;-p wide and vast it is

Ok, but we're talking about modding, right? Hegemony, for example: travel from western Hispania to Grece takes 1 day if you have good pathfinding, as i remember
 
Unfortunately 2 things mar my progress.

1.  This damn joust code I am working on.  Tournaments will (hopefully) play a big part in my mod, so I need to get this working.
2.  Renaming troops.  Because people will die and be born, I will now have to have a large pool of NPCs to pull from.  I haven't looked at changing the face codes (for aging as well, facial changes), but I hope this can be scripted in game.  What I will have to do is pull a random NPC from the dead pool to be born back into the game at later dates.  All Theory for now...

Most likely the next part I will work on.  Well time progression as a whole.  I need to make time pass much faster (weeks at a time) to get the effect I want.  No wandering the map for days at end, though there will be patrol times and other map evens.
 
后退
顶部 底部