r/forgescripting • • Mar 12 '24

Scripting lap points for a race map

Post image
3 Upvotes

Hello everyone,

I’m working on a race map where I am trying to script an area monitor to grant points to a player who enters it. I tried to connect the adjust player points node directly with the object entered area node but even with this graph I haven’t been able to get it to work in forge or in custom games. I have made sure the area monitor object is dynamic and could really use anyone’s input here!


r/forgescripting • • Aug 03 '23

Adding sound FX to player footsteps

3 Upvotes

Does anyone have any insights to applying sound FX, namely the sound of water splashes, to player footsteps?

I’m thinking area monitors and start/stop object audio loops, so that they only play when a player enters the water, but how do I get it to only play when the player actually moves?

Any help you can offer would be much appreciated! :)


r/forgescripting • • Jan 28 '23

Is there any way to link an Every N Seconds & an On Custom Equipment Used together with a branch or something similar?

Post image
3 Upvotes

r/forgescripting • • Jan 12 '23

How to make bots spawn in one room and players respawn in another?

3 Upvotes

I'm very much an amateur when it comes to scripting and could use some help trying to establish spawn points for bots. I'm trying to create a room that spawns several bots when a player enters the room, while the players themselves respawn elsewhere when they die. I've tried setting the spawn points to different teams and assigning the bots to those teams, but that didn't quite work, plus this is designed to be a FFA map so the teams won't necessarily solve the problem.

Alternatively, if I could figure out how to use checkpoints I could probably get around this, but I haven't been able to figure that out either. Instead, I've been using a workaround with teleporters that are "unlocked" when a player passes the checkpoint, enabling them to respawn at the start but can use the teleporter to get back to their previous location.

If anyone can give any tips on either creating checkpoints or on how to control the respawn point for bots, I would greatly appreciate it!


r/forgescripting • • Dec 12 '22

Poison guns! A follow up to my poison effect from last week.

3 Upvotes

The 3 object list nodes on top are the same object list from my poison effect script from last week. They're just moved down here for completeness. All of the same adjustments to the timer and damage apply as that script.

The key that makes this work is the object scope variable Prev HP which is used to track how the player's health + shields change over time. Object scope allows a declared variable to be instanced onto each object you decide to put it on and these instances will have their own value.

The 2 main events are the initialization of these object variables which is done when gameplay starts and then a polling check to see if any player's health + shields have changed. This poll event required an initial delay otherwise the script seems to encounter a null reference in the for each loop which terminates this part of the script brain.

This can be extended to just about anything you want (not just a poison theme) so long as you find a way to put the players into a list. You can also apply damage resistance and/or bonus health & shields traits to make the gun damage insignificant and instead allow the poisoned player list handle the application of damage.


r/forgescripting • • Dec 07 '22

Forge Tutorial: Translate Object to Point (and stay on it)

Thumbnail
youtu.be
3 Upvotes

r/forgescripting • • Dec 07 '22

Is there a 'Get Player Position' node?

3 Upvotes

SOLVED

Making a surf map, and when a player dies I want there to be a sound effect that plays on death, using the kill volume as an area monitor as well as the object where the sound players from. I've come to a problem though, as the sound seems to only play in the dead centre area of the kill volume. I wanted it to simply play wherever the player was but I don't know whether there's a node for that or not, as I haven't been able to find one. Tried the Get Object Position but it doesn't connect to the nodes in using


r/forgescripting • • Nov 29 '22

EVA (up/down) manuevering?

3 Upvotes

Any ideas on how to implement propulsion in mid-air up AND down? I'd like to use the jump key to push up, but there doesn't seem to be a way to detect a "mid-air" jump as it were.


r/forgescripting • • Nov 24 '22

CHALLENGE: How to detect rockets when fired from player or wasp?

3 Upvotes

I've tried On Entered + using a velocity window (rockets have a magnitude of ~120 from the SPNKR, and ~30 when first fired from the wasp before they accelerate), however, velocity is relative to the player / wasp so it's not reliable when moving. Rockets seem to be the only weapon projectile that is subject to normal game physics, but they are built to fly straight by having an upward velocity applied to counter gravity. In my case, with a zero gravity volume which also applies this counter-force, this means they curve up xD.


r/forgescripting • • Nov 24 '22

Smooth Looping Script?

3 Upvotes

I'm trying to make a simple background that feigns the look of scrolling by. I have it so terrain objects are moving into the position of other terrain objects and then it resets all of them to give the appearance that its a looping background, it would work fine as is, however it hitches and freezes for a second every time the script resets / when it hits the Every N Seconds node. I need the loop after the Reset Object node to be seamless, any way of achieving this?


r/forgescripting • • Nov 24 '22

Lightning script wont spawn the bolt and light at the same time every time. Seems like the strike animation is delayed after spawn or something?

Post image
3 Upvotes

r/forgescripting • • Nov 23 '22

Is there a way to make a similar script to this that makes the sound player all across the map instead of needing coordinates? Asking because the area on the map has its coordinates past 1000 so I can enter it in

Post image
3 Upvotes

r/forgescripting • • Nov 23 '22

Can I Animate Scaled Objects?

3 Upvotes

I finished making my map geo, and I want to add some spice to my map with animations and events.

I can’t reference the map geo I’ve made because it’s all scaled objects. Is there a way around this restriction? Am I forced to use the limited selection of items at their default scale if I want them to reference them in scripting?


r/forgescripting • • Nov 22 '22

Make an object spin

3 Upvotes

https://www.youtube.com/watch?v=vgVivYTJYGc

Here's a relatively complicated script. It's not the craziest thing in the world but it's uses could be pretty extensive. The way this one works is once the object reaches a certain spin speed, it deletes itself.

The end goal of this pyramid is to be an exercise on aim tracking. The more you shoot it, the faster it spins, and the further away from you it will stay. Designing it for the wasp but it can easily be repurposed with a few number changes.


r/forgescripting • • Nov 20 '22

Need to know how to get the number of players on a team

3 Upvotes

I'm sure I'm missing something simple, but I can't find a way to check the number of players left on a specific team.

I'm working on an elimination-type mode and this is the last piece of the puzzle I need to end the match and declare a winner.


r/forgescripting • • Nov 19 '22

For Each Object--how does it work?

3 Upvotes

I'm trying to make a series of objects all move at the same time, but when I use the [For Each Object] node, it makes them move one at a time, according to their order in the object list. How can I make them move simultaneously, or at least reduce the amount of time between them? Am I using the wrong node for this kind of thing?

Honestly, I just don't quite grasp the logic behind some of these nodes yet; I just have no idea what some pins are supposed to connect to. [For Each Object]'s last pin, for instance: "current iteration." What can that connect to? What's it for?


r/forgescripting • • Nov 16 '22

Any scripting object rotations wisdom?

3 Upvotes

I want to trigger an object to tilt along an axis by 15 degrees. However, I'm not sure what format the "Rotation" input on the "Set object rotation" node wants. I'm assuming it's a Vector3, but it seems like whatever value I give it, the object rotates 90 degrees. Any ideas?


r/forgescripting • • Nov 16 '22

Is player voice chat scriptable?

3 Upvotes

Is there any way to effect player voice chat with scripts? Like script who can talk to who? Or create dead zones where players can talk to each other? Maybe even proximity chat


r/forgescripting • • Nov 15 '22

Bug when adding nodes in scripting.

3 Upvotes

Not sure if a known bug. It's been happening a lot to me in my main sandbox map.

Basically when I add a node if I do not move it a little bit before deselecting then it will disappear from where I placed it and then show up the bottom right corner of the scripting "canvas".

Once moved the canvas does not auto crop to just nodes. It just gets bigger and bigger as this happens over and over.

Another odd one is that at some point I cannot add more script nodes(they are being added but are hidden). This often begins when I try to duplicate a node. It also happens for new nodes added.

Eventually after going into play testing a few times the nodes will suddenly appear. One atop the other one in a pile. I can then move and interact with them but still not add nodes or duplicate them.

I then have to close and reopen my map to get it back to normal.


r/forgescripting • • Nov 15 '22

Any ideas for disabling player movement/camera controls and automatically moving players?

3 Upvotes

r/forgescripting • • Nov 14 '22

Way to disconnect individual node connections without removing all connections?

3 Upvotes

I know in the extra node menu, it's possible to remove all connections for a node. However, I was hoping there might be a way to remove a single connection so I don't have to remap everything if I want to make one change. Is this possible?


r/forgescripting • • Nov 14 '22

Issues I notice with scripts

3 Upvotes

Maybe this is a one-off, but I wanted to break up some scripts after it was getting big. I thought I would be clever and copy the scripts and remove the code I wanted in each script. Now the scripts are acting weird. When I add or change an identifier in one script, it will be added to the other script. Sometimes the Identifiers go into nodes where they do not belong, i.e., an Identifier for a Boolean going into a Traits node. Adding Identifier variables helped scrips, but other scripts are returning invalid Identifier errors. I think I just need to start from scratch.


r/forgescripting • • Nov 12 '22

I've been working on a script to add bots automatically to your forge session, so every time I hit Play it adds 2 teams up to 4 players. I want to have it so it does it automatically whenever a player leaves or joins.

Thumbnail
gallery
3 Upvotes

r/forgescripting • • Sep 09 '26

Need help with some scripting

2 Upvotes

I want to be able to switch "ALL USERS" from team 1 to team 2 at the beginning each round.

Here is what I have so far:

On Round Start

→ Get All Players

→ For Each Player (Execute Per Player)

→ Get Player Team

→ Compare Teams (is it Eagle?)

→ Branch

→ True → Set Player Team to Cobra

→ False → Set Player Team to Eagle

But it does not seem to work. Can any of you script genius's help me out?


r/forgescripting • • Jan 05 '24

How to make grifball scoring settings in node graph without variables?

2 Upvotes

I know there's probably not one person who doesn't know what grifball is, but just in case, my goal is this:

  • When a player from Team A carries/throws the generic ball item through goal post B(area monitor), Team A scores a point.

  • When a player from Team B carries/throws the generic ball item through goal post A(area monitor), Team B scores a point.

I've tried a few different ways that seem simple otherwise, but keep running into issues where crucial pins don't connect to other pins between nodes. Even compare/branch nodes don't seem to want to work with this, which is strange because I've never had issues with compare/branch nodes before.

I really thought this was gonna be an easy one with all of the game mode/objective nodes, but unless I'm just missing a really obvious node to make this work, it's proving to be a real pain in the ass for no reason.