OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Rocko Bonaparte on 04 Oct 2004, 07:54:48
-
I'm looking at some existing CTF missions in order to figure out the basic components when scripting a CTF mission. For now, I'm trying to just capture a flag and return it. I have my flags in place, and I can get them, but:
1. There is no notifcation that I captured a flag.
2. Bringing the flag to my base at the given coordinates doesn't cause a score.
There are some tutorials in the vein of CTF, but they seem to only be for one-side CTF -- one team has a flag that has to be captured but the other doesn't.
So first off, what might I be missing?
class Sensors
{
items=5;
class Item0
{
position[]={7122.139648,105.502586,8957.613281};
a=500.000000;
b=500.000000;
activationBy="WEST";
age="UNKNOWN";
class Effects
{
sound="Rus4";
track="7thLifeless";
};
};
class Item1
{
position[]={2609.912598,1.352212,2248.935791};
a=0.000000;
b=0.000000;
repeating=1;
type="SWITCH";
age="UNKNOWN";
text="RusMajiVlajku SW";
expCond="not isnull flagowner vlajkaUSA and flagowner vlajkaUSA != ownerU";
expActiv="ownerU = flagowner vlajkaUSA; titletext[format [localize ""STRD_17"", name ownerU], ""Plain down""]; PrycU=true";
class Effects
{
sound="RCapture";
};
};
class Item2
{
position[]={2582.933594,1.352212,2248.451416};
a=0.000000;
b=0.000000;
repeating=1;
type="SWITCH";
age="UNKNOWN";
text="AmerMaji SW";
expCond="not isnull flagowner vlajkaRus and flagowner vlajkaRus != ownerR";
expActiv="ownerR = flagowner vlajkaRus; titletext[format [localize ""STRD_16"", name ownerR], ""Plain down""]; PrycR=true";
class Effects
{
sound="UCapture";
};
};
class Item3
{
position[]={3875.737793,22.589998,8263.318359};
a=0.000000;
b=0.000000;
repeating=1;
type="SWITCH";
age="UNKNOWN";
text="NosicTu SW";
expCond="(OwnerR in list NavratW) and not PrycU and not Konec";
expActiv="Kdo=OwnerR; OwnerR=objNull; vlajkaRus setFlagOwner objNull; UScoreP=UScoreP+1; titletext[format [localize ""STRD_15"", UScoreP, RScoreP], ""Plain down""]; PrycR=false; Kdo addScore 5; ""_x addScore 5"" forEach units group Kdo";
class Effects
{
sound="UScore";
titleEffect="PLAIN DOWN";
};
};
class Item4
{
position[]={7152.262207,105.344994,8981.521484};
a=0.000000;
b=0.000000;
repeating=1;
type="SWITCH";
age="UNKNOWN";
text="NosicTu SW";
expCond="(OwnerU in list NavratE) and not PrycR and not Konec";
expActiv="Kdo=OwnerU; OwnerU=objNull; vlajkaUSA setFlagOwner objNull; RScoreP=RScoreP+1; titletext[format [localize ""STRD_14"", UScoreP, RScoreP], ""Plain down""]; PrycU=false; ""_x addScore 5"" forEach units group Kdo";
class Effects
{
sound="RScore";
titleEffect="PLAIN DOWN";
};
};
};
The positions are in St. Louis and Larche on Malden, right where I want them to be. They are the coordinates to the flag poles. I've tried making the score triggers have a span of 5 meters around, but it didn't help any. Where am I going wrong?
Also, if there is a tutorial for CTF like this with some well-commented code, I'd be content in digging through that instead.
-
:D Go for it !
http://www.ofpec.com/editors/resource_view.php?id=89 (http://www.ofpec.com/editors/resource_view.php?id=89)
-
How far into the tutorial do I have to go before it starts functioning minimally? I have the two flag poles, and I am just trying to trigger a capture by bringing the flag into a zone I defined. I have an effect set to spit out some text when the conditions are met, but I never get the trigger. I don't have the game logic object in yet, and I don't have the external scorekeeping script referenced anywhere quite yet.
Here are the flags:
class Item1
{
position[]={7152.500000,105.344994,8980.371094};
azimut=230.000000;
id=1;
side="EMPTY";
vehicle="FlagCarrier";
leader=1;
skill=0.600000;
text="westflag";
init="this SetFlagTexture ""usa_vlajka.pac""; this SetFlagSide west";
};
class Item2
{
position[]={7141.926270,105.512131,8972.500000};
azimut=55.000000;
id=2;
side="EMPTY";
vehicle="FlagCarrier";
leader=1;
skill=0.600000;
text="eastflag";
init="this SetFlagTexture ""rus_vlajka.pac""; this SetFlagSide east";
};
Here is the sensor block
class Sensors
{
items=1;
class Item0
{
position[]={7153.500000,105.344994,8982.588867};
a=5.000000;
b=5.000000;
age="UNKNOWN";
text="West_Score";
expCond="(flagOwner eastflag) in thisList AND isNull (flagOwner westflag)";
class Effects
{
titleType="TEXT";
title="NATO captures Warsaw's flag!";
};
};
};
-
[quote author=Rocko Bonaparte link=board=7;threadid=19883;start=0#msg131903 date=1096943200]
How far into the tutorial do I have to go before it starts functioning minimally?
[/quote]
Err, you dont want to read the tutorial?
--Ben