header general

[UPDATE] Allied Marines Pack (2022 Update)

  • inkoalawetrust
  • inkoalawetrust's Avatar
  • Moderator
  • Moderator
More
2 years 4 months ago - 2 years 4 months ago #21 by inkoalawetrust
Replied by inkoalawetrust on topic [UPDATE] Allied Marines Pack (2022 Update)
Like I said, the Used() override goes in the base marine class, inside the Class{} block. As for projectiles, you just need to give all the projectiles a species that's the same as the base marine class, then give them the MTHRUSPECIES and DONTHARMSPECIES flags. If the species that all the projectiles and the base marine class (And by extension all the other marines inheriting from it.) use is the same, then the projectiles will go through the marines and also never harm them. Just like the hitscans that fire a puff that shares the same species as the marine and uses MTHRUSPECIES.
Last edit: 2 years 4 months ago by inkoalawetrust.

Please Log in or Create an account to join the conversation.

  • DBJ87
  • DBJ87's Avatar Topic Author
  • Wicked
  • Wicked
More
2 years 4 months ago - 2 years 4 months ago #22 by DBJ87
Replied by DBJ87 on topic [UPDATE] Allied Marines Pack (2022 Update)
Thank you. Apologies for any confusion in earlier replies.

*Update*
Added Script where you've said to. When testing GZDoom is crashing with an error that:
Script error, "Ally Marines Pack.PK3:zscript" line 34: Unknown identifier 'bDontFollowPlayers'

Script set up for base player below
[code]//Friendly Fire reduction for hitscan attacks. Script by inkoalawetrust
Class AllyMarinePuff : BulletPuff
{
    Default
    {
        Decal "BulletChip";
        +MThruSpecies;
        +PuffGetsOwner;
    }
    Override Void BeginPlay ()
    {
        Super.BeginPlay();
        
        If (Target)
            Species = Target.Species; //Get your shooters' species to allow the hitscans of the marines to go through other marines.
    }
}

//In ZScript you start with "Class" instead of "Actor", and actors need to explicitly inherit from the base Actor class.
Class AllyMarine : Actor
{
    //Follow/Wait Script by inkoalawetrust
    //This function is called by actors any time a player presses the use key on them
    Override Bool Used (Actor User)
    {
        Super.Used (User); //Run any of the other code inside the base Actor class first.
        
        //Only run the code if the player that used the marine is friendly to him. (Useful for deathmatch, where friendly monsters can work for different players.)
        If (IsFriend (User))
        {
            //The marine isn't set to not follow players already.
            If (!bDontFollowPlayers)
            {
                bDontFollowPlayers = True; //So make him stop following the player.
                A_StartSound ("Ally/Confirm"); //Can also play a sound cue or something if you want.
                Return True; //Marine was used.
            }
            //If the marine already isn't following the player anymore.
            Else
            {
                bDontFollowPlayers = False; //So make him start following the player again.
                A_StartSound ("Ally/Confirm");
                Return True; //Marine was used.
            }
        }
    Return False;
    }
    //The actors' properties and flags have to be put inside a Default{} block, similar to how states are put in a States{} block.
    Default
    {
        //Actor properties need to have semicolons at the end.
        Health 200;
        GibHealth -50; //-35 orignal submission Default. -200 Vanilla Doom Default
        Radius 20;
        Height 56;
        Mass 100;
        SeeSound "Ally/Site";
        PainSound "Ally/Pain";
        DeathSound "Ally/Death";
        ActiveSound "Ally/Active";
        MaxTargetRange 2048;
        MaxStepHeight 32;
        MaxDropoffHeight 64;
        //Default speeds & pain chance for majority
        Speed 10;
        FastSpeed 12;
        PainChance 128;
        Species "AllyMarine";
        MONSTER;
        //Default Flags for majority
        +BOSS
        +FLOORCLIP
        +FRIENDLY
        +AVOIDMELEE
        +MISSILEMORE
        +QUICKTORETALIATE
        +SLIDESONWALLS
        +CANPUSHWALLS
        +CANUSEWALLS
        +JUMPDOWN
        +NODROPOFF
        +PUSHABLE
        +NOBLOCKMONST
        +LOOKALLAROUND
        +DONTHARMSPECIES
        //Help stop friendly fire between Ally Marines. This does also stop allies killing raised allies (example an Archvile's raised marine won't hurt or be hurt by Ally marines)
        -COUNTKILL
        //Optional Flags that I'm leaving you to decide whether to use them
        //+NOTAUTOAIMED
        //+NOTIMEFREEZE
        //+NOFEAR
    }
    States
    {
        //All state frames in ZScript need to have semicolons, even ones that don't contain anonymous functions.
        Crush:
            TNT1 A 0 A_XScream();
            POL5 R -1;
            Loop;
    }
}
[/code]
Last edit: 2 years 4 months ago by DBJ87.

Please Log in or Create an account to join the conversation.

  • inkoalawetrust
  • inkoalawetrust's Avatar
  • Moderator
  • Moderator
More
2 years 4 months ago - 2 years 4 months ago #23 by inkoalawetrust
Replied by inkoalawetrust on topic [UPDATE] Allied Marines Pack (2022 Update)
The reason you are getting that error is because you are not on the latest version of GZDoom where the flag was added. So you need to update up to at least GZDoom 4.8.0, and also add 'Version "4.8.0"' without the single quotes at the top of the file, so that the mod will display an out of date error if someone on an old GZDoom version tries to run it.
Last edit: 2 years 4 months ago by inkoalawetrust.

Please Log in or Create an account to join the conversation.

  • Gothic
  • Gothic's Avatar
  • Moderator
  • Moderator
More
1 year 8 months ago #24 by Gothic
Replied by Gothic on topic [UPDATE] Allied Marines Pack (2022 Update)
What's the status on this? The download link in the OP is down.

Please Log in or Create an account to join the conversation.

  • Gothic
  • Gothic's Avatar
  • Moderator
  • Moderator
More
1 year 1 month ago #25 by Gothic
Replied by Gothic on topic [UPDATE] Allied Marines Pack (2022 Update)
Closing this due to inactivity

Please Log in or Create an account to join the conversation.