Results 1 to 22 of 22

Thread: Ways to make CTD with script ?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Anything that isn't 'member' Member Squid's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    596

    Default Re: Ways to make CTD with script ?

    Question about the possible fow issue, first if my knowledge isn't totally wrong you should be able to turn it on and then off again in your script, if you can do that and you do that does it correctly set the FOW for out of sight spawned armies?

    -Trait/Ancillary/Building Editor

    "Two things are infinite: the universe and human stupidity;
    and I'm not sure about the universe." -----Albert Einstein

  2. #2

    Default Re: Ways to make CTD with script ?

    Afaik resetting the FOW does not help with the problem.
    The scripted armies also seem to 'swallow up' the FOW under certain conditions (to long ago to remember it all - will need to try out again) - for example if a scripted army was inside a city which was not 'lighted up' by a surrounding city or real army then the city itself becomes unavailable to select as well via the campaign map.

  3. #3
    Anything that isn't 'member' Member Squid's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    596

    Default Re: Ways to make CTD with script ?

    Well, there are two orders in which you can do the turn on, turn off of the FoW, and you might get different behaviour.

    1) Spawn Army
    Turn FoW Off
    Turn FoW On

    2) Turn FoW Off
    Spawn Army
    Turn FoW On

    I'd figure the second way wouldn't cause any problems, because there would be no FoW to 'swallow up', and then putting it back 'should' not cause any problems.

    -Trait/Ancillary/Building Editor

    "Two things are infinite: the universe and human stupidity;
    and I'm not sure about the universe." -----Albert Einstein

  4. #4

    Default Re: Ways to make CTD with script ?

    Vaya! I didn't know anything about this problem between spawned armies and the FOW.
    Squid's solution looks ok, but I have never noticed this bug so I don't think I'll be able to verify the solution.
    Just one think, this method would let the player to see all the map for a moment everytime the script spawns a new army, doesn't it?. I wonder if it would be enough to use the command "reveal_tile x,y" with the same tile than the spawned army. Do you know if the bug is related to the "fog of war" of the player or if it is related to the "field of view" of the faction that receives the army?


    Does yours go frequently enough that you can get any sort of with / without scripted spawns comparison on -ai ?
    I have used the comparison with -ai hundreds of times, but the results has changed with the diferent versions of the mod.
    I have been using spawned armies since the beginning (2 years ago) and then I was able to play hundreds of turn without any ctd, so I'm almost sure that spawned armies can be used without causing ctds. These are things that I'm sure you can do without ctds:
    -to use spawned armies including named characters (I have been using this to respawn the Nazguls for long time without any ctd).
    -to spawn armies for the ai, out of the FOW of the player, and then these armies are properly used by the AI without ctds.
    But I'm not sure if I have ever spawned armies out of the field of view of the faction who receives the army.

    Currently, we have some random ctds, and they appear both with and without scripts activated, so I can't help much with testing. But it seems than the frecuency of our ctds are slightly more often with scripts (about 1 ctd every 50 turns or so). However, we use a big ammount of scripts, so there are many possible causes, I'm just trying to reduce the possibilities.

  5. #5
    Anything that isn't 'member' Member Squid's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    596

    Default Re: Ways to make CTD with script ?

    I had missed reveal_tile, but you may still have the same problem because depending on where an army is spawned as to how many times would need to be revealed. As for the player being able to see the entire map every time FoW was toggled, I'd think the toggle should happen quick enough that at most you'd see a flicker, but probably nothing at all.

    -Trait/Ancillary/Building Editor

    "Two things are infinite: the universe and human stupidity;
    and I'm not sure about the universe." -----Albert Einstein

  6. #6

    Default Re: Ways to make CTD with script ?

    For the FOW issue it seems that after the character has been activated and moved he seems to be able to remove the FOW and become clickable via the strat map as well.

    Here is an example script of how it works fine to spwan an army for the player and not to have the FOW problem.
    Code:
    monitor_event FactionTurnStart FactionType Spain
    and I_TurnNumber = 1
    		spawn_army
    			faction spain
    			character Esugenos, named character, command 0, influence 0, management 0, subterfuge 0, age 40, , x 45, y 32
    			unit generic rebel general, exp 2 armour 0 weapon_lvl 0
    			unit aor caetrati falcata, exp 2 armour 0 weapon_lvl 0
    			unit aor caetrati falcata, exp 2 armour 0 weapon_lvl 0
    			unit aor caetrati falcata, exp 2 armour 0 weapon_lvl 0
    			unit aor caetrati falcata, exp 2 armour 0 weapon_lvl 0
    			unit aor caetrati falcata, exp 2 armour 0 weapon_lvl 0
    			unit aor caetrati falcata, exp 2 armour 0 weapon_lvl 0
    			unit rtr keltoi ambacti, exp 2 armour 0 weapon_lvl 0
    			unit rtr keltoi ambacti, exp 2 armour 0 weapon_lvl 0
    			unit rtr keltoi swordsmen, exp 2 armour 0 weapon_lvl 0
    			unit rtr keltoi swordsmen, exp 2 armour 0 weapon_lvl 0
    			unit aor iberian cavalry, exp 2 armour 0 weapon_lvl 0
    			unit aor iberian cavalry, exp 2 armour 0 weapon_lvl 0
    			unit aor iberian cavalry, exp 2 armour 0 weapon_lvl 0
    			unit aor iberian cavalry, exp 2 armour 0 weapon_lvl 0
    		end
    move Esugenos, 45, 33
    move Esugenos, 45, 32
    replenish_action_points Esugenos
    	terminate_monitor
    end_monitor
    And 2 pics to show the effects of adding the movement and not:
    https://i138.photobucket.com/albums/...oremovefow.jpg
    https://i138.photobucket.com/albums/...ues/Solved.jpg

  7. #7
    Notepad user Member Red Spot's Avatar
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    491

    Default Re: Ways to make CTD with script ?

    Reading up on this topic and seeing M2's campaign-scripts ... I'd almost call a few things "obvious" (though they arent in my scripts either ... )

    Like making a character move after spawning solves the issue of FOW/not moving, M2's scripts move men around when spawned wich always has looked a bit odd to me, to script it as such, now it does ring a bell ...


    Nice to know that moving people around after spawning has a purpose ... :)


    G

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