tequilajusthitme Posted April 13, 2010 Share Posted April 13, 2010 Hi, I am currently trying to write a script that would make anyone wearing a certain article of clothing friends with a variety of factions. I tried using a variation on the ghoul mask script, where not only the feral ghoul faction would be made an ally. Yes, i do realize many of the factions i listed don't track crime. At the time I was too lazy to check so i just cleared the flags. * Italics mean 1st indent, regular text is second, underline is third.scn 00CustomScript4.10.2010 short doOnce ;puts the player into a faction in which is allied with many factions, and those factions are allied with the friendly faction Begin OnEquip Player if doOnce == 0 ;adds/clears the player to/from a variety of factions ClearFactionPlayerEnemyFlag FeralGhoulFaction ClearFactionPlayerEnemyFlag RaiderFaction ClearFactionPlayerEnemyFlag SuperMutantFaction ClearFactionPlayerEnemyFlag TalonCompany ClearFactionPlayerEnemyFlag DLC04SwampFolkCreeperFaction ClearFactionPlayerEnemyFlag DLC04SwampFolkScrapperFaction ClearFactionPlayerEnemyFlag DLC04SwampFolkBruiserFaction ClearFactionPlayerEnemyFlag DLC04SwampFolkTrackerFaction ClearFactionPlayerEnemyFlag DLC04SwampFolkBrawlerFaction ClearFactionPlayerEnemyFlag DLC04SwampFolkFaction set doOnce to 1 endif setAlly playerFaction RaiderFaction 1 1 ;FRIEND setAlly playerFaction SupermutantFaction 1 1 ;FRIEND setAlly playerFaction DLC04SwampFolkFaction 1 1 ;FRIEND setAlly playerFaction TalonCompany 1 1 ;FRIEND setAlly playerFaction FeralGhoulFaction 1 1 ;FRIEND End ;makes these factions hostile after unequiping the item Begin OnUnEquip PlayersetEnemy playerFaction RaiderFaction ;Enemy setEnemy playerFaction SupermutantFaction ;Enemy setEnemy playerFaction DLC04SwampFolkFaction ;Enemy setEnemy playerFaction TalonCompany ;Enemy setEnemy playerFaction FeralGhoulFaction ;ENEMY EndI also tried removing the player from the player faction, then placing the player into a faction that was allied with many factions. scn 00CustomScript4.10.2010 short doOnce ;puts the player into a faction in which is allied with many factions, and those factions are allied with the friendly faction Begin OnEquip Player if doOnce == 0 ;adds/clears the player to/from a variety of factions Player.removefromfaction playerfaction ClearFactionPlayerEnemyFlag FeralGhoulFaction ClearFactionPlayerEnemyFlag RaiderFaction ClearFactionPlayerEnemyFlag SuperMutantFaction ClearFactionPlayerEnemyFlag TalonCompany ClearFactionPlayerEnemyFlag DLC04SwampFolkCreeperFaction ClearFactionPlayerEnemyFlag DLC04SwampFolkScrapperFaction ClearFactionPlayerEnemyFlag DLC04SwampFolkBruiserFaction ClearFactionPlayerEnemyFlag DLC04SwampFolkTrackerFaction ClearFactionPlayerEnemyFlag DLC04SwampFolkBrawlerFaction ClearFactionPlayerEnemyFlag DLC04SwampFolkFaction player.addtofaction 00HeliosFriendly 1 set doOnce to 1 endif setAlly playerFaction FeralGhoulFaction 1 1 ;FRIEND End Begin OnUnEquip Player player.addtofaction Playerfaction 1 player.removefromfaction 00HeliosFriendly setEnemy playerFaction FeralGhoulFaction ;ENEMY EndI would appreciate any help. Neither of the scripts worked in game, as all factions would attack me. I am new to scripting, and would appreciate any advice. Link to comment Share on other sites More sharing options...
tequilajusthitme Posted April 13, 2010 Author Share Posted April 13, 2010 Nevermind. I fixed it by adding individual NPCs to a faction. Link to comment Share on other sites More sharing options...
pkleiss Posted April 13, 2010 Share Posted April 13, 2010 That first script of yours looks right. But I believe that the game does not like script names (or references for that matter) that begin with numbers. Try renaming your script, Also, instead of italicizing or underlining the commands in your scripts, just copy them from your script window, paste them into a post, then highlight the whole thing and click on the 'code snipet' icon on the tool bar. It looks like this < >. That will keep the spacing of your code nice and readable. Another useful trick is to make a few debug message objects and use the ShowMessage command to display them. If you put one in your OnEquip block and another in your OnUnequip block, you could see if those blocks were firing or not. Link to comment Share on other sites More sharing options...
tequilajusthitme Posted April 13, 2010 Author Share Posted April 13, 2010 That first script of yours looks right. But I believe that the game does not like script names (or references for that matter) that begin with numbers. Try renaming your script, Also, instead of italicizing or underlining the commands in your scripts, just copy them from your script window, paste them into a post, then highlight the whole thing and click on the 'code snipet' icon on the tool bar. It looks like this < >. That will keep the spacing of your code nice and readable. Another useful trick is to make a few debug message objects and use the ShowMessage command to display them. If you put one in your OnEquip block and another in your OnUnequip block, you could see if those blocks were firing or not. Thank you. I will try rewriting the script like that Link to comment Share on other sites More sharing options...
Recommended Posts