Bezier Waypoint creator
Blitz3D Forums/Blitz3D Beginners Area/Bezier Waypoint creator
| ||
Hi all, can someone help me work on a waypoint creator, and make it read all the coordinates from data statements? Here's a modified version of the 3D Bezier object waypoint code: Thanks! :) |
| ||
hi the example of the Path Following System i've posted does exactly this. As i see, the only modification you did in the example is to incorporate a camera that follows the "Viajero" and changed the x,y,z values for the waypoints. So, if the example READS all the coordinates from DATA statments already, what are you asking for? btw it should be good that you mention the autor of the code you use/post, it's ok, is from the Code Archives and is Public Domain, but i think that isn't much to ask. I'm pleased if that code fullfill your needs. regards Juan |
| ||
What im asking for is a waypoint system i can press a button, it creates a waypoint, and adds an interpolation bezier line to 2 connected waypoints. which then allows for you to save or load them, and the player follows them. Kinda like a drag and drop system :) |
| ||
building your drag'n drop system isn't imposible but i gess that it will be better, at first, for you to use some World Editor/Creator to place objects that you will then use as WayPoints. If you want, download AWC (follow my signature) and see the "awc demo4.bb" wich loads "awc path demo.awc", using the editor and pressing F7 you can see the WayPoints linked with lines as a helper function, then you can use the Path Following System to interpolate between them (see the demo) regards Juan |
| ||
how do i create waypoints with this and save them to a file? |
| ||
Nvm, thanks Charrua. This editor works like a beauty! =D |
| ||
i'been out for a while, thank's simply without any selected objects, RightClick and Select Path Choose a name for it, and place the first WayPoint, then move the mouse pointer and Ctrl+C to place as many WP as needed, Press F7 if you want to see Red Lines between the WayPoints. Read Page 6 of the companion document, but i think i'm late. Juan |
| ||
thanks ALOT, Charrua. Ur a lifesaver! =D |
| ||
I get a memory access violation when I try to paste a waypoint using Control-V :( |
| ||
me to! a bug, sorry try this: https://sites.google.com/site/odriozolajuanignacio/awcexe.zip?attredirects=0&d=1 i updated only the exe Juan |
| ||
YAY! It works! =D Is there a way I can move a waypoint with the keys rather than the mouse for more precise positioning? |
| ||
no, but i think you have "Snap to grid" on, deactivate it (press space) or use the text input on the properties window to manually set the position. Juan |
| ||
thanks, and just a tip, i think it would make it MUCH easier on most ppl if you could A) make it so that keys can move waypoints and objects (arrow keys), and B) NOT resetting the snap to grid function every time you make a new object by copying an old object and pasting it (i noticed it went from Freely back to Snap to grid), other than that, its WONDERFUL! =D |
| ||
Charrua, ALSO, WITH the above, how would I detect which waypoint my player is at? So I can use a command to make him stop for a minute, think, then walk to the next waypoint? |
| ||
Also, there's a Memory Access Violation when I hold Control and Press A (Select All) :( |
| ||
updated "awc exe.zip", same link of post #10 the function PathNextPos() is the one that recalculates the new position in the path, you can evaluate if it's necesari to call or not this function. Each tWayPoint object may include some extra fields to meet your needs, you can add an wpNumber or Name (that matches with te one you give inside the editor) then in the main loop you can call PathCurrWP to get the Current tWayPoint object and retrieve from it the Number, Name or whatever you added. Conditionally you may sept the path or not... Juan |
| ||
awesome! Works like a charm! Thanks =D Also, you wouldnt happen to know the formula to position an object away from a certain object using random math to randomize the X & Z value of the objects around the object? Example: I don't want trees randomly generating in my castle, what can I do so this won't happen? tx# = rnd(-1700, 1700) tz# = rnd(-1700, 1700) ty# = terrainy(blah) if tx# > -1700-meshwidth(castle)? then tx# = -1700-meshwidth(castle)? if tz# > -1700-meshdepth(castle)? then tz# = -1700-meshwidth(castle)? if tx# < 1700+meshwidth(castle)? then tx# = 1700+meshwidth(castle)? if tz# < 1700+meshdepth(castle)? then tz# = 1700+meshdepth(castle)? Something like the above. I've tried the above already, but it's still creating trees sometimes INSIDE my castle. i want it to create trees AROUND the castle :) Thanks, Charrua! =D Last edited 2011 |
| ||
MeshWidht, Height and Depth reports correct values if you scale the Castle with ScaleMesh, if not any comparation you made with them may result in incorrect or unespected results. Juan |
| ||
@Charrua, how do I load a heightmap into the editor WITHOUT it being flat? |
| ||
normally you have to scale the heightmap in the Y axis: ScaleY |
| ||
Yep, Rez is back alright. *sigh* Thanks Charrua for your generosity. I plan on trying to use your code to generate splined attack paths for a shoot-em-up. Given I've never done anything like that before I look forward to trying to work it out. A bit of brain-burning for me to look forward to, I think. :) |
| ||
Yup, I'z back :P And yes, thanks Charrua! :) |
| ||
@LineOf7s one thing you should may consider, if interpolation wastes to much time, is use the system to precalculate interpolated points and store them in Arrays or typed variables and then use the precalculated values instead of calling the system to do so. juan |
| ||
Thanks for the tip, Charrua, that sounds like a totally sensible thing to do if the paths never change (like the sort of paths enemies might take in a shoot-em-up). |
| ||
updated "awc exe.zip", same link of post #10 the function PathNextPos() is the one that recalculates the new position in the path, you can evaluate if it's necesari to call or not this function. Each tWayPoint object may include some extra fields to meet your needs, you can add an wpNumber or Name (that matches with te one you give inside the editor) then in the main loop you can call PathCurrWP to get the Current tWayPoint object and retrieve from it the Number, Name or whatever you added. Conditionally you may sept the path or not... Oh yep, truly awesome! Going to have a play today ;) |
| ||
Can someone make it so you can drag/drop waypoint, drag/drop the bezier line, add new waypoints, connect 2 or more waypoints together? Thank You! :) |