Alef/Sandbox – User
< Alef
Categories:
mNo edit summary |
mNo edit summary |
||
| Line 20: | Line 20: | ||
<pre> | <pre> | ||
// JIP test only. Put "p" as variable name in mission.sqm for JIP player. | // JIP test only. Put "p" as variable name in mission.sqm for JIP player. | ||
_u=player; // this is a copy of the "player" pointer | _u=player; // this is a copy of the "player" pointer, or get dereferenced when isNull player ? | ||
// don't write in .rpt, I'm using the same in two instances, unsafe. | // 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. | // global chat seems to miss some messages while JIPing, rely on "hint" only. | ||
| Line 27: | Line 27: | ||
#define PRINT( xx ) _s=_s+(xx)+" ;" ; | #define PRINT( xx ) _s=_s+(xx)+" ;" ; | ||
// isNull | // isNull | ||
// this happens in JIP if no sleep are performed before. | |||
TEST( isNull p ) | TEST( isNull p ) | ||
TEST( isNull _u ) | TEST( isNull _u ) | ||
| Line 32: | Line 33: | ||
// locality | // locality | ||
// get player dereferenced? is only the pointer tested? | |||
TEST( local p ) | TEST( local p ) | ||
TEST( local _u ) | TEST( local _u ) | ||
| Line 37: | Line 39: | ||
// isPlayer | // isPlayer | ||
// should this check if a unit is pointed by player? | |||
TEST( isPlayer p ) | TEST( isPlayer p ) | ||
TEST( isPlayer _u ) | TEST( isPlayer _u ) | ||
TEST( isPlayer player ) | TEST( isPlayer player ) | ||
// name | // name | ||
// the root of all this, see ace/xeh bug | |||
PRINT( name p ) | PRINT( name p ) | ||
PRINT( name _u ) | PRINT( name _u ) | ||
PRINT( name player ) | PRINT( name player ) | ||
hint _s; | |||
</pre> | </pre> | ||
Revision as of 15:55, 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, or get dereferenced when isNull player ?
// 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
// this happens in JIP if no sleep are performed before.
TEST( isNull p )
TEST( isNull _u )
TEST( isNull player )
// locality
// get player dereferenced? is only the pointer tested?
TEST( local p )
TEST( local _u )
TEST( local player )
// isPlayer
// should this check if a unit is pointed by player?
TEST( isPlayer p )
TEST( isPlayer _u )
TEST( isPlayer player )
// name
// the root of all this, see ace/xeh bug
PRINT( name p )
PRINT( name _u )
PRINT( name player )
hint _s;
class Missions { class Mission0 {
template=Mission0.Sara;
param1=1;
param2=2;
cadetMode=0;
};