Jump to content

Expanding On JC's: Event Txt Variables


Neeknog

Recommended Posts

Jc gave us the list of event text variables so I figured I would make a quick tutorial for newcomers who may not be familiar with the event system.

 

So what we are going to make is a player login chat-box clone from eclipse and other mirage engines. When the player logins it will greet the player, alert the rest of the online players that this person has logged in and display a message of the day.

 

So lets get started!

 

As of Intersect 1.7 Alpha you can use the following variables in event commands that display text. (Show Text/Show Options/Add Chatbox Text)

 

  • \pn  -- shows the players name that triggered the event
  • \en -- shows the name of the event that is activated
  • \onlinecount -- shows the number of players that are online
  • \onlinelist -- lists all the players that are online

 

To simulate the old chat boxes on login we must create a common event. Common events handle triggers like "On Login" and "On Level Up".

In the intersect editor open up the common events editor:

2_zpsyduwcl7a.png

 

Now you will see a long panel appear, Select "New" to create a new common event.

3_zpsl3wf7wrk.png

 

The first event we will create is the message that displays to all players that you have logged in. So you can name this event PlayerLogin or something similar. Right click in the "Commands" section of the editor and select insert:

4_zpsqsqhlnjf.png

 

This is where we will tell the common event what to do and when to do it. So since this is all chat box based events, select the "Add Chat-box Text" command located under the Dialog section.

 

5_zpsanbhj2jy.png

 

So first and for most lets edit the trigger. At the top of this editor there is a drop down menu called "Trigger" lets set this to Login. This means that whenever a player logs in this event will run. So When the player logs in it will activate the player login and Show everyone that a new player logged into your game. Ok, so now we will grab an event txt variable  from the top of this post called \pn (displays the players name) and add a little message with it. I put "\pn has logged into Pestilence Online", simple but to the point. I set the color to green, feel free to use any color you like. Now we will set the Channel to global. This means that everyone in the game world will see this message displayed in their chat-box when a player logs in. Setting the channel to player means only the player who triggered the event would see it, and local means the players on the same map or close to you will see the event.

7_zpshasjk7fd.png

 

Next we will create a motd text display. Lets go back to the common event editor and create a new event. Once you create the event insert a command like before and add in another chat-box text command:

5_zpsanbhj2jy.png

 

This one will be easy, Your basically just adding in a message. The trigger for this event will be on Login. Type in your message select your color and Player for your Channel. The reason we chose player is so that only the person logging in will see the motd. If set to global, every time a player logged into your game all current players would be spammed with the motd whenever someone new logged in. You can use the motd to display weekly events, exp boosts, news or whatever you would like.

motd_zpsw7wrv3ji.png

 

Ok that's done, now lets create an event that displays a congrats message upon player level up. Create a new common event but this time select "Level Up" as the trigger:

lvlup_zps1ceyvoaq.png

 

 

So lets create a Chat -box text command like we have done before by right clicking the command area, selecting insert and choosing chat-box text. We will use the \pn variable again to display the players name. I made a simple message "\pn Has Gained A Level!" I selected the color yellow and chose Local for my channel. This will allow players close to the player who just leveled up to be notified as well. But it will not send the message to everyone in the game world.

 

lvllll_zpsr41pcrya.png

 

.Lastly We will create a welcome message for players when the logged in. We did create a notification before that showed all players in the game world when a new player logged in. This will be a personal message to the player who logs in, greeting them and letting them know how many players are currently playing the game.

So create a new common event, and a chat-box text command. The trigger for this event will be "Login", I chose the color yellow and selected player as the channel because this is a personal message to the player. We will be using the \onlinecount command for this message. My message read: "Welcome to Pestilence Online! There are currently \onlinecount users playing Pestilence Online!."

tututtu_zpsdfpsulas.png

That was easy right? The final product should look something like this:

chat_zps6k95t3qu.png

 

Well that's all for the tutorial, I did not cover the \onlinelist command because I thought it would be obnoxious to display all current players names in the chat-box. But you could make a bulletin board in a city in your game or something. When a player walks over to it and uses the action button it could display everyone's names. There are lots you guys can do with this stuff!

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...