Posted By: Superku
Tip of the Week #10: New Pathfinding Solution! - 01/03/14 06:27
A new tip of the week has arrived which is basically just a contribution. It's a new pathfinding solution written from scratch - although similar to my last one from the goodies.zip archive it has many advantages such that it does not need to pre-calculate all paths in a level (and store all those nasty text files in your game folder), that those paths can be changed dynamically (for example when a gate opens), that you don't have to attach a path manually to the entity and that it is in general much more flexible.
See here, TotW #10 (fixed link): http://opserver.de/swik10/index.php?title=Pathfinding
The usage is as simple as follows:
It is just the first version of the script completed minutes ago so please notify me of any bugs that you may find.
There is a newer version/ update which you can find below.
See here, TotW #10 (fixed link): http://opserver.de/swik10/index.php?title=Pathfinding
Originally Posted By: TotW #10
The idea behind this pathfinding script is to use regions (optional but highly recommended!) and WED paths and to divide the level into small logical segments. Those segments can be corridors, houses, hangars and so on. See the following screenshot:
The usage is as simple as follows:
Code:
action enemy() { while(1) { VECTOR temp; hpf_region_get_target(temp,my,player.x,HPF_XYZ); turn to temp; move to temp; wait(1); } }
It is just the first version of the script completed minutes ago so please notify me of any bugs that you may find.
There is a newer version/ update which you can find below.