pete_smith1229 Posted October 22, 2023 Share Posted October 22, 2023 I've started looking into creating new traps and containers for various areas. But when I enter the coordinates of the vertices which are clearly within the map constraints of the area, for whatever reason, the coordinates warp to some other values. Clearly I'm doing some wrong. I noticed various parameters for coordinates but I'm not exactly sure what they all mean. Here are the parameters I noticed using NI: Location X Location Y ... Bounding Box Left Bounding Box Top Bounding Box Right Bounding Box Bottom ... First vertex index ... Vertex X:0 Y:0 ... I assume that: - The vertex are simply the XY coordinates of a pixel on the map. - The bounding box is the min/max coordinates of the X and Y direction (i.e. Left = Xmin; Right = Xmax; Top = Ymin; Bottom = Ymax) So what are the "Location" and "First vertex index"? I've seen the first vertex index with a value like 149 even though there were only ~70 vertices in total... Quote Link to comment
lynx Posted October 22, 2023 Share Posted October 22, 2023 Location is the position of the container. Think of it as the centroid, though it doesn't have to be. In fact, it can be outside the bounding box. Vertex coordinates are normal coordinates, yes. "First vertex index" I never had to set before. It should be the index into the areas vertex region of the format, where all of them are bunched up (that's why you can get oddly high numbers). https://gibberlings3.github.io/iesdp/file_formats/ie_formats/are_v1.htm Bounding box aliases look fine as well. Quote Link to comment
pete_smith1229 Posted October 22, 2023 Author Share Posted October 22, 2023 @lynx Thanks for the info and for confirming my assumptions! I'm still not quite sure why the vertices tend to change to other numbers but I'll continue to play around. Quote Link to comment
jmerry Posted October 22, 2023 Share Posted October 22, 2023 If you're looking to add a structure like this in WeiDU, you'll use the fj_are_structure function - built in, so you don't need to include any extra libraries. The WeiDU documentation includes a section on the function. You won't need to worry about that "first variable index" as the function handles the indexing for you. You will need to give the vertices of the region your new structure uses to the function as parameters; those aren't in the main structure itself, but are instead in the big list of vertices at the end of the ARE file. Quote Link to comment
pete_smith1229 Posted October 22, 2023 Author Share Posted October 22, 2023 @jmerry Thanks, once I've gotten the hang of the parameters manually, I'll definitely check out automating this as I have done with other stuff. Quote Link to comment
pete_smith1229 Posted October 23, 2023 Author Share Posted October 23, 2023 Thanks again @jmerry, I used the function you referenced for Weidu to automatically place a generic container on a painting in the Temple of Tempus. I wrote it so that I can simply add the XY coordinate of the point I want and the script does some simple arithmetic to create an oddly-shaped box without me having to fill in the rest of the parameters. This is exactly what I wanted as I can now populate other areas with simple containers. The simple script: BEGIN ~Add CONTAINERS TO AREAS~ COPY_EXISTING AR1001.ARE override LPF fj_are_structure INT_VAR left_x = 710 top_y = 360 fj_type = 8 //nonvisible fj_loc_x = left_x + 8 fj_loc_y = top_y + 32 fj_box_left = left_x - 1 fj_box_top = top_y fj_box_right = left_x + 11 fj_box_bottom = top_y + 10 fj_vertex_0 = (left_x) + (top_y << 16) fj_vertex_1 = (left_x - 1) + (top_y + 6 << 16) fj_vertex_2 = (left_x + 9) + (top_y + 10 << 16) fj_vertex_3 = (left_x + 11) + (top_y + 1 << 16) STR_VAR fj_structure_type = container fj_name = ~Container~ END LPF fj_are_structure INT_VAR fj_con_itm_idx = SHORT_AT 0x74 - 1 // a new container will be last in the file fj_flags = 1 // identified STR_VAR fj_name = RB_ITM01.itm // Name of item incl. extension for custom items fj_structure_type = itm END Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.