Jump to content
Sign in to follow this  
vade_101

Getin eventhandler

Recommended Posts

I'm having some problems with the GetIn Eventhandler

at the moment the line in the .cpp reads:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

GetIn=  "if (player == _this select 0) then {_this exec  {\ukf_infantry\scripts\getin.sqs}}";

with getin.sqs just being:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

hint "Got In"

But at the moment, nothing seems to happen. no error messages, just a lot of inaction. any ideas?

Share this post


Link to post
Share on other sites

ya, you check in your condition if the player is the vehicle.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (player == _this select 2)...

should solve it

Share this post


Link to post
Share on other sites

tried it with

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">GetIn=  "if (player == _this select 2) then {_this exec  {\ukf_infantry\scripts\getin.sqs}}";

and still doesn't seem to do anything when entering the vehicle. i fell i must be doing something fundamentally daft.

the whole eventhandlers is:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class EventHandlers

{

Init="[_this select 0, 1] exec ""\ukf_infantry\scripts\ukf_init.sqs"";";

GetIn=  "if (player == _this select 2) then {_this exec  {\ukf_infantry\scripts\getin.sqs}}";

fired = " if ( (_this select 1 in

[{Throw},{JAM_AT4Launcher},{JAM_RPG7Launcher},{JAM_M72LAWLauncher}]) or (_this select 4 in [{JAM_MarkerGrenadeammo}]) ) then

{_this exec {\JAM_Magazines\FX\firedEH.sqs}}";

};

Share this post


Link to post
Share on other sites

Do any of your eventhandlers get called? Im curious about the placement of your eventhandlers as it needs to tree off of the cfgvehicles

Share this post


Link to post
Share on other sites

Yeah, the Init eventhandler works just fine .. i think i am doing something wrong, since i can't get the 'GetIn' eventhandler to work in the mission editor either...

Share this post


Link to post
Share on other sites

Oh I just noted some more issue.

Try:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">GetIn= "if (player == _this select 2) then {[_this] exec {\ukf_infantry\scripts\getin.sqs}}";

Share this post


Link to post
Share on other sites

Again doesn't seem to do anything sad_o.gif has anyone used GetIn before to do anything?

Perhaps it would be clearer if i said what i was trying to do, my models have removeable helmets based on the KMARNS system, and in common with those addons have the problem whereby the helmet, chinstraps &c. (all the inward facing items that are textured by "setobjecttexture") on the head are visible when the unit enters a vehicle, what i'm trying to do is detect when the unit is in a vehicle (and is the player), pausing the main helmet/on off scripy and hiding the relevant faces. once the player leaves the vehicle - i'll restart the script again. i thought the GetIn eventhandler would work best for this, but if anyone has any other suggestions i should be very glad to hear them smile_o.gif

Share this post


Link to post
Share on other sites

ahhh, there is the problem. The Getin EH only works for vehicles in which soldiers getin, like trucks and such. So we have here the issue that noones will ever getin the soldier (except some bullets.. but those don't count).

You might do it over a surveillance script, which checks every 10 or so seconds if the player is in a vehicle or not.

Share this post


Link to post
Share on other sites

got you, thats a pretty fundamental misunderstanding. thank you smile_o.gif

would you have any idea what the code for checking if the player is in a vehicle is?

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Player != vehicle Player will return true when the player is in a vehicle.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×