Alef/JIP – User
Jump to navigation
Jump to search
m (→testing JIP) |
m (→sleep 1) |
||
Line 54: | Line 54: | ||
isNull _u ; isNull player ; | isNull _u ; isNull player ; | ||
name p = Roberto Duarte ; name _u = Error: No vehicle ; name player = Error: No vehicle ; | name p = Roberto Duarte ; name _u = Error: No vehicle ; name player = Error: No vehicle ; | ||
</pre> | |||
Output (edited) on JIP, using sleep 1:<pre> | |||
isNull _u ; isNull player ; | |||
name p = Roberto Duarte ; name _u = Error: No vehicle ; name player = Error: No vehicle ; | |||
sleep 1; | |||
local p ; local _u ; local player ; | |||
isPlayer p ; isPlayer _u ; isPlayer ; | |||
name p = alef (2) ; name _u = alef (2) ; name player = alef (2) ; | |||
</pre> | </pre> |
Revision as of 19:49, 14 April 2009
JIP test
// JIP test only. Put "p" as variable name in mission.sqm for JIP player. #define TEST( xx ) if ( xx ) then { _s=_s+ #xx +" ;" }; #define PRINT( xx ) _s=_s+ #xx + " = " + xx +" ;" ; _s="init.sqf\n"; for [{ _x=0 },{ _x<2 },{ _x=_x+1 }] do { _u=player; // isNull // this happens in JIP if no sleep are performed before. TEST( isNull p ) TEST( isNull _u ) TEST( isNull player ) _s=_s+"\n"; // locality // get player dereferenced? is only the pointer tested? TEST( local p ) TEST( local _u ) TEST( local player ) _s=_s+"\n"; // isPlayer // should this check if a unit is pointed by player? TEST( isPlayer p ) TEST( isPlayer _u ) TEST( isPlayer player ) _s=_s+"\n"; // name // the root of all this, see ace/xeh bug PRINT( name p ) PRINT( name _u ) PRINT( name player ) _s=_s+"\nsleep 0.001;\n"; sleep 0.001; }; hint _s; localize _s;
Output (edited) on hosting game:
local p ; local _u ; local player ; isPlayer _u ; isPlayer player ; name p = Roberto Duarte ; name _u = alef ; name player = alef ; sleep 0.001; local p ; local _u ; local player ; isPlayer _u ; isPlayer player ; name p = Roberto Duarte ; name _u = alef ; name player = alef ;
Output (edited) on JIP:
isNull _u ; isNull player ; name p = Roberto Duarte ; name _u = Error: No vehicle ; name player = Error: No vehicle ; sleep 0.001; isNull _u ; isNull player ; name p = Roberto Duarte ; name _u = Error: No vehicle ; name player = Error: No vehicle ;
Output (edited) on JIP, using sleep 1:
isNull _u ; isNull player ; name p = Roberto Duarte ; name _u = Error: No vehicle ; name player = Error: No vehicle ; sleep 1; local p ; local _u ; local player ; isPlayer p ; isPlayer _u ; isPlayer ; name p = alef (2) ; name _u = alef (2) ; name player = alef (2) ;