OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Xai on 01 Jun 2006, 00:16:04
-
Okay. So I'm glad to see the site's back up and breathing! Been using it for quite a long time now. So yeah, hello again everyone! :)
Well, I went over a friend's with my PC a few months ago and we played some LAN. Just the two of us. And it was great fun. Being the flashpoint devotee I am, I managed to get him to play some missions I'd made. And it was great! So I started make loads more, there and then, and playing them as we went. Silly ones, serious ones, etc. But all of them pretty poorly made, considering we wanted to get playing.
One of these was a duelling mission. Two Civillians, armed with revolvers, duking it out in a desert valley on Nogova. One starting at either end, using rocks and the sparse trees for cover. It was great fun! Problem was, there was no scoring, no respawn, no point counting. Nothing like that. Once one of us died, we'd restart and do it again. Repeat until bored.
Well, I've downloaded a couple of reference guides, but I really can't figure how to script point counting. I'd ideally like a little count of each player's kills. Perhaps coming up at the end of each 'round' (i.e: when one of us dies) and then for the dead player to respawn and both players to be reset to the starting positions. Mabye having a kill limit for the game to end. For instance, first to 10 kills.
Anyone able to give me some tips on the various aspects of coding this? I have quite a lot of OFP coding experience. But never anything to do with MP issues like point scoring and respawning.
-
Hi,
Dunno if it will be complete but you'll get the idea;
First of all have an east and a west soldier named e1 & w1;
Have 2 respawnmarkers (you'll respawn there) named respawn_east & respawn_west
Make a description.ext file with the following in it:
description.ext
respawn=3
respawndelay=10
titleParam1 = "Score to win:";
valuesParam1[] = {10000, 5, 7, 10, 15, 20, 25, 30};
defValueParam1 = 5;
textsParam1[] = {"Unlimited", 5, 7, 10, 15, 20, 25, 30};
Then make some triggers:
this one set to true:
expCond="true";
expActiv="WScore=0; EScore=0;
text=EastScoreWins;
expCond=((Param1 < 10000 and (EScore >= Param1));
expActiv="EastWin=1; PublicVariable ""EastWin""; titletext [format ["Game Over--Soviets Win!\nSCORE: NATO %1 <> Soviets %2", WScore, EScore], "Plain"];
text=WestScoreWins;
expCond=((Param1 < 10000 and (WScore >= Param1));
expActiv=WestWin=1; PublicVariable "WestWin"; titletext [format ["Game Over--NATO Wins!\nSCORE: NATO %1 <> Soviets %2", WScore, EScore], "Plain"];
repeating=1;
expCond= !(alive e1)
expActiv=WScore = Wscore + 1
repeating=1;
expCond= !(alive w1)
expActiv=EScore = Escore + 1
Ending triggers:
timeoutMin=5
timeoutMid=5
timeoutMax=5
type=End1
text=West Won
expCond= WestWin==1
expActiv= forceend;
timeoutMin=5
timeoutMid=5
timeoutMax=5
type=End2
text=West Won
expCond= EastWin==1
expActiv= forceend;
Hope that will do!
Greetz 8)
-
Maybe this is better for you:
text=EastScoreWins;
expCond=((Param1 < 10000 and (EScore >= Param1));
expActiv="EastWin=1; PublicVariable ""EastWin""; titletext [format ["Game Over-- %4 Wins!\nSCORE: %3 %1 <> %4 %2", WScore, EScore, name w1, name e1], "Plain"];
text=WestScoreWins;
expCond=((Param1 < 10000 and (WScore >= Param1));
expActiv=WestWin=1; PublicVariable "WestWin"; titletext [format ["Game Over-- %3 Wins!\nSCORE: %3 %1 <> %4 %2", WScore, EScore, name w1, name e1], "Plain"];
-
Thanks, I'll try them both out and get back to you :)
-
Righto, havn't had a chance to get back to you until now! I'm just having a little trouble :-X
For the first idea you posted, what actually goes where? I mean, you make the description file, as you said (incidently, does it actually need 'description.ext' at the top of the document?) and that goes in the mission folder, obviously. But where you've said to 'make some triggers'. Do you mean in-editor triggers? Or is that the text that will go in scipt files activated by triggers?
Sorry :-[ I got a bit confused!
-
NP Xai;
You open up notepad orso, then copy/paste this:
respawn=3
respawndelay=10
titleParam1 = "Score to win:";
valuesParam1[] = {10000, 5, 7, 10, 15, 20, 25, 30};
defValueParam1 = 5;
textsParam1[] = {"Unlimited", 5, 7, 10, 15, 20, 25, 30};
Save as: description.ext (so don't save it to txt format!) and put it in ur mission folder.
This will give you respawn after 10 seconds you died at the respawnmarkers you should make.
It also gives you the option to choose the score to win in the lobby.
As for the triggers, you make them in the editor;
"expCond" is the same as "Condition" you see at the bottom when creating a trigger.
"expActiv" same as "On activation"
"repeating=1;" means you have to put the trigger to repeat
so an example so you wont get confused ;)
repeating=1;
expCond= !(alive e1)
expActiv=WScore = Wscore + 1
means:
Set the trigger to repeat,
In the condition field type: !(alive e1)
In "on activation field" type: WScore = WScore + 1
Have fun :)