269091 Posted June 1, 2009 Share Posted June 1, 2009 I am desperately looking for an experienced scripter for a few scripts in my project. Its almost finished - just some scripts I made won't work as expected - probably I'm just too silly. Its about allowing the Player to take prisoners either by using the mesmetron or making them flee in combat.The Mod comes with a decent amount of new stuff (I don't want to tell too much) - all finished. Its just the scripts I tried for a week now with hundreds of reloads that didn't get me any further. Any help would be very much appreciated.If anyone really interested into checking/ correcting/ rewriting these scripts I could send the unfinished mod to test. Best regards Link to comment Share on other sites More sharing options...
sumoftwosins Posted June 2, 2009 Share Posted June 2, 2009 It might be hard to get volunteers... so I recommend you post the scripts you are having problems with. We can usually tell what you are trying to accomplish through the script and determine where your problems are at. There are quite a few people around that could probably line it out. I can tell you that you at least need to be using the command to add a new ai package to whomever you "capture". That ai package will need to do whatever it is you want them to do when they are captured, e.g. follow you or stay in a location. Link to comment Share on other sites More sharing options...
Alundaio Posted June 2, 2009 Share Posted June 2, 2009 I am desperately looking for an experienced scripter for a few scripts in my project. Its almost finished - just some scripts I made won't work as expected - probably I'm just too silly. Its about allowing the Player to take prisoners either by using the mesmetron or making them flee in combat.The Mod comes with a decent amount of new stuff (I don't want to tell too much) - all finished. Its just the scripts I tried for a week now with hundreds of reloads that didn't get me any further. Any help would be very much appreciated.If anyone really interested into checking/ correcting/ rewriting these scripts I could send the unfinished mod to test. Best regards Post some Snippets and I'll give it look for sure. Link to comment Share on other sites More sharing options...
sesom Posted June 2, 2009 Share Posted June 2, 2009 I am desperately looking for an experienced scripter for a few scripts in my project. Its almost finished - just some scripts I made won't work as expected - probably I'm just too silly. Its about allowing the Player to take prisoners either by using the mesmetron or making them flee in combat.The Mod comes with a decent amount of new stuff (I don't want to tell too much) - all finished. Its just the scripts I tried for a week now with hundreds of reloads that didn't get me any further. Any help would be very much appreciated.If anyone really interested into checking/ correcting/ rewriting these scripts I could send the unfinished mod to test. Best regards It's actualy not so easy to make prisoners with this engine. Respawning, Reference lost, ... I spent countless hours to get my enslaving system right. I need further details to help here. If you need an complete enslaving system, you have to wait until my FNN Part One is ready, then i plan to publish the system as modders resource. Link to comment Share on other sites More sharing options...
269091 Posted June 2, 2009 Author Share Posted June 2, 2009 Ok then... First: A collar effect script Backround info: There are two prisons in Megaton and in (an extended) Arefu.The prisoners are to be sent to either one of them into a holding cell (door is not locked) where they should wait for the palyer to be brought to (one of two) other cells at each Jail (This last with the other cells process is not implmented yet - but I'm sure I could do it myself by using Quest Topics, packages and markers). If they will go to Arefu or Megaton is dtermined by adding one of two tokens via Quest topics in MS13slaves Quest (made sense as I at this stage also use the mesmetron). Also they are added a prisonar collar (based on the slave collar) for the effect.Also to prevent Prisoners from unloading and disappearing I have used the system from the slaves stick areound mod to resurrect them - altered to my needs. There tokens are use by the collar effect script - one of them has the resurrect script attached. Problem: Everything works fine except that not only the prisoners never arrive in cell MegatonJail but also the game crashes when I try to enter the cell with a (supposed) prisoner in it (otherwise it works well, navmesh there, green triangles, doors unlocked (dogmeat follows inside - so everything should be fine). And these are the scripts: scn CaPCollarEffectScript ;effect script attached to CaPCollar ;!!!!!!!!!!!!!!!!------------- the "don't dispel on death" flag in the Magic Effect form it needs to be marked so this script with work properly with the death on the actor ---------------!!!!!!!!!!!!!!!!!!!!!!!! short arrived short spell short statsChanged; set to 1 after Mezzed spell goes away and stats have been changed ; save original stats so we can restore them if collar removed short StartingAggression Short StartingAssistance Short StartingConfidence Short StartingEnergy Short StartingResponsibility Short StartingMood short StartingIgnoreCrime float alarmTimer Begin ScriptEffectStart set spell to isSpellTarget MS13mezzedSpell if spell == 1 dispel MS13MezzedSpell; get rid of mezzed spell addToFaction CaPCollarFaction 0;add to a faction which is friends with the player so that I won't aggro on player even if he has a crime tracking faction that hates the player set StartingIgnoreCrime to GetIgnoreCrime ignoreCrime 1 ; make sure running correct package if getItemCount CaPCollarEffectMegatonToken > 0 if GetInCell MegatonJail == 0 AddScriptPackage CaPTravelToMegaton endif elseif getItemCount CaPCollarEffectArefuToken > 0 if GetInCell ArefuJail == 0 AddScriptPackage CaPTravelToArefu endif endif endif End Begin ScriptEffectUpdate if statsChanged == 0 if HasMagicEffect MS13Mezzed == 0 ; don't change stats until mezzed effect goes away, to make sure we're looking at REAL stats set statsChanged to 1 ; save stats for VIPs in case they're rescued after arriving in PF if GetIsID Red == 1 && MS13.RedStatsChanged == 0 set MS13.RedStatsChanged to 1 set MS13.RedAggression to getAv aggression set MS13.RedAssistance to getAv assistance set MS13.RedConfidence to getAv confidence elseif GetIsID Flak == 1 && MS13.FlakStatsChanged == 0 set MS13.FlakStatsChanged to 1 set MS13.FlakAggression to getAv aggression set MS13.FlakAssistance to getAv assistance set MS13.FlakConfidence to getAv confidence elseif GetIsID SusanLancaster == 1 && MS13.SusanStatsChanged == 0 set MS13.SusanStatsChanged to 1 set MS13.SusanAggression to getAv aggression set MS13.SusanAssistance to getAv assistance set MS13.SusanConfidence to getAv confidence elseif GetIsID Arkansas == 1 && MS13.ArkansasStatsChanged == 0 set MS13.ArkansasStatsChanged to 1 set MS13.ArkansasAggression to getAv aggression set MS13.ArkansasAssistance to getAv assistance set MS13.ArkansasConfidence to getAv confidence endif set StartingAggression to getAv Aggression set StartingAssistance to getAv Assistance set StartingConfidence to getAv Confidence set StartingEnergy to getAv Energy set StartingResponsibility to getAv Responsibility set StartingMood to getAv Mood ;set up AI data setAv Aggression 0 setAv Assistance 0 setAv Confidence 0 setAv Energy 5 setAv Responsibility 0 setAv Mood 4 endif endif ; send assault alarm after exiting dialogue ; use actor value so we make sure to only do this once if getItemCount CaPCollarEffectScriptAlarmToken < 1 if menumode == 0 set alarmTimer to alarmTimer + ScriptEffectElapsedSeconds if alarmTimer > 2 AddItem CaPCollarEffectScriptAlarmToken 1 SendAssaultAlarm stopcombat endif endif endif ; make sure running correct package if getItemCount CaPCollarEffectMegatonToken > 0 if getIsCurrentPackage CaPTravelToMegaton == 0 && getIsCurrentPackage CaPWaitPlayerMegaton == 0 AddScriptPackage CaPTravelToMegaton endif elseif getItemCount CaPCollarEffectArefuToken > 0 if getIsCurrentPackage CaPTravelToArefu == 0 && getIsCurrentPackage CaPWaitPlayerArefu == 0 AddScriptPackage CaPTravelToArefu endif endif if arrived == 0 && GetItemCount CaPResurrectAddonToken == 0 if getDead == 1; this only makes sense because the effect is marked not to be dispelled on death set arrived to -1 showmessage CaPPrisonerLostMessage elseif getInCell MegatonJail == 1 ;slave arrived on his own because he was a persistent actor, or a non-persistent actor who didn't unload (accompanied by the player) set arrived to 1 ; add to prisoner faction addToFaction CaPPrisonerFaction 0 removeScriptPackage CaPTravelToMegaton AddScriptPackage CaPWaitPlayerMegaton evp removeItem CaPCollarEffectMegatonToken, 1 elseif getInCell ArefuJail == 1 ;slave arrived on his own because he was a persistent actor, or a non-persistent actor who didn't unload (accompanied by the player) set arrived to 1 ; add to prisoner faction addToFaction CaPPrisonerFaction 0 removeScriptPackage CaPTravelToArefu AddScriptPackage CaPWaitPlayerArefu evp removeItem CaPCollarEffectArefuToken, 1 endif endif End Begin ScriptEffectFinish ;This block will run if the spell is dispelled, which only happens when the NPC unloads (because the spell effect is marked not to dispell on death), of if the player removes the collar from the NPC if MS13Slaves.playerRemovedPCollar == 1 set MS13Slaves.playerRemovedPCollar to -1 ; reset stats back to original removeItem CaPResurrectAddonToken, 1 removeFromFaction CaPCollarFaction RemoveFromFaction CaPPrisonerFaction RemoveScriptPackage ignoreCrime StartingIgnoreCrime if GetIsID Red == 1 && MS13.RedStatsChanged == 1 set MS13.RedStatsChanged to 0 setav aggression MS13.RedAggression setav assistance MS13.RedAssistance setav confidence MS13.RedConfidence elseif GetIsID Flak == 1 && MS13.FlakStatsChanged == 1 set MS13.FlakStatsChanged to 0 setav aggression MS13.FlakAggression setav assistance MS13.FlakAssistance setav confidence MS13.FlakConfidence elseif GetIsID SusanLancaster == 1 && MS13.SusanStatsChanged == 1 set MS13.SusanStatsChanged to 0 setav aggression MS13.SusanAggression setav assistance MS13.SusanAssistance setav confidence MS13.SusanConfidence elseif GetIsID Arkansas == 1 && MS13.ArkansasStatsChanged == 1 set MS13.ArkansasStatsChanged to 0 setav aggression MS13.ArkansasAggression setav assistance MS13.ArkansasAssistance setav confidence MS13.ArkansasConfidence elseif statsChanged == 1 setAv Aggression StartingAggression setAv Assistance StartingAssistance setAv Confidence StartingConfidence setAv Energy StartingEnergy setAv Responsibility StartingResponsibility setAv Mood StartingMood endif elseif getItemCount CaPResurrectAddonToken == 0 addItem CaPResurrectAddonToken, 1 ;assume the NPC unloaded ;if the prisoner hasn't arrived yet, we'll assume he has been killed or escaped (he's not in the same cell as the player or he wouldn't have unloaded) if arrived == 0 set arrived to 2 addToFaction CAPPrisonerFaction 0 addItem CaPResurrectPrisonerToken, 1 if getItemCount CaPCollarEffectMegatonToken > 0 moveTo CaPArriveCellMarkerMegaton elseif getItemCount CaPCollarEffectArefuToken > 0 moveTo CaPArriveCellMarkerArefu endif KILL ;killing so that dialog assumes the player has been "killed" which makes more sense than people talking about them like they are still in town ;DISABLE endif endif End scn CaPResurrectPrisonerSCRIPT ;Object Script attached to CaPResurrectPrisonerToken ref target short flag short stage short MegatonToken short ArefuToken begin GameMode set target to GetContainer if target.getItemCount CaPCollarEffectMegatonToken > 0 set MegatonToken to 1 elseif target.getItemCount CaPCollarEffectArefuToken > 0 set ArefuToken to 1 endif if target != 0 if target.getDead == 0 && flag == 0 && target.isEssential == 1 set stage to 0 set flag to 1 ;target can't die, so no need to kill it (beth didn't add any after-death dialogue). ;ie, target is essential. elseif target.getDead == 0 && flag == 0 && target.isEssential != 1;target is not dead, and item has just been added set stage to 1 target.kill set flag to 1 elseif target.getDead == 1 && flag == 0;target is dead, but not by this script. set stage to 2 ;due to some other issues, I can't just ignore this case. I'll set flag to 1 ;and assume that since he has the token, it was the collar script that ;killed him. With dead == 1 and flag == 1, see below. set flag to 1 elseif target.getDead == 1 && flag == 1;target is dead, and was killed by this script set stage to 3 target.resurrect if MegatonToken == 1 target.addScriptPackage CaPWaitPlayerMegaton elseif ArefuToken == 1 target.addScriptPackage CaPWaitPlayerArefu endif set flag to 2 elseif target.getDead == 0 && flag == 1 ;target couldn't die, but we're pretending they did. set stage to 4 ;not sure how we got to this point. The target did not die, but the script thinks he did. ;set the target to Enslaved and hope for the best. set flag to 2 if MegatonToken == 1 target.addScriptPackage CaPWaitPlayerMegaton elseif ArefuToken == 1 target.addScriptPackage CaPWaitPlayerArefu endif elseif flag == 2 ;effect is complete, remove me set stage to 5 return else ;shouldn't get here set stage to 6 endif else ;shouldn't get here either set stage to -1 endif end I suspect that the problem lies in one or both of these scripts. This is my first an most urgent problem. Link to comment Share on other sites More sharing options...
269091 Posted June 2, 2009 Author Share Posted June 2, 2009 And here comes the second problem (made a new post for avoiding confusion) Background info: I didn't like the fact that enemies would attck no matter what even if they are alone and don't have any weapons left.So the idea was to use a script to make them surrender based on some conditions and set them to a quasi-mezzed state enabling the chance to take their stuff/ add a collar. Just no "la-la-land effect". This should ocuur mainly on two occasions: First The NPC has no fire weapos left (and is too far from the player for immediate melee) or no weapons at all, but is not flleing andSecond The NPC is flleing already but the Player can catch up to them and then gets a message box to chose if he wants to shout a give up message to the NPC (2 choices: Surrender - 0 and I kill you anyway - 1). Now the question was how to add the script to hostile NPC's around. First I had the idea to use a trigger box with respective script attached and move this trigger to the player by using moveTo. This failed completely - I don't know the reason. Then I thought of adding the script to most important Factions (Talon, Outcast, Brotherhood, Enclave, Slavers and Raider) NPCs.The script attached would be the one for Talon (testwise added to a Talon NPC - its not the same I used for the trigger ides of course) and connected to it, there is a Quest with some dialog options that would run after the self.StartConversation Player, CaPArrestGreeting:01009636 function. When testing the script at a certain state it DID work on occasion - lets say one time of a 20 - and then all was fine, the conversation ran, I could add the collar (and token) via Quest topic. (except that now I reached the point Problem 1 would occur (read post above)). The other 19 times the NPC simply acted like without the script - at least it appeared like that. And here comes the scipt:scn CaPArrestTalonScript short Groupown short GroupPlayer short fleeing short Button ref self float surrenderTimer short stopscript Begin Gamemode set self to GetSelf set Button to GetButtonPressed set surrenderTimer to 3 if stopscript != 1 if self.GetCurrentAIPackage == 5 set GroupOwn to self.GetGroupmemberCount set GroupPlayer to Player.GetGroupmemberCount if GroupOwn <= GroupPlayer if self.GetIsUsedItem CaPArrestWeaponsRanged ;== 0 if self.GetIsUsedItem CaPArrestWeaponsMelee == 1 if self.GetDistance Player > 20 && self.GetDistance Player <= 100 showMessage CaPArrestGiveUp if Button == 0 self.stopcombat player self.addToFaction CaPArrestedFaction 0 self.addScriptPackage CaPArrest02Package set CaPArrestQuest.02PackageRunning to 1 if surrenderTimer > 0 set surrenderTimer to surrenderTimer - getSecondsPassed else self.StartConversation Player, CaPArrestGreeting:01009636 set stopscript to 1 endif endif elseif self.GetDistance Player > 20 self.addScriptPackage CaPFleePackage evp set fleeing to 1 endif elseif self.GetIsUsedItem CaPArrestWeaponsMelee ;== 0 if self.GetDistance Player <= 100 showMessage CaPArrestGiveUp if Button == 0 self.stopcombat player self.addToFaction CaPArrestedFaction 0 self.addScriptPackage CaPArrest02Package set CaPArrestQuest.02PackageRunning to 1 if surrenderTimer > 0 set surrenderTimer to surrenderTimer - getSecondsPassed else self.StartConversation Player, CaPArrestGreeting:01009636 set stopscript to 1 endif endif elseif self.GetDistance Player > 60 self.addScriptPackage CaPFleePackage evp set fleeing to 1 endif endif endif endif elseif self.GetCurrentAIPackage CaPFleePackage == 1 || self.GetCurrentAIPackage == 10 || self.GetCurrentAIProcedure == 16 self.additem headwrap01 1 self.equipitem headwrap01 if self.GetDistance Player < 100 showMessage CaPArrestGiveUp if Button == 0 self.stopcombat player self.addToFaction CaPArrestedFaction 0 self.removeScriptPackage CaPFleePackage self.addScriptPackage CaPArrest02Package set CaPArrestQuest.02PackageRunning to 1 if surrenderTimer > 0 set surrenderTimer to surrenderTimer - getSecondsPassed else self.StartConversation Player, CaPArrestGreeting:01009636 set stopscript to 1 endif endif endif endif endif End I'm sure that it will have mistakes all over the place as I wrote it from scratch - and I don't really seem to be a talented scripter when it comes to think around 37 1/2 corners :wallbash: So to achieve the goal described on top of the post (no matter how - using a corrected version of this script or any other idea/ technique) is my second problem. If there would be no solution I just would forget about the surrender thing - though it would be hard :confused: Link to comment Share on other sites More sharing options...
sesom Posted June 2, 2009 Share Posted June 2, 2009 I didnt go detailed through the scripts, because i know MS13 and "Slaves Stick around" very well. Both are buggy and produce unpleasant side effects. One important lessons i learned with patch 1.5 (but it is also valid for lesser patch versions the bad effects occurs only a little bit later in the gameplay) use for every of your prisoners a exclusive token, dont share the same token with different actors. I am not sure why your game crashes when you enter the cell. Did you try a player.moveto (prisonerreference) to check where they went? If they are not in Arefu or Megaton your script is not the reason. Link to comment Share on other sites More sharing options...
sesom Posted June 2, 2009 Share Posted June 2, 2009 A gemeral tip for scripting complex things. Break the whole script down in tiny tasks and test each of them excessive in game. Link to comment Share on other sites More sharing options...
269091 Posted June 2, 2009 Author Share Posted June 2, 2009 I don't use patch 1.5 as I don't trust t yet - read too many negative stuff about it. Did you try a player.moveto (prisonerreference) to check where they went? If they are not in Arefu or Megaton your script is not the reason Tested it right away with a Talon ref and works perfectly - he was exatly where I wanted him to be - at CaPArriveCellMarkerMegaton. Link to comment Share on other sites More sharing options...
sesom Posted June 2, 2009 Share Posted June 2, 2009 I don't use patch 1.5 as I don't trust t yet - read too many negative stuff about it. Patch 1.5 is a successful update for the game engine and a killer of all ESPs ;) i know. Tested it right away with a Talon ref and works perfectly - he was exatly where I wanted him to be - at CaPArriveCellMarkerMegaton. And did your game crash? If not its not the script. A little warning (has nothing todo with your crash): Most of the Talons are respawners. After 3 gamedays left alone they respawn and loose your token. You end up with a pi..d of and aggressive Talon in your prison ;) . Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.