Home   Help Search Login Register  

Author Topic: Send different text to the players?  (Read 2174 times)

0 Members and 1 Guest are viewing this topic.

TheCaptn

  • Guest
Send different text to the players?
« on: 24 Jan 2005, 15:55:22 »
I'm working on a small three player mission with a running narrative and I'd like to be able to send the players different text messages when certain triggers go off... So that each of the players gets a different perspective on the events.

Any idea how I can pull this off?

Also, while I'm here there's another thing I'm struggling with and that's keeping the players contained within certain areas (think: invisible border around a small town, preventing them from leaving till a particular trigger turns true).
« Last Edit: 24 Jan 2005, 15:56:22 by TheCaptn »

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re:Send different text to the players?
« Reply #1 on: 24 Jan 2005, 16:32:12 »
sideChat and similar functions might solve your textproblem (depending on the specs of your MP mission). They let you display text messages to people in the same group/side/vehicle/etc

To physically prevent a player from moving is, as far as I understand, impossible (unless you execute the code "disableuserInput" locally one machine only). *** DONT TRY UNLESS YOU ARE FAMILIAR WITH THE COMMAND ***

If you look at any tutorial for making capture the flag missions you will find guidelines for restricting certain areas to players (usually by killing or wounding them). These effects can easily be toggled on and off.
OFPEC | Intel Depot
RETARDED Ooops... Retired!

TheCaptn

  • Guest
Re:Send different text to the players?
« Reply #2 on: 24 Jan 2005, 16:53:47 »
sideChat and similar functions might solve your textproblem (depending on the specs of your MP mission). They let you display text messages to people in the same group/side/vehicle/etc

The players are all on the same side (civilian), but each of them is their own group.

I would have preferred the large, centered text like you get with a text effect but I'll keep this in mind in case I can't get it to work that way.

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re:Send different text to the players?
« Reply #3 on: 24 Jan 2005, 17:19:22 »
Don't hold me responsible for the syntax  ;D but:

group unitName == group groupName

can be used to check if a unit is member of a certain group. Make a script that runs locally on every machine and checks if the player is member of groupOne, groupTwo, groupThree (or whatever you call your groups). Then display a different message on every machine.
OFPEC | Intel Depot
RETARDED Ooops... Retired!

TheCaptn

  • Guest
Re:Send different text to the players?
« Reply #4 on: 24 Jan 2005, 17:49:47 »
Forgive the noobish question, but how do I know if a script is running locally or on the server?

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re:Send different text to the players?
« Reply #5 on: 24 Jan 2005, 19:51:27 »
In the beginning of the script you can write:

?!(local server) : exit

That stops all clients from running the script. If you are not the local server the script will not run on your computer. Or you can write:

?!(local client) : exit

To prevent the server from running the script (syntax not guaranteed). But I'm not sure what happens if the server host in a LAN-game (and hence a player). You have to ask one of the experts about that one. Macguba and General Barron are usually very helpful. Try writing them an PM on the subject. Good luck.
OFPEC | Intel Depot
RETARDED Ooops... Retired!

TheCaptn

  • Guest
Re:Send different text to the players?
« Reply #6 on: 25 Jan 2005, 13:35:33 »
If you look at any tutorial for making capture the flag missions you will find guidelines for restricting certain areas to players (usually by killing or wounding them). These effects can easily be toggled on and off.

I couldn't find a tutorial that specific (it's a shame you can't search with wildcards), but I did find out about the setDammage command and I thought maybe I could use that.
I'm obviously doing something wrong though because it's not working.

I have the player named 'player1' and a trigger grouped to it.
The trigger is set up like:
Repeatedly | Any Group member | Not Present | Timeout | 3/3/3 | None (tried Switch, makes no difference)
Condition: this
OnActivation: player1 setDammage (getDammage player1 +0.1)

When the player leaves the area though he doesn't take any damage.
(The idea is that he takes damage every 3 seconds until he dies after 30 seconds, or until he reenters the assigned area.)
« Last Edit: 25 Jan 2005, 13:40:23 by TheCaptn »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Send different text to the players?
« Reply #7 on: 25 Jan 2005, 14:05:45 »
Quote
Macguba and General Barron are usually very helpful. Try writing them an PM on the subject

I can't speak for GB but please don't send me IMs with editing questions.    If I see a question that I can answer, I will.    I get quite a few IMs on editing questions and as a rule I don't know the answer.     Keeping stuff in the forums means that everybody can see both question and answer - a typical thread helps many more people than just the original questioner.

I've never made a MP mission and I don't know much about it except that you must read snYpir's OFPEC Guide:  MP missions before doing anything else.

I really don't like Death triggers.   (They do come up on the forum from time to time, use the search function.)     In general they are just bad mission design.     If you, the mission designer, don't want the player to leave a certain area then use your imagination and mission design skills to make him stay.    As a rule, leaving the mission area is its own punishment:  you're wandering around the island with nothing going on.

If you want to ensure that the mission functions correctly, for example if it is important that the players go to point A, pointB and pointC in that order, then use triggers and variables to control what happens.    If they go to the wrong place then the expected outcome just doesn't happen, or another outcome happens.

Triggers set to repeatedly do not fire continually.    They fire once then wait for the condition not to be satisfied.    Only once they have been deactivated can they fire again.
« Last Edit: 25 Jan 2005, 14:08:15 by macguba »
Plenty of reviewed ArmA missions for you to play

TheCaptn

  • Guest
Re:Send different text to the players?
« Reply #8 on: 25 Jan 2005, 15:10:35 »
I can't speak for GB but please don't send me IMs with editing questions....
I didn't, and I wouldn't have. Like you said, I figured the forum would provide my answers if I was just patient enough...

Quote
I really don't like Death triggers.   (They do come up on the forum from time to time, use the search function.)     In general they are just bad mission design.     If you, the mission designer, don't want the player to leave a certain area then use your imagination and mission design skills to make him stay.    As a rule, leaving the mission area is its own punishment:  you're wandering around the island with nothing going on.

If you have any suggestions I'm happy to listen... In my case I have a three players that need to remain unarmed in the beginning... There are a few weapons for them at a location which is an 80 second return trip, but they're not supposed to know that until a few minutes in.
The problem I have is that once they know where the weapons are (having played it through) there's nothing stopping them from just running there and grabbing them right from the start.
At which point they'd be able to come back and shoot other characters who are responsible for triggering certain events.

[edit]
I understand your reservations about some sort of death-zone. I'm not particularly keen on the idea either... But I figure a 30 second damage period and some text on the screen like "I should probably hang around in town for now." would be enough to give players the hint that they need to stay in that general area for a while...
« Last Edit: 25 Jan 2005, 15:15:39 by TheCaptn »

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re:Send different text to the players?
« Reply #9 on: 25 Jan 2005, 18:42:47 »
Two possible solutions:

1)Place the weapons far far away.  Pick a few different  locations where the weapons could be. Place empty markers on them.  Then randomly select one of the markers in-game and SetPos the weapons there. The players will not know where exactly to go until you tell them.

2)Place the weapons far far away. Force the players to complete an objective in-town,  after which you SetPos the weapons to the desired location, which you have marked with an empty marker.
urp!

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re:Send different text to the players?
« Reply #10 on: 25 Jan 2005, 20:31:50 »
As for sending text to individual players:

If the TitleText command behaves the way everything else does in OpFl, you must call the command on every machine for everyone to see it.

For one player to see it just make sure you are calling it only on that player's machine.  Something like:

Code: [Select]
If (_man == Player) Then {Titletext [Format ["You are an ass, %1",Name _man], "PLAIN"]}
where the variable _man is  the person you want to see the message, ought to do the trick.  If you are using a trigger you could put:

 
Code: [Select]
{If (_x == Player ) Then {Titletext [Format ["You are an ass, %1",Name _man], "PLAIN"]}} ForEach thislist
In the trigger's On Activation, and the message would only be displayed to those activating the trigger.
« Last Edit: 25 Jan 2005, 20:33:06 by Mr.Peanut »
urp!

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:Send different text to the players?
« Reply #11 on: 26 Jan 2005, 02:58:33 »
couple other solutions

3)Repel the player(s) from the ammocrate with a script until they've completed their cbjective(s). You could make this subtle or obvious.

Code: [Select]
;repel.sqs
?!(local Server):exit
_MyUnits = this select 0
;an array of the units
_MyDist = this select 1
;maximum closeness to the ammocrate
_object = this select 2
;your object
_currentunit = 0
_repel = false;

#loop
~0.1
"call{if(_x distance _object<_MyDist) then {_currentunit = _x;_repel = true;};}" foreach MyUnits
?_repel:goto"repel"
goto "loop"
#repel
_repel = false
?"man" counttype [_currentunit] != 1:goto "loop"
;dont repel cars etc
_dx = (getpos _currentunit select 0) - (getpos _object select 0)
_dy = (getpos _currentunit select 1) - (getpos _object select 1)
_posx = getpos _currentunit select 0
_posy = getpos _currentunit select 1
_length = (_dx^2 + _dy^2)^0.5
_currentunit setpos [_posx + _MyDist/_length*_dx,_posy + _MyDist/_length*_dy,0]
goto "loop"
Not sure how this would work if they all rushed the ammocrate, but...
No time to check this, hope it works off the bat, but these things never do ;D

4) Empty the ammocrates then fill them once the player(s) finish their objective. Although this would be fairly blatant.