Jump to content
Official BF Editor Forums

Vehicle Spawn Event?!


Krauzi
 Share

Recommended Posts

Hi guys,

yeah back now after a (or two?!) years absence of bf2 modding but with quite a lot experience in coding ( C++ [especially python's C-API] and python ).

So now about my "start"-project:

Pilot script again :)

The last project i was working on was a pilot script which allowed only ppl with a certain kit to enter a certain vehicle (worked with engine disable).

But my idea is to disable not only the engine but the entrypoints (so entering isn't even longer possible). This will work quite well on game loading (i iterate through all available vehicles and disable all the entrypoints). But the problem is that if the vehicle is destroyed and another one spawns i cannot disable the entrypoints any more (i cant detected weather i vehicle spawns).

So my question: Anyone knows a good way to detect new spawned vehicles?

A check with a timer won't make any sense here because (if you do a global vehicle check e.g. every 0.1 secs) it'll cause horrible lags.

Link to comment
Share on other sites

Actually, checking every 0.1 seconds isn't too bad at all. Have it do a check for all vehicles of types you list in a tuple somewhere, and then if the list is different it can process the list and find which is new - and that will be the new vehicle. Make sure it ignores vehicles at postion (0.0,0.0,0.0) - because those ones are just cached and not actually on the map, and since BF2 recycles IDs they will interfere otherwise.

Edited by UberWazuSoldier
Link to comment
Share on other sites

Look into my package: http://www.bfeditor.org/forums/index.php?showtopic=14375 :)

There is a function like this one what you are looking for. (Without lags)

please a bit more exactly. I dont want to look through the whole code....

@UberWazuSoldier:

I'm interested in this too. Do you have any idea how this can work WITHOUT python and then server side (arent all the *.con executed client side?!)?

Link to comment
Share on other sites

I'm interested in this too. Do you have any idea how this can work WITHOUT python and then server side (arent all the *.con executed client side?!)?

Dynamic lights attached to a rotation bundle and have the whole map dark as default maybe?

The lights can be created with python, but can they be tweaked to have a larger glow radius/intensity?

@ 2:18 in this video

Link to comment
Share on other sites

Instead of disabling vehicles when they spawn, why not just disable them directly in the .cons/tweaks. Then all you would need is a trigger on each vehicle that would check if the player is in the radius and has the correct kit and then enable it.

This triggers can only (as far as i know) be set with python. This works well for static objects like map flags are and this is also used for the flag overtaking logic (see scoringCommon.py)

Link to comment
Share on other sites

please a bit more exactly. I dont want to look through the whole code....

@UberWazuSoldier:

I'm interested in this too. Do you have any idea how this can work WITHOUT python and then server side (arent all the *.con executed client side?!)?

I actually talked with him on Xfire for a while, and it's being done via PR.exe. So no, it's still not really possible with the bf2 engine alone.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...