Larian Banner
Previous Thread
Next Thread
Print Thread
Joined: Jun 2017
Location: Idaho
enthusiast
OP Offline
enthusiast
Joined: Jun 2017
Location: Idaho
As you know, GM mode allows us to possess every single thing except for the player. I would like to possess the player just for experimentation and seeing what is possible by doing so.

Is it a flag or a script or something coded into the player character that makes it so it cannot be possessed? Is there some way to toggle this?


GMAddon1: Adds almost every single monster and NPC from the main campaign into GM mode, plus a few large custom maps to use in GM mode.
Joined: Sep 2017
Location: Belgium, Ghent
addict
Offline
addict
Joined: Sep 2017
Location: Belgium, Ghent
Code
void esv::GameMasterManager::Possess(esv::Character* character, net::UserID userId)
{
	LS_ASSERT(!character->IsFlag(CHAR_MULTIPLAYER), "We should not possess multiplayer character!");
	if (!character->IsFlag(CHAR_MULTIPLAYER))
	{
		esv::CharacterFactory::GetInstance()->PossessCharacter(character, userId);
		net::NetID netID = character->GetNetworkId();
		m_PossessedCharacters.AddUnique(netID);
	}
}


Player possession is blocked by checking the custom CHAR_MULTIPLAYER flag. You could add a script that removes that flag.


CTRL+K the elf
Joined: Sep 2017
R
apprentice
Offline
apprentice
R
Joined: Sep 2017
I have a similiar question: I want to go the other way round, and make monsters NOT possessible by the GM. According to your comment I tried the following gameScript, but it does not work (I used an inventory item tagged with "POSSESSABLE" to mark characters I would like to be able to possess):

Code
INIT

EVENTS
EVENT CombatStarted
VARS
	CHARACTER:_thisChar
	ITEM:_possesMeItem
ON
	OnEnteredCombat(_thisChar,_)
ACTIONS
	IF "(!c1)"
	    ItemGetFromInventory(_possesMeItem, _thisChar, null, "POSSESSABLE")
	THEN
		//DisplayText(_thisChar, "NOT possessable start", FLOAT:2.5)
		SetFlag(_thisChar, "CHAR_MULTIPLAYER")
	    CharacterItemEvent(_thisChar, null, "NotPossessable")
	ENDIF


I also added a story script (via that CharacterItemEvent call) and added the not possessable monsters as players via

Code
IF
CharacterItemEvent(_thisCharacter, _, "NotPossessable")
THEN
DB_IsPlayer(_thisCharacter);


This way, monsters were indeed not possessable anymore, but the AI was also disabled and the monsters did not attack anyone.

Any help?


Moderated by  Larian_KVN 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5