Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Giant Spiders drops i_spider_web in sleeping sector #1249

Open
DavideRei opened this issue Jun 5, 2024 · 12 comments
Open

Giant Spiders drops i_spider_web in sleeping sector #1249

DavideRei opened this issue Jun 5, 2024 · 12 comments

Comments

@DavideRei
Copy link
Contributor

Sphere console gives warnings about too many items in different sleeping sectors. When you go there in game the problem disappear.
I found out that the issue is related to spider's webs, giant spiders are able to drop webs in sleeping sector but the timer on the spider web doesnt work because of the sleeping sector.
The problem is solved setting can_o_nosleep on i_spider_web item

@Jhobean
Copy link
Contributor

Jhobean commented Jul 2, 2024

Ok the item are added here:

if ( IsTrigUsed(TRIGGER_NPCSPECIALACTION) )
{
if ( OnTrigger( CTRIG_NPCSpecialAction, this ) == TRIGRET_RET_TRUE )
return;
}
switch ( GetDispID())
{
case CREID_FIRE_ELEM:
if ( !CWorldMap::IsItemTypeNear(GetTopPoint(), IT_FIRE, 0, false) )
{
Action_StartSpecial(CREID_FIRE_ELEM);
return;
}
break;
default:
// TAG.OVERRIDE.SPIDERWEB
CVarDefCont * pValue = GetKey("OVERRIDE.SPIDERWEB",true);
if ( pValue )
{
if ( GetDispID() != CREID_GIANT_SPIDER )
{
Action_StartSpecial(CREID_GIANT_SPIDER);
return;
}
} else {
if ( GetDispID() == CREID_GIANT_SPIDER )
{
Action_StartSpecial(CREID_GIANT_SPIDER);
return;
}

A check for sector sleep should be add on spider and fire elemental

@Jhobean
Copy link
Contributor

Jhobean commented Jul 20, 2024

This bug is weird because:
1- In sleeping sector NPC sleep and dont do special action (Just tested and it work)
2- Item with decay flag suppose to always continue timer and decay on sleeping sector (Just tested and it work)

I was about to add some check on the core to prevent
a: prevent npc to spawn item id sector sleep
b: Add can_o_nosleep flag on item.

But both are useless because 1 and 2 work.....

I try to reproduce but i'm not able... I spawn 250 spider on britain and they make spider web everywhere.. I leave for 10 mins, (Sector sleep after 1 min) When I come back there no web.

@Tolokio
Copy link
Contributor

Tolokio commented Jul 20, 2024

whats the bug then?

@Jhobean
Copy link
Contributor

Jhobean commented Jul 20, 2024

whats the bug then?

Don't know... was not able to reproduce.. Maybe David was using an old build before we added the "decay" don't sleep

@Tolokio
Copy link
Contributor

Tolokio commented Jul 20, 2024

nolok confirmed, so there got to b something.

@cbnolok
Copy link
Contributor

cbnolok commented Jul 30, 2024

Well it was confirmed back then, i didn't check with latest builds

@Soulless-1
Copy link
Contributor

it seems to be along the edge of sleeping sectors. from what i recall. i did the same fix as david can_o_nosleep

@cbnolok
Copy link
Contributor

cbnolok commented Jul 31, 2024

Is that still happening with a recent build, such latest dev one? This bug sounds weird to me since i recall we fixed a similar (if not identical) issue.

@DavideRei
Copy link
Contributor Author

I removed can_o_nosleep from the web script, so I'll see if the problem persists

@DavideRei
Copy link
Contributor Author

It seems solved, web spider not increased in 20 hours.

@DavideRei
Copy link
Contributor Author

The bug is back on Linux

image

image

@DavideRei DavideRei reopened this Nov 11, 2024
@canerksk
Copy link
Contributor

canerksk commented Nov 13, 2024

This may be the same problem as Issue #1229, since the time between wander and idle actions of the npc is very short, it is constantly switching between wander and idle very quickly and thus wants to add spiderweb every time.

I think _SetTimeoutS under NPC_Act_Idle can be tied to motivation. so I think most of the npc bugs will be solved with this or the time can be set as it was before. it's too fast right now

I solved it temporarily with the script

under t_web.

[typedef t_web]
on@create
timer={ 5 10} 

on=@timer
remove
return 1 

This way, there is no accumulation of cobwebs as they are quickly removed after they have formed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants