Viking

Members
  • Content Count

    209
  • Joined

  • Last visited

  • Days Won

    8

Viking last won the day on December 21 2018

Viking had the most liked content!

Community Reputation

14 Good

7 Followers

About Viking

  • Rank
    Member

Recent Profile Visitors

600 profile views
  1. I am finally done with all the mantles and the lags disappeared. Looks like the missing connections between the different "height" levels were causing lags because the path could not be calculated. One more question, more about the bots than waypointing... My bots do not sprint and idk how to get it working. After the AStar i catch the next waypoint and let the move there self botMoveTo(level.waypoints[self.nextWp].origin); self botAction("+sprint"); Any idea why the bot does not sprint?
  2. Damn you are right, i did not create the mantle parts yet. For every (longer) path a mantle is required, that's why the calculations fail. I'll add them and upload the file once i am done. Thanks so far
  3. File attached mp_minecraft_new_waypoints.gsc
  4. I have made waypoints for mp_minecraft_new which are about 750. I will upload it when i get home
  5. Interesting. Did you test it with a big map yet?
  6. Hello, I am working on a plugin to get rid of the heavy functions required for bot waypoints inside gsc. Why? Simply because they waste a lot of variables and when a big amount of waypoints is used for a map then it lags and sometimes the loop kills the server due to the infinite loop protection. The plugin includes the import of existing waypoint files (gsc or csv format) and their storage in a struct "array". The A* algorithm is also covered and works fine. Since the A* gets pretty slow when the amount of waypoints is too big i would like to ask for some help. Right now the A* behaves like the one used inside gsc. Big lags when the path is too long. Google came up with some results how to improve the algorithm for faster results, but to be honest i am not skilled enough to implement them. My thoughts: A) Run 2 simultanious searches. One from start to end and the other from end to start. The problem i am facing here is that both calculations do not always meet in half. Simply due to obstacles/walls which generate different results, depending on the site they are faced from. B) Cancel the search after a predefined amount of length. The problem here is that not the optimal way is returned and that the algorithm does not detect if the path can not be completed in total. C) Skip uninteresting waypoints during the calculation. Well... But How to find out what is important and what is skippable? Maybe you have some ideas
  7. I don't think that is possible
  8. I guess there are a free only. Add a check within the loop where the weapons are loaded and skip them. should be somewhere at _weapons.gsc I think the error has it's origin in the game precahcing them
  9. Fix the settings of the material with asset manager if you have the mod source. Otherwise you cant.
  10. removeWeaponPickupsFromMap() { for(i=0;i<entities.size;i++) { if(isDefined(entities[i].classname)) { type = entities[i].classname; if(isSubStr(type, "weapon_") && isSubStr(type, "_mp")) entities[i] delete(); } } } this will remove weapon pickups, like from mp_poolday in the little room. however, you can not remove them in general. (except removing the precache what might cause other problems)
  11. Ah i understand, thanks for the explanation. I found Scr_GetVector here: https://github.com/callofduty4x/CoD4x_Server/blob/bd70805742f510ac76b1d979bc4f66716ffb4da1/src/scr_vm.h#L497 https://github.com/callofduty4x/CoD4x_Server/blob/bd70805742f510ac76b1d979bc4f66716ffb4da1/src/scr_vm_functions.c#L2142 And to define it i used: extern void Scr_GetVector( unsigned int, float* ); Back on topic, I have no idea why but it works now without the wait too.
  12. @T-Max same error ******* script runtime error ******* int is not a field object: (file 'maps/mp/gametypes/_test.gsx', line 26) self.targetID = getClosestTarget(self.origin); * called from: (file 'maps/mp/gametypes/_test.gsx', line 19) self thread TargetTest(); * started from: (file 'maps/mp/gametypes/_test.gsx', line 16) self waittill("spawned_player"); * ************************************ When i put a wait right before "self.targetID = getClosestTarget(self.origin);" then it works lel. @leiizko Plugin_Error works fine, didn't test Plugin_Scr_Error yet. Scr_GetVector() is a cod4 default function, the cod4x function Plugin_Scr_GetVector() is a bit different. Why not using 2 return types? I like the way it returns undefines, when it couldn't find a value
  13. This is how i call the function in gsc. init() { while(1) { level waittill("connected", player); player thread onPlayerSpawn(); } } onPlayerSpawn() { self endon("disconnect"); while(1) { self waittill("spawned_player"); self.targetID = undefined;; self thread TargetTest(self.origin); } } The plugin function is returning an integer i checked that multiple times now. And self is not an integer.
  14. Hey I have a new problem i need help with. In gsc i have the following code: TargetTest(origin) { //origin = (120, 10, 8); self.targetID = getClosestTarget(origin); iPrintLnBold("targetID: " + self.targetID); } The function getClosestTarget is inside the plugin: void getClosestTarget() { if (Plugin_Scr_GetNumParam() != 1) Plugin_Error(0, "Missing paramter. usage: getClosestTarget(origin)\n"); vec3_t origin; Scr_GetVector(0, origin); int nearestTarget = -1; float nearestDist = 9999999999; for(int i=0; i<global_total_targets; ++i) { float dist = VectorDistance(origin, global_targets[i].origin); if(dist < nearestDist) { nearestDist = dist; nearestTarget = i; } } if(nearestTarget == -1) { Plugin_Scr_AddUndefined(); return; } Plugin_Scr_AddInt(nearestTarget); } From time to time it fails and I get the follwoing error in the console: ******* script runtime error ******* int is not a field object: (file 'maps/mp/gametypes/_test.gsx', line 45) self.targetID = getClosestTarget(origin); Why is it expecting a field object? When I put "self.targetID = 1;" then it works fine. Thanks again