Server message function/game logic

Server message function/game logic

« posted: Oct 12, 2016, 08:23 PM »
* Ignore this post if you understand a Game logic/ already have a good message script *

This post is going to be more for the new comers to the server community. Anyone who has been here for a few months will have already progressed past this but it was a hurdle for me understanding how ARMA handled game logic

To keep it short here is the code:

Code: [Select]
// File: Chat.sqf
// Author: Wildstingray
//
// execute this file as a third party in the init.sqf in the main directory for the mission
//
// Displays a message to all players without a name or 'globalchat' being shown
// SiG in beginning of each statement is targeting a rabbit (can be anything) placed in eden with the name SiG
//

while {true} do
{

//Message Block 1
sleep 298;
SiG globalChat "[SiG]: Welcome to [SiG] Wasteland";
sleep 1;
SiG globalChat "[SiG]: We are continuing to update and add features";
sleep 1;
SiG globalChat "[SiG]: Enjoy Your Stay!!!";


//Message Block 2
sleep 298;
SiG globalChat "[SiG]: The server restarts every 6 hours";
sleep 1;
SiG globalChat "[SiG]: Times for restart are 6 and 12 AM/PM (EST)";
sleep 1;
SiG globalChat "[SiG]: Check the clock in the lower right for the remaining time until restart";


//Message Block 3
sleep 298;
SiG globalChat "[SiG]: If you find a bug please report it";
sleep 1;
SiG globalChat "[SiG]: Visit the website @ sig.enjin.com";
sleep 1;
SiG globalChat "[SiG]: Join the forums to stay up to date on the latest news and updates";

};

This code uses a spawned object named SiG (should have used lowercase for a variable probably). In this case this is our game logic object.

I thought this would be helpfully for very early beginners, because when I started, i saw references to create some of these to accomplish something but the idiot in me was thinking "There is no way it would be as simple as spawning a object and naming it something obvious."



If you guys have a better script idea for this let me know, i'm still learning what code harms server fps the most and ways to avoid it, I just figured this is such a small one, it can't do much.

Re: Server message function/game logic

« Reply #1 posted: Oct 12, 2016, 08:29 PM »
This is just one of the simple ones I threw out on my server in the past few weeks.

If you think its warranted, I was going to make a post covering editing the extDB .ini file to add a function that calls a custom made table

I used this to make a server-wide gear level with cases, I know mokey has an addon for personal gear level linked to the steam64 ID of each player, so it might not be needed