Welcome to the Builder Academy

Question Crash bug - need assistance with GDB

More
14 Jan 2018 21:01 #7357 by cunning
I am not sure that is it. I see tons of scripts using the same format on the stock TBA base. I think the real issue is that the script is fired, but the teleport has not happened yet. It now moves the character and the room check now can show a NOWHERE value if the teleporter immediately quits out or immediately teleports out.

This is specific to teleporting characters into a room that has the %actor.is_pc% check. I do not want speech scripts firing for mobiles entering a room. If i have to i will allow it, but I think the issue is deeper.

Please Log in or Create an account to join the conversation.

More
14 Jan 2018 21:15 #7358 by Fizban
It should be pretty easy to test your theory.

As I understand, the crash happens when someone is teleported into the room, but not when they walk into the room?

In those instances it seems to try to check whether the actor is a pc or not before he actor is in the room and is therefore checking whether a null value is or isn't a pc.

If so, adding

wait 1

to the top of the script should probably give it enough time for the player to fully enter the room. If that isn't long enough, wait 1 s should certainly be long enough. Changing the script though isn't really an ideal fix, I think it should be fixed in the code somehow for sure, but seeing if this change solves the problem would at least pinpoint whether or not the problem is what you think it is.

Please Log in or Create an account to join the conversation.

More
14 Jan 2018 21:43 #7359 by Fizban
I tested it on TBA.

I setup a greet script.

I walked into the room.

I then used goto to come into the room. Nothing happened in either instance.

I then decided just to be completely sure I'd setup a script in a different room that teleports me into the room with the mob that has the greet script.

It all worked with no crashing, but I do think I recall TBA having an issue with either greet or enter triggers causing crashes in the past, but I don't recall what was changed to solve the issue unfortunately.

I also tried it all without a wait being at the top, it doesn't seem to be necessary on TBA, but might be on the code you're using if TBA's code was changed specifically to make it not be needed there at some point.

However if you use a room-enter script for something similar instead of a mob-greet script, I would definitely suggest putting a wait at the top of your room-enter scripts. This is not to avoid a crash, it's just because when you don't do so it actually looks like this.
Code:
1134H 860M 96V > n You are a pc. [57700] Fizban's Zone Description Room [ INDOORS PRIVATE HOUSE ATRIUM ] [ Inside ][T 57714] Fizban is a rather peculiar old man who enjoys filling his zone with strange triggers, if you were to walk through this zone and [!] explore it thoroughly with nohassle off you would likely regret | it. A sign is seen to the right. [.]-[.] [ Exits: s ] [57700] [T57714] Fizban's personal guard is here selling his wares. 1134H 860M 96V >

ie. The message was displayed before the room description was. That's a bit awkward. It is however intended, the reason being that with room-enter scripts unlike mob-greet they are intended to fire before entering the room so that players can be barred from entering the room so long as there is a return 0 on the script prior to any waits.

ie.

A mob-greet script with a return 0 also bars you from entering the room, but you actually enter the room, and then get shoved out, it looks like this.
Code:
1134H 860M 96V > n [57700] Fizban's Zone Description Room [ INDOORS PRIVATE HOUSE ATRIUM ] [ Inside ] Fizban is a rather peculiar old man who enjoys filling his zone with strange triggers, if you were to walk through this zone and [!] explore it thoroughly with nohassle off you would likely regret | it. A sign is seen to the right. [.]-[.] [ Exits: s ] [57700] [T57714] Fizban's personal guard is here selling his wares. You are a pc. We do not allow pc's in here. [57701] Fizban's Mind [ INDOORS PRIVATE HOUSE ATRIUM ] [ Inside ][T 57737] [.] Fizban's evil mind and ambitions will surely destroy all the | world over time. It's just a matter of time till you wake up to [!]-[.] realize your life and the world as you know it never really existed and you and your world are in fact just a fictitious reality Fizban imagined... Most likely while eating shrooms. [ Exits: n e ]

Room-enter scripts don't even let you see the room if they bar you.
Code:
1134H 860M 96V > n You are a pc. We do not allow pc's in here.

Please Log in or Create an account to join the conversation.

More
14 Jan 2018 22:04 - 14 Jan 2018 22:05 #7361 by cunning
Fizban, i have teleported around like crazy on my dev port and did not have it happen. But it definitely happens on the live port. I even generated a patch file to make sure i had no differences. It does not happen when walking into the room.

I have added the wait state and allowed teleporting to continue, now i will wait and see. Thanks for all the suggestions. I
Last edit: 14 Jan 2018 22:05 by cunning.

Please Log in or Create an account to join the conversation.

More
15 Jan 2018 16:42 #7367 by cunning
Crashed again same exact scenario.

Please Log in or Create an account to join the conversation.

More
15 Jan 2018 17:06 #7368 by Fizban
Does it ever crash when PC's enter the room, or only ever npc's?

If I remember correctly (which I may not) you ran CWG Rasputin back when the old CWG forums were alive, is that what you're currently using?
Code:
int valid_dg_target(struct char_data *ch, int bitvector) { if (IS_NPC(ch)) return TRUE; /* all npcs are allowed as targets */ else if (ch->desc && (STATE(ch->desc) != CON_PLAYING)) return FALSE; /* Only PC's who are playing can be targetted */ else if (GET_LEVEL(ch) < LVL_IMMORT) return TRUE; /* as well as all mortals */ else if (!IS_SET(bitvector, DG_ALLOW_GODS) && GET_LEVEL(ch) >= LVL_GRGOD) /* LVL_GOD has the advance command. Can't allow them to be forced. */ return FALSE; /* but not always the highest gods */ else if (!PRF_FLAGGED(ch, PRF_NOHASSLE)) return TRUE; /* the ones in between as allowed as long as they have no-hassle off. */ else return FALSE; /* The rest are gods with nohassle on... */ }

That's what valid_dg_target looks like in dg_misc.c on tbaMUD, I'm curious if that looks the same for you, or if there is something different going on there which might be causing mobs to not be considered valid dg targets under some circumstances.

Please Log in or Create an account to join the conversation.

Time to create page: 0.199 seconds