• Content Count

  • Joined

  • Last visited

  • Days Won


Viking last won the day on May 23

Viking had the most liked content!

Community Reputation

28 Excellent


About Viking

  • Rank
    Senior Member

Recent Profile Visitors

1633 profile views
  1. What did you do to fix it? Your solution might help others with similar problems.
  2. @leiizko Do you have an idea how i could debug the path finding? I modified the rotu.lua and astar.lua a bit so they return the full path as well, not the next step only. That way i am able to check the path calculation which works correct. However, during the movement of the bots they get stuck every now and then and shuttle between the same two waypoints. I have no idea why they (randomly?) return to a previous waypoint - i mean... a previous waypoint can not have a lower f value, can it? I am really lost here
  3. I don't think so. But some parts in the menu source are changeable. Not sure which, but maybe the team names are one of them.
  4. Either replace the paceholder with the plain string, then you can add ^ but you will loose the translation for games in other languages. Or (when you have access to the source) you modify the menu.
  5. Quite old topic, but it's still about this. How would the example look like, when i have an array inside an array? E.g. a simple list holding the spawns. (not sure if this example is accurate, but i think you get what i need) struct spawns { float origin[3]; short id; char type[1024]; }; The origin would be a "subarray" of the array spawns, but how can i send that to cod4 now? Plugin_Scr_MakeArray(); // init the array for( i = 0; i < spawns_array_size; i++ ) { Plugin_Scr_Add????( spawns_array[i] ); // add the value Plugin_Scr_AddArray(); // push onto the array } These array functions are really hard to understand I also found Plugin_Scr_AddArrayKeys but couldn't find an explanation for it.
  6. I tweaked the loop a bit and was able to reduce the time a bit, but not very much. Your solution with the dump is perfect. My dump now looks like the default waypoint.csv rotu is looking for. Howevery, i don't get the rotu.lua and astar.lua to work. Following the readme on your github page i put the files into: cod4xserver/lua_scripts And load rotu.lua from server.cfg with: loadplugin lua // script is located in fs_homepath/lua_scripts //lua_loadscript "lua_scripts/astar.lua" lua_loadscript "lua_scripts/rotu.lua" lua_loadscript "lua_scripts/lua_navmesh_import.lua" But the server returns an error when starting: Plugin lua loaded successfully. Server is currently running 1 plugins. ****************** Lua Error: ****************** lua_scripts/rotu.lua:1: module 'astar' not found: no field package.preload['astar'] no file './astar.lua' no file '/usr/local/share/luajit-2.1.0-beta3/astar.lua' no file '/usr/local/share/lua/5.1/astar.lua' no file '/usr/local/share/lua/5.1/astar/init.lua' no file './' no file '/usr/local/lib/lua/5.1/' no file '/usr/local/lib/lua/5.1/' stack traceback: [C]: in function 'require' lua_scripts/rotu.lua:1: in main chunk ************************************************ Adding a plugin script function for plugin 0, command name: lua_createNavMeshFile. Adding a plugin script function for plugin 0, command name: lua_loadWaypoints. lua_loadscript: Successfully started lua script lua_scripts/lua_navmesh_import.lua I have no clue why it does not find the astar.lua because it's in the same dir as rotu.lua Uncommenting the scriptload of astar.lue in cfg ends in the same error. edit: solved problem was that lua was looking for the file in "./" which is the cod4xserver root folder. i use now, which works.
  7. That was an easy one, thanks. I ran into a new problem now and can't think of a better solution. This is the background: I do not use waypoints that have predefined children. What i did was creating a "simplyfied" navmesh in radiant where a lot of small rectangles are next to each other. Now i would like the code to check if two of these rectangles are next to each other. If so they are defined as neighbours (children in the current waypoint codes) Now the problem: Right now the map has 9705 of this rectangles (map not even fully covered yet). The loop is checking every rectangle against the other rectangles before it moves over to the next rectangle and again checks this one against all other existing rectangles. The whole procedure takes about 15 minutes. This is not very smart and i can't imagine the players would stay on the server when every map start takes that amount of time. This is the gsc snippet i have //create neighbours for(i=0;i<level.vertex.size;i++) { for(j=0;j<level.vertex.size;j++) { if(j == i) continue; sharedEdges = 0; for(k=0;k<level.vertex[j].edges.size;k++) { for(l=0;l<level.vertex[i].edges.size;l++) { if(Distance(level.vertex[i].edges[l], level.vertex[j].edges[k]) < 2) { sharedEdges++; //if they share two edges then they are neighbours if(sharedEdges >= 2) { level.vertex[i].nghbr[level.vertex[i].nghbr.size] = level.vertex[j]; break; } } } } } }
  8. i am stuck a bit and need a helping hand to guid me into the right direction. in gsc i have level.waypoints[curEntry] = spawnStruct(); level.waypoints[curEntry].wpIdx = curEntry; level.waypoints[curEntry].nghbr = []; how can i achieve this in lua? i always get an error "attempt to index a nil value" at waypoints[curEntry].wpIdx = curEntry but waypoints is gloabally defined as table {} and curEntry is an integer (checked with a print). So I guess lua can not handle the var dot subvar any advice would be great :)
  9. No, it's just for the map in am working on. But you can create your own waypoints for the usermaps you want to run. It's a pain and takes a lot of time but it's possible. Just check the devtools of the latest pezbot release. You have to run through the map and place/connect the waypoints manually. Once you are done you can save them and do an exportiert to the console log. This one is a tutorial for a different mod, but except the controls it looks like the System of pezbot and basically every bot System that requires waypointy.
  10. That's great to hear. 😊 To be honest i never worked with lua before, but i give it a try. Thank you
  11. Hey guys, hey @leiizko i had a look into the lua plugin + scripts for the rotu mod. Within the waypoints.gsc there was and after the changes for the lua plugin still is this part: loadWaypoints() { [...] bla bla [...] level.waypointCount = int( tableLookup(fileName, 0, 0, 1) ); for( i=0; i<level.waypointCount; i++ ) { waypoint = spawnStruct(); origin = TableLookup(fileName, 0, i+1, 1); orgToks = strtok( origin, " " ); waypoint.origin = ( float(orgToks[0]), float(orgToks[1]), float(orgToks[2])); level.waypoints[i] = waypoint; } for( i=0; i<level.waypointCount; i++ ) { waypoint = level.waypoints[i]; strLnk = TableLookup(fileName, 0, i+1, 2); tokens = strtok(strLnk, " "); waypoint.childCount = tokens.size; for( j=0; j<tokens.size; j++ ) waypoint.children[j] = int(tokens[j]); } [...] bla bla [...] } Am i right, that the array of they waypoints (level.waypoins) is still created and stored in gsc? Is there any way to create and store the waypoint array in lua too? I am asking because i am working on a project that currently has about 1.000 waypoints and that ends in a variable overflow. To keep the movement nice and smooth i would like to stick to my waypoints, i could not reduce them much anyways because the map is giant. Thanks Viking
  12. Viking

    FOV configuration

    Add it to your config and make the config write protected.
  13. Did you set the fs_basepath correctly? That looks really weird. Edit: Could also be a problem of the Permissions because it starts to recover after failing to create a backup file.
  14. Viking

    Bots help

    After spawn of the bot i would check if it has an rpg (bot hasWeapon("rpg_mp") and if so i would remove the weapon (bot takeWeapon("rpg_mp") and just to be sure the perk as well (bot unsetPerk("rpg_mp"). I am not sure about the name of the perk but i think it's named like the weapon. Maybe a little wait is required before you check for the rpg, depends on how fast the class loadout is.