Bug spider queen


RUMblN

Recommended Posts

Unsurprisingly, the, um... error in question comes from the fact that a Spider Queen will unscrupulously spawn Spiders around itself depending on which direction it's facing. This is actually coded into the stategraph, which... really isn't the best place for it, but whatever. If Klei wanted all their code to make sense, they'd hire me. (-:

 

Line 164 in scripts/stategraphs/SGspiderqueen.lua describes how a Spider Queen spawns a Spider:

local angle = inst.Transform:GetRotation()/DEGREESlocal prefab = (inst.components.combat.target and math.random() < .333) and "spider_warrior" or "spider"local spider = inst.components.lootdropper:SpawnLootPrefab(prefab)local rad = spider.Physics:GetRadius()+inst.Physics:GetRadius()+.25;local pt = Vector3(inst.Transform:GetWorldPosition())if spider then    spider.Transform:SetPosition(pt.x + rad*math.cos(angle), pt.y, pt.z + rad*math.sin(angle))    spider.sg:GoToState("taunt")    inst.components.leader:AddFollower(spider)    if inst.components.combat.target then        spider.components.combat:SetTarget(inst.components.combat.target)    endend

Spider Warriors here have a 1/3 chance of spawning when the Spider Queen is engaged in combat. Spiders always spawn, uh... I'm gonna guess behind the Spider Queen, but I'm not sure how to interpret Transform:GetRotation() at this time. If that position should happen to be an invalid location, it just goes ahead with it anyway. Ergo, swimming spiders.

 

It'll take a bit for me to come up with a good solution for this one. What I'm finding in my tests is that the large collision radius of the Spider Queen can force Spiders into the ocean when she's trying to follow a boat, which is really the problem in the first place. But that's not a problem with an obvious solution, so I'll get back to you on that one.

Link to comment
Share on other sites

Unsurprisingly, the, um... error in question comes from the fact that a Spider Queen will unscrupulously spawn Spiders around itself depending on which direction it's facing. This is actually coded into the stategraph, which... really isn't the best place for it, but whatever. If Klei wanted all their code to make sense, they'd hire me. (-:

 

Line 164 in scripts/stategraphs/SGspiderqueen.lua describes how a Spider Queen spawns a Spider:

local angle = inst.Transform:GetRotation()/DEGREESlocal prefab = (inst.components.combat.target and math.random() < .333) and "spider_warrior" or "spider"local spider = inst.components.lootdropper:SpawnLootPrefab(prefab)local rad = spider.Physics:GetRadius()+inst.Physics:GetRadius()+.25;local pt = Vector3(inst.Transform:GetWorldPosition())if spider then    spider.Transform:SetPosition(pt.x + rad*math.cos(angle), pt.y, pt.z + rad*math.sin(angle))    spider.sg:GoToState("taunt")    inst.components.leader:AddFollower(spider)    if inst.components.combat.target then        spider.components.combat:SetTarget(inst.components.combat.target)    endend

Spider Warriors here have a 1/3 chance of spawning when the Spider Queen is engaged in combat. Spiders always spawn, uh... I'm gonna guess behind the Spider Queen, but I'm not sure how to interpret Transform:GetRotation() at this time. If that position should happen to be an invalid location, it just goes ahead with it anyway. Ergo, swimming spiders.

 

It'll take a bit for me to come up with a good solution for this one. What I'm finding in my tests is that the large collision radius of the Spider Queen can force Spiders into the ocean when she's trying to follow a boat, which is really the problem in the first place. But that's not a problem with an obvious solution, so I'll get back to you on that one.

May be make sure the spider queen could not hug the coast, so that there is always some space left for the spider to spawn, and that the collision check won't push the spider out of bound.

Or, make spider queen to stop tracking players on boat. That should remove 90% of the reason for the spider queen to stay at a location where the glitch can occur.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.