Alef/Sandbox – User

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 16: Line 16:


JIP will not init player pointer until some time has elapsed.
JIP will not init player pointer until some time has elapsed.
What exaclty reports isPlayer then in that time?
What exaclty reports isPlayer then in that time? It seems "player" is not anytime dereferenced.
init.sqf:
<pre>
<pre>
init.sqf:
// JIP test only. Put "p" as variable name in mission.sqm for JIP player.
// JIP test
_u=player; // this is a copy of the "player" pointer (dereferenced?)
_u=player;
// don't write in .rpt, I'm using the same in two instances, unsafe.
_s=format["1:%1 2:%2 3:%3 4:%4",
// global chat seems to miss some messages while JIPing, rely on "hint" only.
isNull player,
_s="";
isPlayer player, // the pointer
#define TEST( xx ) if ( xx ) then { _s=_s+##xx+" ;" };
isPlayer _u, // the pointed object ?
#define PRINT( xx ) _s=_s+(xx)+" ;" ;
player,
// isNull
];
TEST( isNull p )
TEST( isNull _u )
TEST( isNull player )
 
// locality
TEST( local p )
TEST( local _u )
TEST( local player )
 
// isPlayer
TEST( isPlayer p )
TEST( isPlayer _u )
TEST( isPlayer player )
 
// name player
PRINT( name p )
PRINT( name _u )
PRINT( name player )
</pre>
</pre>


Line 37: Line 55:
};  
};  
</pre>
</pre>
autoexec?<br>
[[Image:Biki.png]][[Image:Biki.png]]<br>
[[Image:Biki.png]][[Image:Biki.png]]

Revision as of 13:00, 14 April 2009

Try setVehicleInit in "killed" EH.
addEventHandler "init" on createVehicle?
EH runs a {Code}, that means, sync. what if run sync {Code} in killed EH?

scriptsPath = "scripts\";
startupScript = "";
cameraScript = "";
playerKilledScript = "onPlayerKilled.sqs";
playerRespawnScript = "onPlayerRespawn.sqs";
playerRespawnOtherUnitScript = "onPlayerRespawnOtherUnit.sqs";
playerRespawnSeagullScript = "onPlayerRespawnAsSeagull.sqs";
playerResurrectScript = "onPlayerResurrect.sqs";
teamSwitchScript = "onTeamSwitch.sqs";

JIP will not init player pointer until some time has elapsed. What exaclty reports isPlayer then in that time? It seems "player" is not anytime dereferenced. init.sqf:

// JIP test only. Put "p" as variable name in mission.sqm for JIP player.
_u=player; // this is a copy of the "player" pointer (dereferenced?)
// don't write in .rpt, I'm using the same in two instances, unsafe.
// global chat seems to miss some messages while JIPing, rely on "hint" only.
_s="";
#define TEST( xx ) if ( xx ) then { _s=_s+##xx+" ;" };
#define PRINT( xx ) _s=_s+(xx)+" ;" ;
// isNull
TEST( isNull p )
TEST( isNull _u )
TEST( isNull player )

// locality
TEST( local p )
TEST( local _u )
TEST( local player )

// isPlayer 
TEST( isPlayer p )
TEST( isPlayer _u )
TEST( isPlayer player )

// name player
PRINT( name p )
PRINT( name _u )
PRINT( name player )
class Missions { class Mission0 {
  template=Mission0.Sara;
  param1=1;
  param2=2;
  cadetMode=0;
};