Alangara_PRC8/_module/nss/mn_dblocation.nss

30 lines
1.0 KiB
Plaintext
Raw Permalink Normal View History

2024-06-05 21:21:06 -04:00
location mn_GetCampaignLocation( string database, string variabel, object oPlayer=OBJECT_INVALID)
{
location result;
// result = GetCampaignLocation( database, variabel, oPlayer );
string areaTag = GetCampaignString( database, "a_"+variabel );
object area = GetObjectByTag( areaTag );
vector position = GetCampaignVector( database, "p_"+variabel );
float facing = GetCampaignFloat( database, "f_"+variabel );
result = Location( area, position, facing );
return result;
}
void mn_SetCampaignLocation( string database, string variabel, location loc, object oPlayer=OBJECT_INVALID)
{
// SetCampaignLocation( database, variabel, loc, oPlayer );
// Alternativ til testning
string areatag = GetTag( GetAreaFromLocation( loc ) );
vector position = GetPositionFromLocation( loc ) ;
float facing = GetFacingFromLocation( loc );
SetCampaignString( database, "a_"+variabel, areatag );
SetCampaignVector( database, "p_"+variabel, position );
SetCampaignFloat( database, "f_"+variabel, facing );
}