Scripting help/advice required for custom slavery mod

gustarballs1983

Vault Fossil
Modder
So as I've mentioned already elsewhere on this forum, I'm looking to make a mod. the mod would resolve around slave script that is by default attached to slaves in random encounters a.k.a ECSlave.int

similar deal as with mega mod use rope on a knocked out slave and take ownership of it. the slaves are planned to follow the layer from map to map and act as meatshields and mules, but are stationary ( don't follow the player around the map ( they act more like car trunk sort of). they should be able to wear standard non powered armors, up to brotherhood/CombatMk2 armors, equipping them with power armor should make them hostile. they should have rope item in both item slots, or else they flee, giving them any sharp object(i.e. knife, combat knife,spear,sharpened spear,throwing knife etc.) into inventory and passing time or traveling should give them a high chance to flee as well ( this would cause the player not to carry junk weapons on the slaves, to prevent flooding vendors with ton of junk items to buyout the cream of the crop), slaves don't participate in combat other than beeing a potential obsticale for bullets between player's char and the enemy.

nyways for now, as i'm just starting the project, i'm planning to achive just joining party when applying two ropes. I plan to add the rest of the features in the future..
does anyone have tips on how to make the script below work?

Code:
/*******************************************************************************
        Name:
        Location:
        Description: Critters template script

            Created: by sFall Script Editor
            Updated:

*******************************************************************************/

/* Include Files */
#include "..\headers\define.h"

#define NAME                    SCRIPT_ECSLAVE

#include "..\headers\command.h"


/* Standard Script Procedures */
procedure start;
procedure critter_p_proc;
procedure pickup_p_proc;
procedure talk_p_proc;
procedure destroy_p_proc;
procedure look_at_p_proc;
procedure description_p_proc;
procedure use_skill_on_p_proc;
procedure damage_p_proc;
procedure map_enter_p_proc;
procedure use_obj_on_p_proc;
procedure push_p_proc;
procedure combat_p_proc;

procedure Node1000; //Main party member node
procedure Node1001; // heal yourself
procedure Node1002; // wait here
procedure Node1004; // follow close
procedure Node1005; // follow medium
procedure Node1006; // follow far
procedure Node1007;
procedure Node1008;
procedure Node1009;
procedure Node1010;

procedure Node1100; // rejoin party

procedure Node001;
procedure Node002;
procedure Node003;


/* Script Specific Procedure Calls */
procedure Node998;                                      // This Node is Always Combat
procedure Node999;                                      // This Node is Always Ending

/* Defines */


/*****************************************************************
   Local Variables which are saved.
   All Local Variables need to be prepended by LVAR_
*****************************************************************/

#define LVAR_Herebefore                 (4)
#define LVAR_Hostile                    (5)
#define LVAR_Personal_Enemy             (6)
#define LVAR_Mel                        (7)
#define LVAR_Used_Rope                  (8)
//Stuff for party member crap
#define LVAR_WAITING                    (9)
#define LVAR_FOLLOW_DISTANCE            (10)
#define LVAR_TEAM                       (11)

#define PARTY_NODE_X Node1000

/*******************************************************************
   Imported variables from the Map scripts. These should only be
   pointers and variables that need not be saved. If a variable
   Needs to be saved, make it a map variable (MVAR_)
*******************************************************************/


/*******************************************************************
   Local variables which do not need to be saved between map changes.
*******************************************************************/
variable Only_Once:=0;

/*******************************************************************
*                           PROCEDURES                             *
*******************************************************************/
procedure start begin
   critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_TEAM_NUM,TEAM_RND_SLAVE);
end

procedure critter_p_proc begin


end

procedure pickup_p_proc begin
   //script_overrides;

end

procedure talk_p_proc begin
   floater(random(100,104));
end

procedure destroy_p_proc begin

end

procedure look_at_p_proc begin
    script_overrides;
    display_msg(mstr(100));
end

procedure description_p_proc begin
    script_overrides;
    display_msg(mstr(101));
end

procedure use_skill_on_p_proc begin

end

procedure damage_p_proc begin

end

procedure map_enter_p_proc begin
   Only_Once:=0;

   party_member_map_enter;
   if obj_pid(self_obj) status_is_in_party(1) then
   critter_add_trait(self_obj, TRAIT_OBJECT, OBJECT_TEAM_NUM, TEAM_PLAYER);
   end else begin
   critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_TEAM_NUM,TEAM_RND_SLAVE)
end

procedure use_obj_on_p_proc begin
   if (obj_pid(obj_being_used_with) == PID_ROPE) then begin
      set_local_var(LVAR_Used_Rope, 1);
      else if (LVAR_Used_Rope) == 1) and if (obj_pid(obj_being_used_with) == PID_ROPE) then begin
      set_local_var(Lvar_Used_Rope, 2);
      call NodeJoin
   end
end

procedure Node998 begin
   set_local_var(LVAR_Hostile,2);
end

procedure Node999 begin
end

procedure NodeJoin begin
   party_add_self;
   call Node999;
end

procedure push_p_proc begin
  
end


as you can see i have little to no knowledge on programming this game, but at leas't I've tried my best to come up with something of my own, based on other party member scripts.

Comstructive feedback, code proposals, and general advices are highly welcome. Please don't lash out on me, i know this code is a mess, that's why i'm here and Yeah I basicaly don't know what I am doing, but trying my best to make it work. any help?
 
That's not easily done. Every party member needs to be predefined and setup correctly as an actual party member. Think of Sulik, Cassidy, Dogmeat, etc... Each of those slaves must be unique for this to work correctly. So basically, your idea already dies here.

There could be a way to workaround this... You could probably somehow track the slaves you have with you in some array, then delete the critters on map exit and spawn new critters on map enter. However, this will mean status effects such as hitpoints aren't saved either, and if inventory comes on top of that, it's getting really complicated. Would require a little more advanced scripting knowledge, and I have no idea how prone to errors such a system would be.
 
Back
Top