• Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Viking

  1. edit: Here is a simple code i use to check the actions... Would be great if we could get that fixed. init() { while(level.players.size < 2) wait 1; entity = level.players[0]; while(1) { wait .1; action = undefined; if( entity sprintButtonPressed() ) action = "sprint"; if( entity jumpButtonPressed() ) action = "gostand"; if( entity isCrouching() ) action = "gocrouch"; if( entity isProning() ) action = "goprone"; if( entity isinads() ) action = "ads"; if( entity meleeButtonPressed() ) action = "melee"; for(i=1;i<level.players.size;i++) { level.players[i] botMoveTo(entity.origin); level.players[i] botLookAt(entity.origin + (0,0,50)); } if(isDefined(action)) { iPrintlnbold(action); for(i=1;i<level.players.size;i++) level.players[i] botAction("+" + action); wait 3; for(i=1;i<level.players.size;i++) level.players[i] botAction("-" + action); } } }
  2. Also they do not want to sprint. Either i am doing something wrong or they just do not like to change their movement. Couch, prone and jump works btw.
  3. Here an untested but commented solution. Typed from phone so expect typos //add this if statement to the place where you start the camera from //i guess that will be the endGame function inside the globallogic //dvar to enable/disable the camera If(getDvarInt(„gameEndCam_enable“)) Path_to_file::endGameCamera(); //and put this into your new gsc for the camera Script endGameCamera() { //i use the spectator spawn as the start of the camera //i dont know the exact name of the spawn so replace the xxx spectatorSpawn = getEnt(„xxxx“, „classname“); //create the camera entity and assign the position and rotation of the spectator spawn to it Level.endGameCamera = spawn(„script_origin“, (0,0,0)); Level.endGameCamera.origin = spectatorSpawn.origin; Level.endGameCamera.angles = spectatorSpawn.angles; //loop through all players and move them to the camera For(i=0;i<level.players.size;i++) { Level.players[i] setOrigin(level.endGameCamera.origin); Level.players[i] setPlayerAngles(level.endGameCamera.angles); Level.players[i] linkTo(level.endGameCamera); } //move and rotate the camera //no idea what it is supposed to do… //also no idea how often you want the actions to happen so i use a loop with a life time of 5 seconds… For(j=1;j<=5;j++) ( //rotate camera (degree, seconds) Level.endGameCamera rotatePitch(360, 1); Level.endGameCamera rotateYaw(360, 1); Level.endGameCamera rotateRoll(360, 1); //move camera Level.endGameCamera moveX(50, 1); Level.endGameCamera moveY(50, 1); Level.endGameCamera moveZ(50, 1); Wait 1; ) //remove the camera Level.endGameCamera delete(); }
  4. Spawn an entity (like a script_origin) which is your fake camera. Then set the player(s) position to the position of the entity and link them to the entity. Finally move and rotate the entity the way you like it.
  5. You have to add the new gametype to the mod csv as well. rawfile,maps/mp/gametypes/_gametypes.txt rawfile,maps/mp/gametypes/ctf.txt rawfile,maps/mp/gametypes/ctf.gsc
  6. Hey guys, i noticed that the movement speed of the bot does not change when they go into ads. To confirm the bug i did two (simple) tests: 1. i added a little script that prints the velocity result: ads and normal movement velocity is the same 2. i modified an existing weapon file and change the adsMovementSpeed value to 0.1 result: real players slow down, bots don't For both tests i used the playerAds() function and went to spectators to confirm that the bots are really in ads. Edit: Not 100 percent sure, but i think they don't change the anim too. Best Regards
  7. Search for the weapon loadout Code inside your mod and add the perk loadout there.
  8. As far as i remember there are no global dvars to control it. You have to set it for each player through auf loop. But take a look into the vision files. Maybe it's possible with them (but i guess you have to use predefined values that can not change then)
  9. What did you do to fix it? Your solution might help others with similar problems.
  10. @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
  11. 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.
  12. 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.
  13. 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.
  14. 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.
  15. 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; } } } } } }
  16. 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 :)
  17. 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.
  18. That's great to hear. 😊 To be honest i never worked with lua before, but i give it a try. Thank you
  19. 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
  20. Viking

    FOV configuration

    Add it to your config and make the config write protected.
  21. 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.
  22. 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.
  23. Viking

    map setting

    Are you still stuck with it? If so i test it myself once i get home from vacations.