Members | Sign In
All Forums > Mission Scripting
avatar

Problem with command: Show incomming text message

posted Apr 28, 2013 07:37:23 by JohanEriksson
Hi, I hope this isn´t a doubble-post.
I´ve tried to use the command "Show incomming text message", and the message is shown in the Comms-console, but the problem is that the message is spammed indefinetly.
I don´t understand why, no problem with other missions, only the ones I make myself. Any suggestions?
page   1
3 replies
avatar
Charlie said Apr 28, 2013 08:20:53
name your variable and set "variable" = 0 as condition, then set that variable to "variable" = 1 as an action. This is how it starts. Creating missions is rather rewarding. Good luck and enjoy!
avatar
lucas99801 said Apr 28, 2013 14:04:59
Chas listed one of many methods to fix the issue. For an explanation what is happening is that every time the conditions in your event block occur the event is triggered. So if your conditions remain true indefinitely the message (or any actions) will occur indefinitely.

When programming missions I normally use Chas' method but set my variables up I. The start block tto be used later, or just use a storyline variable that increases by one every time an event happens.

Example:

<start>
Storyline=0
</start>
<event 1>
If storyline=0
-----------
Show incoming text message "Deathstar inbound. ETA 6 seconds"
set variable storyline to 1
Set timer deathstar to 6 seconds
</event>
<event>
if storyline = 1
If timer has finished "deathstar"
---------
Spawn enemy at _______ with name Deathstar_______ and hullID 1500
Set variable storyline to 2
<event>

Hopefully this isnt too much fluff for an explanation, but in the example above the storyline variable adjustment assures every event only occurs once, and also gives you something to follow for debugging. Btw, some semi-common knowledge: press F7 on the server during a mission to see timer values and variable values for debugging!
Hosting a Mumble (Murmur) server @ tsnfenrir.no-ip.org
Having trouble connecting to the TeamSpeak channel: http://tsnfenrir.no-ip.org/ts3
Helm Script for Numerical heading input: https://dl.dropbox.com/u/10193809/ArtemisHelmFSW.zip
Twitter: @lucas99801
Facebook: /lucastarnold
avatar
JohanEriksson said Apr 28, 2013 15:24:17
Thanks alot, both of you! :)
Not only did you solve my initial problem, you also help me understand the whole variable-thing :)
I was wondering how that worked, and a whole new world of possibilities has just opened up. Thanks! :D
Login below to reply: