Giter VIP home page Giter VIP logo

rdr2-simplegangwar's Introduction

RDR 2 SimpleGangWar script

Red Dead Redemption 2 script to create a basic battle between two teams.

Background

This is a port of GTA V SimpleGangWar script. Since most functions and methods are the same between GTA5 and RDR2, and the language used is the same (C#), almost all functionalities were ported to RDR2.

The main differences with the GTA V version are: no armor, no combat movement, no combat range, and not run to spawnpoint (as RDR2 peds seem to fight well on wide range).

Installing

  • Download and extract the required dependencies: ScriptHook RDR2 & ScriptHookRDR2 DotNet, and their dependencies
  • Download & extract SimpleGangWar.cs & SimpleGangWar.ini into Red Dead Redemption 2/scripts folder

Usage

The key F9 ("Hotkey") is used to navigate through all the steps of the script. In-game help popups will describe what to do, but these are the different stages you will find:

  1. The script will ask you to move to where the enemies will spawn
  2. After pressing the hotkey, you must do the same to define where the allies will spawn
  3. Right after defining both spawnpoints, peds from both teams will spawn on their respective spawnpoints, and fight each other
  4. Press the hotkey once to enter the "exit mode" (it will ask for confirmation to stop the battle)
  5. Pressing the hotkey again will inmediately stop the battle and remove all alive & dead peds from the map

An additional hotkey Z ("SpawnHotkey") is used to pause/resume the ped spawning in both teams.

Settings

Settings can be defined on the SimpleGangWar.ini file, being the following:

ALLIED_TEAM & ENEMY_TEAM

All lists of items (models & weapons) are separated by comma (,) or semi-colon (;). Spaces and case ignored.

  • Models: list of ped models (Reference)
  • Weapons: list of ped weapons, each ped receiving one random weapon from the list (Reference) (Optional; if not set, peds on the team will use their in-game default weapons, and no other weapons are given)
  • Health: health for peds on the team (Optional; if not set or zero, health for peds will not be changed)
  • Accuracy: accuracy for peds on the team (Optional; if not set, accuracy for peds will not be changed)
  • CombatMovement: how the peds will move through the battlefield. This can be used to make one team defend its spawnpoint, while the other team tries to attack it - although it may not have a great effect. One of following:
    • none: do not change CombatMovement of team peds (default setting)
    • stationary: not move at all
    • defensive: stay near the spawnpoint and take cover
    • offensive: focus on attacking the enemy team
    • suicidal: more aggresive attack
  • MaxPeds: maximum alive peds on the team (Pseudo-Optional; if not set, the MaxPedsPerTeam setting will be used)

SETTINGS

  • Hotkey: the single hotkey used to iterate over the script stages (Reference)
  • SpawnHotkey: hotkey used to pause/resume ped spawn in both teams (Reference)
  • MaxPedsPerTeam: maximum alive peds on each team (teams with the setting MaxPeds set will ignore this setting)
  • NoWantedLevel: if true, disable wanted level during the battle (true/false)
  • ShowBlipsOnPeds: if true, each spawned ped will have a blip on the map (true/false)
  • DropWeaponOnDead: if false, dead peds won't drop their weapons - they will remain stick to their bodies (true/false)
  • RemoveDeadPeds: if true, mark dead peds as no longer needed, making the game handle their cleanup (true/false)
  • Spawnpoint Flood Limit: there is a system that avoids peds from flooding their spawnpoints. This may happen when the battle starts, and all the maximum allowed peds spawn at once. Many peds spawning at once may lead to bugs and even game crashes. The SpawnpointFloodLimit settings avoids peds spawning when there are a certain amount of peds near their spawnpoint, at a certain distance. The settings involved are:
    • SpawnpointFloodLimitDistance: radius distance from the spawnpoint to sum peds on
    • SpawnpointFloodLimitPeds: if more than this amount of peds are within the Distance set, spawn will be blocked
  • Intervals: SimpleGangWar code runs in a loop, and between loop executions there is a delay. This delay can be configured with the Interval settings, specifying time in ms. The given times are valid, but may be changed to alter the behaviour of the script or to solve certain problems. The higher the delay, the less responsive and slow the mod will work (which may result in slower spawn rate of peds). There are two Interval settings available, depending on the context:
    • IdleInterval: when battle is not
    • BattleInterval: when battle is running

Known bugs

  • The script or game may crash when battle starts. This may be caused by having too many peds spawning at once. The issue may be fixed by decreasing the SpawnpointFloodLimitPeds and/or increasing the BattleInterval.
  • Peds will not fight when spawnpoints are too far away, or in a slope.
  • If using Ped Damage Overhaul, peds might run away when damaged. Also peds injured on the ground will drop weapons infinitely if custom weapons are set for its team.

TODO

  • Avoid spawn-killing
  • Add winning conditions
  • Smooth transition from battle end to cleanup (extra step?)
  • Add menu/more hotkeys to improve UX?
  • Respawn player on ally spawnpoint after dying
  • Organize data, settings, variables - for each teams on the script structurally (struct?)

Changelog

  • 0.3.1
    • Add CombatMovement setting
    • Remove configurable ProcessOtherRelationshipGroups setting
    • Do not change peds health/accuracy if not configured
    • Avoid spawnpoint flooding
  • 0.2.2
    • Fix: remove change on ped MaxHealth, as it might be causing NullPointerException
  • 0.2.1
    • Refactor: parse ped models & weapons from settings on startup, instead of when spawning a ped
    • Fix: force peds to use the weapons defined on settings. Peds on a team with no weapons defined will use the game's default ped weapons.
    • Fix: multiply factor for fighting distance between spawnpoints (might improve the fighting distance of peds)
    • Fix: make blips blink when spawning is paused & set better blip models for spawnpoints
    • Add Github Workflow to create release artifact (zip with the required files only + changelog on Releases page)
  • 0.1.1
    • Fix: avoid allies from attacking player
  • 0.0.2
    • Change default hotkey to F9, and default battle loop interval to 500ms
  • 0.0.1

rdr2-simplegangwar's People

Contributors

david-lor avatar github-actions[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rdr2-simplegangwar's Issues

Peds not fighting when spawnpoints are too far away

Must add again the feature to use the "run to enemy spawnpoint" task, in case the spawnpoints are too far away.

Some players report that neither fight when spawnpoints are in different height levels (like on a mountain or slope).

Problem: peds do not react to enemies while running.

Enemy Spawn Issue

Enemy peds wont spawn after a few successful runs, but friendly peds still do. I redownloaded the mod and scripthook but nothings changed

Peds not receiving weapons from script

It seems like peds spawn with the default weapons given by the game depending on the model, so the single weapon given by the script is not being used by them.

Allied-team peds randomly switching sides

Sometimes*, peds on ally team become enemies and start attacking player (and other allied-team peds?). They cannot be killed by the player as they are still rendered as allies.

Does this happens with peds on the enemy team?
Might this depend on the original relationships of the peds with the player?

*it seems that this only happens when the player shoots very close to an allied ped. The ped reacts to this as an aggression and starts attacking the player, although its relationship with the player is still Respect. Can be fixed by clearing and resetting the ped task.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.