Continued rewriting the main server script, slight readme change

This commit is contained in:
loplkc loplkc 2021-09-28 17:20:52 -04:00
parent 47264545ed
commit 909bfe30d8
2 changed files with 35 additions and 25 deletions

View file

@ -1,3 +1,5 @@
# p94-ts # p94-ts
An unfinished, broken game (in typescript!) An unfinished, broken "game" (that I am trying to rewrite in typescript!)
This is a Rojo project. You can build and serve it like a Rojo project if you have Roblox-ts installed. However, I cannot guarantee that it will actually work.

View file

@ -188,10 +188,7 @@ var p: {[key: number]: pEntry} = []; // The god table. Legend says it holds the
function initPlr(plr: Player) { function initPlr(plr: Player) {
let uId = plr.UserId; let uId = plr.UserId;
// PLAYER VARIABLES // PLAYER VARIABLES
let parts = getParts(uId); let chrInfo = setUp(uId)
if (!parts) { warn("Server: Player by UserId of " + tS(uId) + " not found, returning..."); return; } // One last chance to turn back
let wings = makeWings(parts); // From here, we are nihilists (if the thread errors, it errors)
makeDecor(wings, "SpectrumWing", "SpectrumCore")
let entry: pEntry = { // This should load information from datastores in the future let entry: pEntry = { // This should load information from datastores in the future
set = 1, set = 1,
mode = "Q", mode = "Q",
@ -203,9 +200,10 @@ function initPlr(plr: Player) {
pvp = false, pvp = false,
mousePos = new v3 (0,0,0), mousePos = new v3 (0,0,0),
parts = parts, parts = chrInfo[1],
wings = wings, wings = chrInfo[2],
}; };
//guh.StoredModeInfo = {} //guh.StoredModeInfo = {}
//PlaybackLoudness information //PlaybackLoudness information
//guh.PBL = Instance.new("NumberValue",plr) //guh.PBL = Instance.new("NumberValue",plr)
@ -216,7 +214,7 @@ function initPlr(plr: Player) {
//pvp[uId] = 0 //Zero is none, one is friends, two is all. //pvp[uId] = 0 //Zero is none, one is friends, two is all.
//Finish setup //Finish setup
p[uId] = entry; p[uId] = entry;
setUp(plr); // TEMPORARY //setUp(plr); // TEMPORARY
//plr.CharacterAdded.Connect(setUp) //plr.CharacterAdded.Connect(setUp)
/* WILL BE REIMPLEMENTED WITH THE SGANIMATE REWORK /* WILL BE REIMPLEMENTED WITH THE SGANIMATE REWORK
@ -352,25 +350,29 @@ function makeDecor(wings: [undefined?, Folder, Part[][], Part], wing: string,cor
} }
function makeBGui() { function makeBGui() {
let gui = new inst("BillboardGui")//game.ServerStorage.StarG:Clone() let gui = new inst("BillboardGui");//game.ServerStorage.StarG:Clone()
//let BGui: [undefined?, BillboardGui, TextLabel, TextLabel, GuiObject[], GuiObject[]] = [];
//gui.Parent = p[uId].Parts[1] //gui.Parent = p[uId].Parts[1]
//gui.Adornee = p[uId].Parts[4] //gui.Adornee = p[uId].Parts[4]
BGui[1] = gui //gui;
BGui[2] = gui.Title let title = new inst("TextLabel");//gui.Title
BGui[3] = gui.Extra let extra = new inst("TextLabel");//gui.Extra
BGui[4] = {} //Parts of the gui to be recolored to the primary color let primaries: GuiObject[] = [] //Parts of the gui to be recolored to the primary color
BGui[5] = {} //Parts of the gui to be recolored to the secondary color let secondaries: GuiObject[] = [] //Parts of the gui to be recolored to the secondary color
for i, v in pairs(gui:GetDescendants()) do //Sort the rest of the GUI into these tables for (let guiPiece of gui.GetDescendants()) { //Sort the rest of the GUI into these tables
local startLetter = sub(v.Name,1,1) if (guiPiece.IsA("GuiObject")) {
if startLetter == "p" then const startLetter = sub(guiPiece.Name,1,1)
insert(BGui[4],v) if (startLetter == "p") {
elseif startLetter == "s" then primaries.push(guiPiece)
insert(BGui[5],v) } else if (startLetter == "s") {
end secondaries.push(guiPiece)
end }
}
}
let bGui: [undefined, BillboardGui, TextLabel, TextLabel, GuiObject[], GuiObject[]] = [undefined, gui,title,extra,primaries,secondaries];
} }
function setUp(Plr: Player) function setUp(uId: number) {
/* /*
Chr = plr.Character Chr = plr.Character
repeat repeat
@ -380,7 +382,7 @@ function setUp(Plr: Player)
Hum = Chr.Humanoid Hum = Chr.Humanoid
Hum.MaxHealth = 200 Hum.MaxHealth = 200
Hum.Health = 200 Hum.Health = 200
*/
if (Chr) { if (Chr) {
Plr = plrFromChr(plrs,Chr) Plr = plrFromChr(plrs,Chr)
} else { } else {
@ -400,8 +402,14 @@ function setUp(Plr: Player)
wait(1) wait(1)
StandardTransform(Plr,1,"QQ",nil,true) StandardTransform(Plr,1,"QQ",nil,true)
Output:FireClient(Plr,"SideColors",sideColorTable("Star",1)) Output:FireClient(Plr,"SideColors",sideColorTable("Star",1))
*/
let parts = getParts(uId);
assert(parts,"Server: Player by UserId of " + tS(uId) + " not found, giving up...")//if (!parts) { warn("Server: Player by UserId of " + tS(uId) + " not found, returning..."); return; } // One last chance to turn back
let wings = makeWings(parts); // From here, we are nihilists (if the thread errors, it errors)
makeDecor(wings, "SpectrumWing", "SpectrumCore")
return [undefined, parts, wings] as [undefined?, [undefined?, Model, Humanoid, Part, Part, Part, Part, Part, Part, Part], [undefined?, Folder, Part[][], Part]];
//waitForLeaveSpawn() //waitForLeaveSpawn()
end }
//Mode switching functions //Mode switching functions
//local TT = {} //local TT = {}