mirror of
https://github.com/tribes2/SkillSector.git
synced 2026-01-19 19:44:48 +00:00
SSWW: fully implement zone based waypoints, delete disused code and comments
This commit is contained in:
parent
f38bbe3e40
commit
bf31ced0bc
|
|
@ -13,11 +13,11 @@
|
||||||
//--- OBJECT WRITE BEGIN ---
|
//--- OBJECT WRITE BEGIN ---
|
||||||
new SimGroup(MissionGroup) {
|
new SimGroup(MissionGroup) {
|
||||||
|
|
||||||
Team_Hunters_timeLimit = "25";
|
|
||||||
powerCount = "0";
|
|
||||||
cdTrack = "5";
|
cdTrack = "5";
|
||||||
musicTrack = "ice";
|
powerCount = "0";
|
||||||
Hunters_timeLimit = "25";
|
Hunters_timeLimit = "25";
|
||||||
|
Team_Hunters_timeLimit = "25";
|
||||||
|
musicTrack = "ice";
|
||||||
|
|
||||||
new MissionArea(MissionArea) {
|
new MissionArea(MissionArea) {
|
||||||
area = "-1008 -1032 2144 2080";
|
area = "-1008 -1032 2144 2080";
|
||||||
|
|
@ -64,13 +64,13 @@ new SimGroup(MissionGroup) {
|
||||||
customArea = "0 0 0 0";
|
customArea = "0 0 0 0";
|
||||||
|
|
||||||
GraphFile = "Scarabrae_nef.nav";
|
GraphFile = "Scarabrae_nef.nav";
|
||||||
conjoinBowlDev = "20";
|
|
||||||
position = "0 0 0 1";
|
position = "0 0 0 1";
|
||||||
coverage = "0";
|
coverage = "0";
|
||||||
rotation = "0 0 0 0";
|
rotation = "0 0 0 0";
|
||||||
XDimOverSize = "0";
|
XDimOverSize = "0";
|
||||||
scale = "1 1 1";
|
|
||||||
YDimOverSize = "0";
|
YDimOverSize = "0";
|
||||||
|
scale = "1 1 1";
|
||||||
|
conjoinBowlDev = "20";
|
||||||
locked = "true";
|
locked = "true";
|
||||||
};
|
};
|
||||||
new Sky(Sky) {
|
new Sky(Sky) {
|
||||||
|
|
@ -401,9 +401,9 @@ new SimGroup(MissionGroup) {
|
||||||
homingCount = "0";
|
homingCount = "0";
|
||||||
|
|
||||||
Trigger = "4568";
|
Trigger = "4568";
|
||||||
notReady = "1";
|
|
||||||
Target = "39";
|
Target = "39";
|
||||||
inUse = "Down";
|
inUse = "Down";
|
||||||
|
notReady = "1";
|
||||||
};
|
};
|
||||||
new Marker(BankSpawn) {
|
new Marker(BankSpawn) {
|
||||||
position = "-155.307 126.636 243.233";
|
position = "-155.307 126.636 243.233";
|
||||||
|
|
@ -416,7 +416,7 @@ new SimGroup(MissionGroup) {
|
||||||
|
|
||||||
powerCount = "2";
|
powerCount = "2";
|
||||||
|
|
||||||
new StaticShape() {
|
new StaticShape(ATMT) {
|
||||||
position = "-175.467 149.497 233.142";
|
position = "-175.467 149.497 233.142";
|
||||||
rotation = "1 0 0 0";
|
rotation = "1 0 0 0";
|
||||||
scale = "1 1 1";
|
scale = "1 1 1";
|
||||||
|
|
@ -425,9 +425,11 @@ new SimGroup(MissionGroup) {
|
||||||
homingCount = "0";
|
homingCount = "0";
|
||||||
|
|
||||||
Desc = "Dynamic Aim Trainer\nShoot moving targets while in the air to score points!\nMove faster to score more points and have fun!";
|
Desc = "Dynamic Aim Trainer\nShoot moving targets while in the air to score points!\nMove faster to score more points and have fun!";
|
||||||
|
Target = "40";
|
||||||
|
wrangle = "Aim Trainer teleports";
|
||||||
destination = "ATMSpawn";
|
destination = "ATMSpawn";
|
||||||
};
|
};
|
||||||
new StaticShape() {
|
new StaticShape(ATHT) {
|
||||||
position = "-170.634 150.644 233.142";
|
position = "-170.634 150.644 233.142";
|
||||||
rotation = "1 0 0 0";
|
rotation = "1 0 0 0";
|
||||||
scale = "1 1 1";
|
scale = "1 1 1";
|
||||||
|
|
@ -436,9 +438,10 @@ new SimGroup(MissionGroup) {
|
||||||
homingCount = "0";
|
homingCount = "0";
|
||||||
|
|
||||||
Desc = "Aim Trainer\nShoot fast moving targets while in the air to score points!\nMove faster to score more points and have fun!";
|
Desc = "Aim Trainer\nShoot fast moving targets while in the air to score points!\nMove faster to score more points and have fun!";
|
||||||
|
Target = "41";
|
||||||
destination = "ATHSpawn";
|
destination = "ATHSpawn";
|
||||||
};
|
};
|
||||||
new StaticShape() {
|
new StaticShape(ATLT) {
|
||||||
position = "-176.634 144.844 233.142";
|
position = "-176.634 144.844 233.142";
|
||||||
rotation = "1 0 0 0";
|
rotation = "1 0 0 0";
|
||||||
scale = "1 1 1";
|
scale = "1 1 1";
|
||||||
|
|
@ -447,6 +450,7 @@ new SimGroup(MissionGroup) {
|
||||||
homingCount = "0";
|
homingCount = "0";
|
||||||
|
|
||||||
Desc = "Static Aim Trainer\nShoot static targets while in the air to score points!\nMove faster to score more points and have fun!";
|
Desc = "Static Aim Trainer\nShoot static targets while in the air to score points!\nMove faster to score more points and have fun!";
|
||||||
|
Target = "42";
|
||||||
destination = "ATLSpawn";
|
destination = "ATLSpawn";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -459,20 +463,22 @@ new SimGroup(MissionGroup) {
|
||||||
homingCount = "0";
|
homingCount = "0";
|
||||||
|
|
||||||
gravityMod = "-2.75";
|
gravityMod = "-2.75";
|
||||||
pz = "4575";
|
|
||||||
appliedForce = "0 0 0";
|
|
||||||
Target = "-1";
|
|
||||||
originalscale = "10 40 140";
|
originalscale = "10 40 140";
|
||||||
|
appliedForce = "0 0 0";
|
||||||
|
pz = "4575";
|
||||||
|
Target = "-1";
|
||||||
velocityMod = "1.0";
|
velocityMod = "1.0";
|
||||||
};
|
};
|
||||||
new Trigger(BankWaypointZone) {
|
new Trigger(BankWaypointZone) {
|
||||||
position = "-158.549 134.258 240.811";
|
position = "-175.749 154.058 230.011";
|
||||||
rotation = "1 0 0 0";
|
rotation = "1 0 0 0";
|
||||||
scale = "1 1 1";
|
scale = "40 40 40";
|
||||||
dataBlock = "WaypointWranglerZone";
|
dataBlock = "WaypointWranglerZone";
|
||||||
lockCount = "0";
|
lockCount = "0";
|
||||||
homingCount = "0";
|
homingCount = "0";
|
||||||
polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 -0.0000000 -1.0000000 -0.0000000 -0.0000000 -0.0000000 1.0000000";
|
polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 -0.0000000 -1.0000000 -0.0000000 -0.0000000 -0.0000000 1.0000000";
|
||||||
|
|
||||||
|
Target = "45";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
new SimGroup(AimTrain) {
|
new SimGroup(AimTrain) {
|
||||||
|
|
@ -536,6 +542,7 @@ new SimGroup(MissionGroup) {
|
||||||
homingCount = "0";
|
homingCount = "0";
|
||||||
|
|
||||||
Desc = "\nWelcome back to the Bank!";
|
Desc = "\nWelcome back to the Bank!";
|
||||||
|
Target = "43";
|
||||||
destination = "BankSpawn";
|
destination = "BankSpawn";
|
||||||
};
|
};
|
||||||
new Marker(ATLSpawn) {
|
new Marker(ATLSpawn) {
|
||||||
|
|
@ -565,8 +572,8 @@ new SimGroup(MissionGroup) {
|
||||||
lockCount = "0";
|
lockCount = "0";
|
||||||
homingCount = "0";
|
homingCount = "0";
|
||||||
|
|
||||||
Target = "44";
|
|
||||||
Desc = "\nWelcome back to the Bank!";
|
Desc = "\nWelcome back to the Bank!";
|
||||||
|
Target = "44";
|
||||||
destination = "BankSpawn";
|
destination = "BankSpawn";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,8 @@ function SkillSector::clientMissionDropReady(%game, %client) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($DEVMODE) {
|
if ($DEVMODE) {
|
||||||
|
moveMap.unbind(keyboard, "f5");
|
||||||
|
moveMap.unbind(keyboard, "f6");
|
||||||
moveMap.bind(keyboard, "f5", dc);
|
moveMap.bind(keyboard, "f5", dc);
|
||||||
moveMap.bind(keyboard, "f6", ssrl);
|
moveMap.bind(keyboard, "f6", ssrl);
|
||||||
ObserverHUDWeaponList.delete();
|
ObserverHUDWeaponList.delete();
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,11 @@
|
||||||
// 2. Point to point waypoints
|
// 2. Point to point waypoints
|
||||||
|
|
||||||
// Zone based waypoints are perfect for rooms full of teleporters / switches / etc.
|
// Zone based waypoints are perfect for rooms full of teleporters / switches / etc.
|
||||||
// Zone based waypoint SimGroup should have a 'zone' waypoint that is only shown when the player is outside of the zone, allowing zones to be discovered.
|
|
||||||
|
|
||||||
// Point to point waypoints are perfect for races and leading someone from one end of the map to another. I dunno, like a tutorial.
|
// Point to point waypoints are perfect for races and leading someone from one end of the map to another. I dunno, like a tutorial.
|
||||||
|
|
||||||
|
// Waypoints don't seem to be removable per-client without extensive modifications, so they're permanent.
|
||||||
|
// While it's possible to swap the clients team to show them different team waypoints, I like everyone being on the same sensor network.
|
||||||
|
|
||||||
// After a lot of reading scripts, engine source code and Ghidra decompiling, I've ascertained that... we're stuck with a bit of an odd structure.
|
// After a lot of reading scripts, engine source code and Ghidra decompiling, I've ascertained that... we're stuck with a bit of an odd structure.
|
||||||
// While it's true that you can allocate 512 TargetManager targets, HUDTargetList is limited to 32 targets exactly.
|
// While it's true that you can allocate 512 TargetManager targets, HUDTargetList is limited to 32 targets exactly.
|
||||||
// Those 32 targets are split across three categories.
|
// Those 32 targets are split across three categories.
|
||||||
|
|
@ -14,9 +15,6 @@
|
||||||
// 15 - ClientTarget::PotentialTask
|
// 15 - ClientTarget::PotentialTask
|
||||||
// 16 - ClientTarget::Waypoint
|
// 16 - ClientTarget::Waypoint
|
||||||
|
|
||||||
// Waypoints can't be removed per-client without extensive modifications, so they're still permament.
|
|
||||||
// While it's possible to swap the clients team to show them different team waypoints, it doesn't seem worth the hassle.
|
|
||||||
|
|
||||||
// What does that mean for my original intent with this script? Well, it's still achievable... but only by spamming the client.
|
// What does that mean for my original intent with this script? Well, it's still achievable... but only by spamming the client.
|
||||||
// PotentialTasks are shown for 2 seconds after they're received.
|
// PotentialTasks are shown for 2 seconds after they're received.
|
||||||
// The player can show those tasks again by pressing n to summon the task list.
|
// The player can show those tasks again by pressing n to summon the task list.
|
||||||
|
|
@ -29,10 +27,44 @@ datablock TriggerData(WaypointWranglerZone) {
|
||||||
tickPeriodMS = 1500;
|
tickPeriodMS = 1500;
|
||||||
};
|
};
|
||||||
|
|
||||||
function WaypointWranglerZone__onAdd(%this, %obj) {
|
function WaypointWranglerZone::onEnterTrigger(%data, %trigger, %obj) {
|
||||||
// New zone added for waypoint wrangling.
|
if(%obj.getDataBlock().className !$= "Armor") {
|
||||||
echo("Obj: " @ %obj);
|
return;
|
||||||
echo("New group: " @ %this.getGroup());
|
}
|
||||||
|
echo("Trigger entered!");
|
||||||
|
WWStartWaypointDispatch(%obj.client, %trigger);
|
||||||
|
}
|
||||||
|
|
||||||
|
function WaypointWranglerZone::onLeaveTrigger(%this, %trigger, %obj) {
|
||||||
|
cancel(%obj.client.wwsched);
|
||||||
|
}
|
||||||
|
|
||||||
|
function WaypointWranglerZone::onTickTrigger(%this, %trigger) {
|
||||||
|
}
|
||||||
|
|
||||||
|
function scanZoneForWaypoints(%group) {
|
||||||
|
for (%i = 0; %i < %group.getCount(); %i++) {
|
||||||
|
%obj = %group.getObject(%i);
|
||||||
|
if (%obj.getClassName() $= "SimGroup") {
|
||||||
|
echo("Traversing detected group: " @ %obj.getName());
|
||||||
|
scanZoneForWaypoints(%obj);
|
||||||
|
} else if (%obj.wrangle !$= "") {
|
||||||
|
// echo("Found waypointable object in zone: " @ %obj.getName() @ " txt: " @ %obj.wrangle);
|
||||||
|
$WPZPoints[$WPZNextFree, $WPIndex] = %obj;
|
||||||
|
$WPIndex++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function initWranglerZone(%obj) {
|
||||||
|
echo("Waypoint zone detected: " @ %obj.getName() @ " tgt: " @ %obj.target);
|
||||||
|
// Iterate over the containing group and find wrangled objects
|
||||||
|
$WPIndex = 1;
|
||||||
|
scanZoneForWaypoints(%obj.getGroup());
|
||||||
|
// zero index is reserved for 'count of indexed waypoints'
|
||||||
|
$WPZPoints[$WPZNextFree, 0] = $WPIndex-1;
|
||||||
|
$WPZones[$WPZNextFree] = %obj;
|
||||||
|
$WPZNextFree++;
|
||||||
}
|
}
|
||||||
|
|
||||||
function scanGroupForWWZ(%group) {
|
function scanGroupForWWZ(%group) {
|
||||||
|
|
@ -43,12 +75,10 @@ function scanGroupForWWZ(%group) {
|
||||||
for (%i = 0; %i < %group.getCount(); %i++) {
|
for (%i = 0; %i < %group.getCount(); %i++) {
|
||||||
%obj = %group.getObject(%i);
|
%obj = %group.getObject(%i);
|
||||||
if (%obj.getClassName() $= "SimGroup") {
|
if (%obj.getClassName() $= "SimGroup") {
|
||||||
echo("Group detected: " @ %obj.getName());
|
echo("Traversing detected group: " @ %obj.getName());
|
||||||
scanGroupForWWZ(%obj);
|
scanGroupForWWZ(%obj);
|
||||||
} else if (%obj.getClassName() $= "Trigger" && %obj.getDatablock().getName() $= "WaypointWranglerZone") {
|
} else if (%obj.getClassName() $= "Trigger" && %obj.getDatablock().getName() $= "WaypointWranglerZone") {
|
||||||
echo("Waypoint detected: " @ %obj.getName());
|
initWranglerZone(%obj);
|
||||||
$WPZones[$WPZNextFree] = %obj;
|
|
||||||
$WPZNextFree++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -57,85 +87,35 @@ function WaypointWranglerInit() {
|
||||||
// Reset WPZone system
|
// Reset WPZone system
|
||||||
$WPZNextFree = 0;
|
$WPZNextFree = 0;
|
||||||
$WPZones[0] = 0;
|
$WPZones[0] = 0;
|
||||||
|
$WPZPoints[0, 0] = 0;
|
||||||
// Iterate over every group and find relevant triggers
|
// Iterate over every group and find relevant triggers
|
||||||
scanGroupForWWZ(MissionGroup);
|
scanGroupForWWZ(MissionGroup);
|
||||||
// Iterate over
|
|
||||||
// Use zone.getGroup to get their containing group
|
|
||||||
// Iterate over all the objects in the containing group that have a WPN (waypoint name), put them into a SimSet or array with a name relating to the containing group
|
|
||||||
// Whenever a player enters the Trigger zone, hide the pimary waypoint associated with the zone and show the other waypoints
|
|
||||||
// Might make sense to make a flag for 'hide all other primary waypoints inside zone' (useful for point to point races and very busy zones like the Bank)
|
|
||||||
// This flag might get set automatically if there are too many waypoints in a zone (>10?)
|
|
||||||
|
|
||||||
// This system should prevent players for placing waypoints if they exceed the maximum waypoint count. I don't know how that works so I probably won't do it yet.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MaxTargets = 512
|
|
||||||
// HUDTargetList = 32
|
|
||||||
|
|
||||||
//%target = createTarget(%flag.waypoint, CTFGame::getTeamName( CTFGame, %flag.team), "", "", 'Base', %flag.team, 0);
|
|
||||||
|
|
||||||
function showWaypoint(%client, %wp) {
|
function showWaypoint(%client, %wp) {
|
||||||
echo(%wp.getName());
|
// echo("Trying to emit waypoint for " @ %wp @ " and client " @ %client);
|
||||||
echo(%wp.getPosition());
|
|
||||||
%client.setTargetId(%wp.target);
|
%client.setTargetId(%wp.target);
|
||||||
commandToClient(%client, 'TaskInfo', %client, -1, false, %wp.getName());
|
commandToClient(%client, 'TaskInfo', %client, -1, false, %wp.wrangle);
|
||||||
commandToClient(%client, 'PotentialTask', %client.name, "wub wub", "target name");
|
// PotentialTask just shows a message in chat, not desirable for this configuration
|
||||||
|
//commandToClient(%client, 'PotentialTask', %client.name, "", "target name");
|
||||||
%client.sendTargetTo(%client, false);
|
%client.sendTargetTo(%client, false);
|
||||||
// %clRabbit.player.scopeToClient(%cl);
|
|
||||||
// %visMask = getSensorGroupAlwaysVisMask(%clRabbit.getSensorGroup());
|
|
||||||
// %visMask |= (1 << %cl.getSensorGroup());
|
|
||||||
// setSensorGroupAlwaysVisMask(%clRabbit.getSensorGroup(), %visMask);
|
|
||||||
// %cl.setTargetId(%clRabbit.target);
|
|
||||||
// commandToClient(%cl, 'TaskInfo', %cl, -1, false, "Kill the Rabbit!");
|
|
||||||
// commandToClient(%targetClient, 'PotentialTask', %client.name, %client.currentTaskDescription, %targetName);
|
|
||||||
// %client.sendTargetTo(%targetClient, false);
|
|
||||||
// %cl.sendTargetTo(%cl, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideWaypoint() {
|
function WWDispatch(%client, %zoneIndex) {
|
||||||
|
for (%i = 1; %i < $WPZPoints[%zoneIndex, 0]+1; %i++) {
|
||||||
// function clientCmdAcceptedTask(%description) {
|
showWaypoint(%client, $WPZPoints[%zoneIndex, %i]);
|
||||||
// addMessageHudLine("\c3Your current task is:\cr " @ %description);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// commandToClient(%client, 'TaskInfo', %issueClient, -1, %issueClient.name, %description);
|
|
||||||
// commandToClient(%client, 'AcceptedTask', %description);
|
|
||||||
|
|
||||||
// %client.sendTargetTo(%client, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
function debugDispatch() {
|
|
||||||
%count = ClientGroup.getCount();
|
|
||||||
|
|
||||||
for (%i = 0; %i < %count; %i++) {
|
|
||||||
%client = ClientGroup.getObject(%i);
|
|
||||||
echo("Client: " @ %client);
|
|
||||||
WWDispatchWaypoints(%client);
|
|
||||||
}
|
}
|
||||||
|
%client.wwsched = schedule(1900, 0, WWDispatch, %client, %zoneIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
function WWDispatchWaypoints(%client) {
|
function WWStartWaypointDispatch(%client, %zone) {
|
||||||
|
// echo("zone count:" @ $WPZNextFree);
|
||||||
for (%i = 0; %i < $WPZNextFree; %i++) {
|
for (%i = 0; %i < $WPZNextFree; %i++) {
|
||||||
%wp = $WPZones[%i];
|
%wpz = $WPZones[%i];
|
||||||
showWaypoint(%client, %wp);
|
// echo("testing " @ %zone @ " against " @ %wpz);
|
||||||
//allocTarget, createTarget
|
if (%wpz == %zone) {
|
||||||
// allocClientTarget is only relevant to other players, it's for creating targets that represent client connections
|
// echo("Zone found! idx " @ %i @ " ct: " @ $WPZPoints[%i, 0]);
|
||||||
// Con::addCommand("ClientTarget", "sendToServer", cTargetSendToServer, "target.sendToServer()", 2, 2);
|
WWDispatch(%client, %i);
|
||||||
// Con::addCommand("ClientTarget", "createWaypoint", cCreateWaypoint, "target.createWaypoint(text)", 3, 3);
|
}
|
||||||
// Con::addCommand("ClientTarget", "addPotentialTask", cAddPotentialTask, "target.addPotentialTask()", 2, 2);
|
|
||||||
// Con::addCommand("ClientTarget", "setText", cSetText, "target.setText(text)", 3, 3);
|
|
||||||
// Con::addCommand("ClientTarget", "getTargetId", cGetTargetId, "target.getTargetId()", 2, 2);
|
|
||||||
// Con::addCommand("createClientTarget", cCreateClientTarget, "createClientTarget(targetId, <x y z>)", 2, 3);
|
|
||||||
// Con::addCommand("removeClientTargetType", cRemoveClientTargetType, "removeClientTargetType(client, type)", 3, 3);
|
|
||||||
// Con::addVariable("clientTargetTimeout", TypeS32, &HUDTargetList::smTargetTimeout);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Revisiting this concept by looking through the code for dlgDrawText\(.* to find all locations where text is rendered
|
|
||||||
// Hopefully I can find a more suitable way to render text for these items, but I'm not overly optimistic
|
|
||||||
// guiShapeNameHud seems relevant to 'directly looking at an object and seeing some text' but that's not quite what I want
|
|
||||||
// shapeNameHud seems similar
|
|
||||||
Loading…
Reference in a new issue