Point message fix for multiplayer: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 14: Line 14:
#In the default base.fgd I have, the point_message entity is located at line 2418. If you cannot find it, use the search utility of your text editor to find point_message.
#In the default base.fgd I have, the point_message entity is located at line 2418. If you cannot find it, use the search utility of your text editor to find point_message.
It should look like this:
It should look like this:
<code>  
<source lang=cpp>
@PointClass base(Targetname, Parentname) size(-8 -8 -8, 8 8 8) = point_message :  
@PointClass base(Targetname, Parentname) size(-8 -8 -8, 8 8 8) = point_message :  
"An entity that displays a text message in the world, at its origin."
"An entity that displays a text message in the world, at its origin."
Line 35: Line 35:
input Disable(void) : "Stop displaying the message text."
input Disable(void) : "Stop displaying the message text."
]
]
</code>
</source>

Revision as of 10:09, 23 August 2019

This guide will show you how to change the point_message entity in a Source SDK 2013, to work for multiple players.

Prerequisites

If you want to understand what is going on, then I suggest you know the following. However, you can always just copy and paste the code if you want.

- A decent understanding of C++.
- A simple understanding of how network entities work in the Source engine.

With that out of the way, lets get started!

Modifying the base.fgd file

In order for some code to work later, we need to add an origin to the point_message entity. If we do not do this, the text will always be on the ground. If you are not using your own custom base.fgd file, you can find the default one in steamapps/common/Source SDK Base 2013 Multiplayer/bin.

  1. Open the base.fgd file with your text editor of choice, I am using notepad++.
  2. In the default base.fgd I have, the point_message entity is located at line 2418. If you cannot find it, use the search utility of your text editor to find point_message.

It should look like this:

@PointClass base(Targetname, Parentname) size(-8 -8 -8, 8 8 8) = point_message : 
	"An entity that displays a text message in the world, at its origin."
[
	spawnflags(flags) =
	[
		1: "Start Disabled" : 0
	]

	message(string) : "Entity Message"
	radius(integer) : "Show message radius" : 128 : "Distance the player must be within to see this message."
	developeronly(choices) : "Developer Only?" : 0 : "If set, this message will only be visible when developer mode is on." =
	[
		0 : "No"
		1 : "Yes"
	]

	// Inputs
	input Enable(void) : "Start displaying the message text, if the player is within the message radius."
	input Disable(void) : "Stop displaying the message text."
]