diff --git a/CoreScripts/Character/InteractableCharacter.as b/CoreScripts/Character/InteractableCharacter.as index 67c99ea..48e9963 100644 --- a/CoreScripts/Character/InteractableCharacter.as +++ b/CoreScripts/Character/InteractableCharacter.as @@ -32,6 +32,10 @@ void onCommand(CBlob@ this, u8 cmd, CBitStream@ params) BlobCharacter@ char = getCharacter(this); char.SetCurrentResponse("test"); + + CBitStream cbs = CBitStream(); + cbs.write_u16(this.getNetworkID()); + getRules().SendCommand(getRules().getCommandID("character_test"), cbs); } } diff --git a/CoreScripts/Rules/CharacterHandler.as b/CoreScripts/Rules/CharacterHandler.as index d71c29b..47127ab 100644 --- a/CoreScripts/Rules/CharacterHandler.as +++ b/CoreScripts/Rules/CharacterHandler.as @@ -18,6 +18,8 @@ void onInit(CRules@ this) // This will be called when a blob dies // This is required unless you want the game to crash this.addCommandID("character_unbound"); + // Temp bind + this.addCommandID("character_test"); onRestart(this); //id = Render::addScript(Render::layer_posthud, "CharacterHandler.as", "NewRender", 10.0f); @@ -56,7 +58,7 @@ void onReload(CRules@ this) if (char is null) continue; - Handler.AddCharacter(BlobCharacter(char)); + Handler.AddCharacter(char); } // End @@ -96,6 +98,13 @@ void onCommand(CRules@ this, u8 cmd, CBitStream@ params) Handler.RemoveCharacter(blob); } + else if (cmd == this.getCommandID("character_test")) + { + u16 networkId = params.read_u16(); + CBlob@ blob = getBlobByNetworkID(networkId); + + Handler.SetBlobToRender(blob); + } } void onRender(CRules@ this) diff --git a/Maps/KnightShowcase/KnightShowcase.as b/Maps/KnightShowcase/KnightShowcase.as index e2b3d92..6eaf18c 100644 --- a/Maps/KnightShowcase/KnightShowcase.as +++ b/Maps/KnightShowcase/KnightShowcase.as @@ -20,6 +20,8 @@ void onRestart(CMap@ this) } SpawnInCharacter("knight", 1, Vec2f(538, 560), "generic knight main"); + SpawnInCharacter("archer", 0, Vec2f(555, 560), "generic archer main"); + SpawnInCharacter("builder", 3, Vec2f(575, 560), "generic builder main"); } void onTick(CMap@ map)