Alternative ways to start conversation


#1

Hi all,

I got a bit of an issue. There is an area in which I need a conversation to happen. Now normally, I would use a trigger. However, the area is bugged. In game it looks fine, but in the toolset the terrain is not visible. Also, I cannot place anything new on this area. It just won’t be placed. So I need to start a conversation via another way. I was thinking perception but I never tried something like that. Any ideas?


#3

You can also use the OnHeartbeat handler for this purpose.

Here is how the OnHeartbeat script of your creature should look like:

// custom heartbeat

#include "ginc_actions"
#include "ginc_behavior"
#include "ginc_event_handlers"

void main()
{
	if (GetAILevel() == AI_LEVEL_VERY_LOW) return;

	if (!IsBusy(OBJECT_SELF) && GetCommandable(OBJECT_SELF) && !GetLocalInt(OBJECT_SELF, "bConvoDone"))
	{
		object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, CREATURE_TYPE_IS_ALIVE, TRUE); 
	
		if (GetIsObjectValid(oPC))
		{
			SetIsFocused(FOCUSED_FULL, OBJECT_SELF);
			ClearAllActions();
			ActionStartConversation(oPC); // <- bConvoDone is set to 1 in the conversation
			ActionDoCommand(SetIsFocused(FOCUSED_STANDARD, OBJECT_SELF));
			NoInterrupt(30.f, TRUE);
		}
	}

	ExecuteScript(SCRIPT_DEFAULT_HEART, OBJECT_SELF);	
}

The OnPerception handler solution is quite similar.


#4

@andysks
I’m curious, is this for RoE or is this a new project you are working on?


#5

It’s for RoE. It happened in the Hades area. I added some content since we last talked as we both figured it looked kinda empty.


#6

I guess the elephant in the room for me is why is the area bugging in the toolset in the first place. I’d love to take a look at that issue and I think I still have access to the pCloud files. Would you mind updating those files so I can take a look at that area?


#7

Absolutely fine with it. I will update the module later today. In the beginning I was afraid that the area is corrupted or something else on a catastrophic scale. But it runs fine in game. I’ll let you know when I update the files on the cloud.


#8

Great!
Is it just the ext_hades area that is bugging? Or is it also the other areas in the 16_Hades module folder?


#9

Only the ext_hades (hopefully :D)


#10

@andysks
Have you tried the script I provided above? Was my answer helpful for you or maybe you managed to find your own solution?


#11

Copy the area with terracoppa, it will likely fix the bugged area.


#12

@andysks
I got files, found the problem. I sent the fix via PM.


#13

I haven’t tried it yet, but I will just in case I need it at a later project. For now, the area is fixed so I don’t need the workaround.


#14

I only used terracoppa once and I swore to never go back down that road :smiley:


#15

for future users with the same or a similar problem it would be really helpful if you could describe what you did to fix the area. thank you.


#16

It was a corrupt TRN file for the area (the file size was 0). Luckily, a backup was available. So we replaced the corrupt file with the good one.


#17

As Travus said. I suspected a corruption from the start and thankfully it was the TRN file and not the TRX file as more work would be needed to bring it up to current standards.