Author Topic: Patch submission: dynamic waypoints and waypoint removal  (Read 2355 times)

0 Members and 1 Guest are viewing this topic.

Patch submission: dynamic waypoints and waypoint removal
For my RTS Mod (see http://www.hard-light.net/forums/index.php?topic=81590.0) I need a way to issue movement orders to ships. I'm using waypoints but I'm limited to waypoint creation so with every movement order another set of waypoints is created. Eventually it hits the global object limit and can't go on.

I can only see two ways around it:

1. Dynamic waypoints: Fixing the problem that changing the position of a waypoint (which the game definitely does) isn't registered by the ai-code: http://scp.indiegames.us/mantis/view.php?id=2612
I think FREDers will profit as well if this is fixed cause they can reposition waypoints according to whatever happened in the mission (for example waypoints dependant on the players position).

2. Deleting waypoints: Adding a SEXP or scripting function to remove waypoints and waypoint-lists.

I hope one of these 2 variants is possible and there is a coder interested in doing it. I'm willing to help whereever I can (testing, ...)
« Last Edit: August 08, 2012, 06:15:41 am by Admiral MS »
Here goes scripting and copy paste coding
Freespace RTS Mod
Checkpoint/Shipsaveload script

 
Re: Patch submission: dynamic waypoints and waypoint removal
As it seems that no one is interested in this I figured I should try it myself. I made a removeWaypoint scripting function and a small addition to the set-object-position sexp so waypoint position changes are registered by ai code. I tested both and found no problems.

Both patches (against build 9096) are attached.
Cause i'm not sure if I failed at some naming conventions or broke some rules (especially for the removeWaypoint function), I hope a coder can give me feedback and commit one or both patches if they are good.

[attachment removed and sold on the black market]
« Last Edit: August 08, 2012, 06:39:51 am by Admiral MS »
Here goes scripting and copy paste coding
Freespace RTS Mod
Checkpoint/Shipsaveload script

 

Offline Echelon9

  • 210
Re: Patch submission: dynamic waypoints and waypoint removal
Thanks for contributing these draft patches.

I've updated the Mantis bug that relates to this issue here: http://scp.indiegames.us/mantis/view.php?id=2612 and set it to 'Code Review' so that comments can be sought from other SCP members.

If it gets the okay, or you can resolve any comments raised in feedback, we'll commit to SCP trunk.

 
Re: Patch submission: dynamic waypoints and waypoint removal
Seems like I failed to describe what patch is actually doing what  :rolleyes:

Only the dyn_waypoints.patch is related to the mantis issue and should fix it.

remove_waypoints.patch is a completely new scripting function and has nothing to do with the mantis bug.
Here goes scripting and copy paste coding
Freespace RTS Mod
Checkpoint/Shipsaveload script

 

Offline Echelon9

  • 210
Re: Patch submission: dynamic waypoints and waypoint removal
Mantis updated.

 

Offline m!m

  • 211
Re: Patch submission: dynamic waypoints and waypoint removal
Small note about the scripting function: Could you move the removeWaypoint function into the waypoit handle itself so you can call waypoint:remove() instead of mn.removeWaypoint(waypoint)?
I think that's how most of the other scripting functions are implemented and it would help keeping the API consistent.

 

Offline Swifty

  • 210
  • I reject your fantasy & substitute my own
Re: Patch submission: dynamic waypoints and waypoint removal
This seems to cause a crash when changing the position of a ship.

http://scp.indiegames.us/mantis/view.php?id=2612

EDIT: Crash has been fixed.
« Last Edit: August 17, 2012, 02:02:58 am by Swifty »