Results 1 to 7 of 7

Thread: Getting the spawn there all the time

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Getting the spawn there all the time

    I had a thought about spawning and it occurred to me that there will certainly times when a spot is already occupied. My guess is: the spawn will not happen.

    How do I avoid\circumvent this? How can I script alternate spawn points?

    Kind of: if spot A is occupied, try spot B.










  2. #2
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Getting the spawn there all the time

    Haven't tried it myself, but try spawning a character for your local faction and not moving him. Then try spawning another on the next turn and see what happens. It's entirely possible it will spawn in a surrounding tile, or kick the previous occupant to a surrounding tile. If it CTDs then we have our answer.

    It's possible to do what you're suggesting but it would be one painful script, because you'd need to use a condition like I_CharacterTypeNearTile for every conceivable character type. And then what if there's a character on the new tile? Even more problems. Nested if statements out the wazoo.

    It seems to me the engine couldn't possibly be stupid enough to have a collision error there, since they'd obviously have foreseen the possibility when writing their mongol invasion script.

  3. #3
    Caesar Clivus's Avatar SS Forum Moderator
    Join Date
    May 2007
    Location
    Australia
    Posts
    12,693

    Default Re: Getting the spawn there all the time

    I'd be curious to see what would happen because last night I was setting up a decr_strat and I put two starting characters in the same town. The odd thing is that only the first character was actually in the town, the second was standing on top of the town but I couldn't select him because the town was in the way. The only way I could select him was through the family tree screen. Dont know if the same thing would happen when spawning characters in the script or if it would CTD

    BftB2 UPDATED 22nd DECEMBER. Member of the Complete Byzantine Unit Roster team

  4. #4
    Swagger's Avatar Imperial Coffee-Runner
    Join Date
    Apr 2007
    Location
    Portugal
    Posts
    12,453

    Default Re: Getting the spawn there all the time

    i think it will move 1 pixel to the side


    i remember when i put 2 characters in the same tile, the 1st goes there, and when the new one comes he replaces him, and the 1st character moves 1 pixel to any side
    Under the Patronage of the Dreadful cedric37!
    Ancs Guide, Emergent Factions , Yes/No Events |L'Outremer for Modders| Swagger's Skymod


  5. #5

    Default Re: Getting the spawn there all the time

    You can select various spawning sites on the map and make them impassable but one tile away from passable terrain.

    If armies are spawned there they can immediately be moved by scripting. If they can't complete the move because of other armies at least they have spawned correctly.

    Units can move off an impassable tile but can't return so it keeps them clear. However the spawning site should have terrain that allows a playable battlemap in case they are attacked before they move.

    If a stack already occupies the tile an army is to be spawned on then the new army will instead spawn on an adjacent tile. I'm not sure what happens if there are no adjacent tiles available, next nearest perhaps?

    You can't spawn characters into settlements directly. You could spawn and move them there in one go providing the move is possible (i.e. faction owns city and there is enough room).

    Click to view content: 

    monitor_event FactionTurnStart FactionType scotland
    and I_CompareCounter wallace_spawned = 1

    spawn_army
    faction scotland
    character William Wallace, named character, age 20, x 75, y 129, direction S, battle_model Wallace_General, portrait wallace
    traits ScotlandHero 1, LoyaltyStarter 1, ManagementStarter 1, BattleChivalry 2, NaturalMilitarySkill 2, GoodRiskyAttacker 1, Loyal 2, Just 2
    unit Highland Nobles exp 5 armour 0 weapon_lvl 1
    unit Highland Nobles exp 4 armour 0 weapon_lvl 1

    end

    ;Move to stone fort
    move William Wallace, 74, 129

    historic_event scotland_wallace event/william_wallace.bik

    terminate_monitor

    Last edited by The Bruce; September 30, 2009 at 04:19 AM.

  6. #6
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: Getting the spawn there all the time

    Thanks guys for all the input. The summary seems to be that the spawn will happen, even if there is another character on those coordinates. Spawn and move is a nice touch.










  7. #7

    Default Re: Getting the spawn there all the time

    Quote Originally Posted by gigantus View Post
    The summary seems to be that the spawn will happen, even if there is another character on those coordinates.
    I'm not sure this is always true. I seem to recall having trouble with it which is why I started spawning on impassable terrain. It may just have been the uncontrollable nature of it that annoyed me.

Posting Permissions

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