Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!
Quick links for Beyond New Horizons
- Download latest version
- Wiki
- FAQ
- Report bugs here
- Bug Tracker on Github
Quick links for Maelstrom
- Download the latest version of Maelstrom
- Download the latest version of ERAS II
- Download the latest version of New Horizons on Maelstrom
Quick links for PotC: New Horizons
- Download latest version
- Wiki
- FAQ
- Report bugs here
Thanks to YOUR votes, GOG.com now sells:
- Sea Dogs
- Sea Dogs: Caribbean Tales
- Sea Dogs: City of Abandoned Ships
Vote now to add Pirates of the Caribbean to the list!
Quick links for AoP2: Gentlemen of Fortune 2
- Downloads and info
- ModDB Profile
- Forums Archive
A Pirate Podcast with Interviews
Music, Comedy and all things Pirate!
- Episode Guide - About - Subscribe -
- Twitter - Facebook - iTunes - Android -
- Youtube - Fill the Coffers -
case "dagger_3":
LAi_ActorAnimation(characterFromID("blaze"), "Lay_1", "", -1);
LAi_SetPlayerType(characterFromID("danielle"));
SetMainCharacterIndex(GetCharacterIndex("danielle"));
PChar = GetMainCharacter(); // PB: This is IMPORTANT to update that you are now 'Danielle'!
ChangeCharacterAddress(characterFromID("Blaze"), "Rheims_house_inside", "goto5");
DoQuestReloadToLocation("Rheims_house_inside", "item", "item1", "start_quest_movie_speak_with_rheims_complete");
pchar.quest.main_line = "danielle_speak_with_almost_dead_rheims";
locations[FindLocation("Douwesen_town_exit")].reload.l1.disable = 0;
locations[FindLocation("Douwesen_town_exit")].reload.l2.disable = 0;
break;
SetModelfromArray(PChar, GetModelIndex("Wellard_18"));
PChar.name = "Jack";
PChar.lastname = "Hammond";
SetModelfromArray(PChar, GetModelIndex("brtHComdr_18"));
PChar.name = "Horatio";
PChar.lastname = "Hornblower";
Maybe I found a way out. Tomorrow I'll check. And I will report the result.
//Test swap with my officer, PSHero_115
int testChar = GetCharacterIndex("PSHero_115"); //Get my officer by id
int oldMain = nMainCharacterIndex;
LogoffCharacter(&characters[testChar]);
LogoffCharacter(&characters[oldMain]);
SetMainCharacterIndex(testChar);
PChar = GetMainCharacter();
LAi_SetPlayerType(PChar);
LAi_SetOfficerType(&characters[oldMain]); //This is hero index, switching with my officer
LoginCharacter(&characters[testChar], loadedLocation.id);
LoginCharacter(&characters[oldMain], loadedLocation.id);
locCameraTarget(&characters[testChar]);
locCameraFollow();
Funny thing is since I don't set everything needed in this small example, all my officers run away to some random spot because they presumably have some other attribute for the character they are supposed to follow, which has obviously changed...it just looks funny to me when they immediately scatter upon the switch.
Maybe I found a way out. Tomorrow I'll check. And I will report the result.
//Test swap with my officer, PSHero_115
int testChar = GetCharacterIndex("PSHero_115"); //Get my officer by id
int oldMain = nMainCharacterIndex;
int ldLoc = FindLoadedLocation();
SendMessage(&Locations[ldLoc], "l", MSG_LOCATION_SETCHRPOSITIONS); // This message actually just stores current character coordinates in a .saveposition attribute for all chars in location...nothing else. But now we can retrieve them.
object aChr, bChr;
aChr.x = characters[testChar].saveposition.x;
aChr.y = characters[testChar].saveposition.y;
aChr.z = characters[testChar].saveposition.z;
aChr.ay = characters[testChar].saveposition.ay;
bChr.x = characters[oldMain].saveposition.x;
bChr.y = characters[oldMain].saveposition.y;
bChr.z = characters[oldMain].saveposition.z;
bChr.ay = characters[oldMain].saveposition.ay;
LogoffCharacter(&characters[testChar]);
LogoffCharacter(&characters[oldMain]);
SetMainCharacterIndex(testChar);
PChar = GetMainCharacter();
LAi_SetPlayerType(PChar);
LAi_SetOfficerType(&characters[oldMain]); //This is hero index, switching with my officer
LoginCharacter(&characters[testChar], loadedLocation.id);
LoginCharacter(&characters[oldMain], loadedLocation.id);
TeleportCharacterToPosAy(&characters[testChar], stf(aChr.x), stf(aChr.y), stf(aChr.z), stf(aChr.ay));
TeleportCharacterToPosAy(&characters[oldMain], stf(bChr.x), stf(bChr.y), stf(bChr.z), stf(bChr.ay));
locCameraTarget(&characters[testChar]);
locCameraFollow();
Expanded example to show what I'm talking about the teleport:
Code://Test swap with my officer, PSHero_115 int testChar = GetCharacterIndex("PSHero_115"); //Get my officer by id int oldMain = nMainCharacterIndex; int ldLoc = FindLoadedLocation(); SendMessage(&Locations[ldLoc], "l", MSG_LOCATION_SETCHRPOSITIONS); // This message actually just stores current character coordinates in a .saveposition attribute for all chars in location...nothing else. But now we can retrieve them. object aChr, bChr; aChr.x = characters[testChar].saveposition.x; aChr.y = characters[testChar].saveposition.y; aChr.z = characters[testChar].saveposition.z; aChr.ay = characters[testChar].saveposition.ay; bChr.x = characters[oldMain].saveposition.x; bChr.y = characters[oldMain].saveposition.y; bChr.z = characters[oldMain].saveposition.z; bChr.ay = characters[oldMain].saveposition.ay; LogoffCharacter(&characters[testChar]); LogoffCharacter(&characters[oldMain]); SetMainCharacterIndex(testChar); PChar = GetMainCharacter(); LAi_SetPlayerType(PChar); LAi_SetOfficerType(&characters[oldMain]); //This is hero index, switching with my officer LoginCharacter(&characters[testChar], loadedLocation.id); LoginCharacter(&characters[oldMain], loadedLocation.id); TeleportCharacterToPosAy(&characters[testChar], stf(aChr.x), stf(aChr.y), stf(aChr.z), stf(aChr.ay)); TeleportCharacterToPosAy(&characters[oldMain], stf(bChr.x), stf(bChr.y), stf(bChr.z), stf(bChr.ay)); locCameraTarget(&characters[testChar]); locCameraFollow();
Now the characters stay exactly where they were during the switch. Sad thing is now my other officers no longer scatter, either, LOL
But this technically involves two teleports for each of the characters, because there is a teleport call in LoginCharacter(). This is why I suggest making a copy of that function, but add 4 more parameters, so you instead do this:
LoginCharacterToPos(&characters[oldMain], loadedLocation.id, stf(bChr.x), stf(bChr.y), stf(bChr.z), stf(bChr.ay));
And inside your new LoginCharacterToPos() function, change the TeleportCharacterToLocator call to TeleportCharacterToPosAy. That way you don't need to teleport twice and can remove the TeleportCharacterToPosAy calls in my example, once you switch out to the new LoginCharacterToPos you make.