Editing
Games:Halo 5: Guardians/Forge/Scripting/5. Scripting Gameplay Elements
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Scripting Inventory Objects: Weapons, Grenades== You can use scripts to add labels and change the spawn order of weapons that players spawn with. When a player is holding a weapon, that weapons Team property is automatically changed to the team that player is on, and the weapon can be filtered using Action mods (Team[include]/[exclude] etc). When you pick up a map weapon that is part of a group, just the weapon becomes part of the player inventory (it gets detached from a group). This is why "Inventory" could be a potential column for the Scripting Options Sheet. It would include items that disappear and reappear when used by the player, but the objects are different representations (part of the player animations instead of free objects). For weapons, the game doesn't erase its internal object and scripts still apply to it unless another copy gets respawned & then the new one inherits the scripts. The (Destroyed) condition doesn't fire when the player picks it up, though it does trigger if all its ammo gets picked up. Grenades, on the other hand, do immediately trigger (Destroyed) when picked up. The programming is a bit different possibly due to player inventories being able to have multiple grenades of the same type. It's much simpler to represent grenade inventory with an integer variable for each type of grenade rather than have a container that holds multiple grenade objects. When a player dies and drops their grenades, they are new copies of the grenades they picked up and will not have any scripting that was added to the original grenades. ===Despawning Held Weapons=== The last update disabled despawning weapons held by players, so here's a workaround: Spawn 2 items, preferably invisible/collisionless. Weld them together. Select the 2 items you just welded and the weapon you wish to force-despawn. Tap up on the D-pad (or G on PC). This adds the weapon to the welded group. Make sure one of the 2 original welded items is set as the parent. When a player is holding the weapon, you can remove it by despawning the parent object. ===Notes, Observations, Suggestions=== Vehicles or turrets might not qualify as "inventory" items since they can't disappear into the player inventory. Maybe those plus inventory items would qualify as "Possessions" or something. Not sure what would happen to a turret that's in a welded group that gets picked up. For fixed turrets, there's the stand and the weapon so it's much like it's already a weapon welded to a stand object. Would objects welded to one would be stuck to the stand? Does a detached turret act just like a normal weapon except we can't swap it into our inventories? Weapons that are welded to a group (not the parent) can be picked up and moved around by the player. When dropped, they are added back to the group at the location where dropped. (Do we need to verify this?) Inventory "Keys" It might be possible to use individual weapons as some kind of "key" that can be added to a player's inventory and carried around and used to unlock something. Weapons that instantly deal large damage could be used on an object with big health and (Health) scripts that can tell the difference between large and small damage. A Gungoose can be driven right up against a destructible and fired to damage both the goose and destructible at the same time.
Summary:
Please note that all contributions to [DEV] Forgehub Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
DEV Forgehub Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Games
Discussion
English
Views
Read
Edit
View history
More
Search
Games:
Halo 2: Anniversary
Forge
Guides & Tutorials
Frame Rate
Static Weapon Timers
Scripting
Sandbox
Vehicles
Weapons
Halo 3
Forge
Forge Canvases
UI & Controls
Spawning
Match Making
Official Maps
Community Maps
Sandbox
Weapons
Equipment
Vehicles
Halo 4
Forge
Forge Canvases
Lighting
UI & Controls
Spawning
Matchmaking
Official Maps
Community Maps
Sandbox
Game Modes
Weapons
Armor Abilities
Vehicles
Ensuring Level & Game Mode Compatibility
Halo 5: Guardians
Forge
Audio
FX Objects
Forge Canvases
Lighting
Scripting
1. Conditions
2. Actions
3. Mod Selection Filters
4. 'Numbers'
5. Scripting Gameplay Elements
6. Resources for Scripters
7. Video Tutorials
UI & Controls
Spawning
Matchmaking
Official Maps
Community Maps
Action Sack
Big Team Battle
Breakout
Community Doubles
Community Slayer
Extermination
Ghost in the Shell
Grifball
Halo 1 Anniversary Throwback Playlist
Halo 3 Classic Throwback
Halo Championship Series (HCS)
Head to Head
Husky Raid
Infection
Mythic Arena
ODST Slayer
Roaming King
Social Slayer
Sandbox
Weapons
Spartan Abilities
Vehicles
Halo: Infinite
Forge
Audio
FX Objects
Forge Canvases
Lighting
Scripting
UI & Controls
Spawning
Matchmaking
Official Maps
Community Maps
Sandbox
Game Modes
Weapons
Equipment
Vehicles
Custom Game Editor Options
Halo: Reach
Forge
Forge Canvases
Object Tagging
Tagging Chart
Unorthodox Tagging
UI & Controls
Spawning
Sandbox
Game Modes
Weapons
Armor Abilities
Vehicles
Visual Aides for each Game Mode
ForgeHub:
Game & Level Design
Level Design
Multiplayer Level Design Fundamentals
Games
Support
Getting Help
Wiki Index
Tools
What links here
Related changes
Special pages
Page information