Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. MW3 Modding Support & Discussion
  3. [BUG] Entity fields spam

[BUG] Entity fields spam

Scheduled Pinned Locked Moved MW3 Modding Support & Discussion
8 Posts 4 Posters 301 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • xensikundefined Offline
    xensikundefined Offline
    xensik
    wrote on last edited by xensik
    #1

    When you make calls to entity fields in a short period of time it crashes.

    chai code to reproduce:
    (go to Search & Destroy and spam the plant bomb button for example, the same happen onPlayerDamage that gets called a lot of times per second while shooting)

    def onPlayerConnected(args)
    {
        var player = args[0];
        player.onNotify("use_hold", fun[player](args)
        {
            player.iprintln("planting...");
            var origin = player.get("origin"); // make a field call and spam de F button
        });
    }
    
    level.onNotify("connected", onPlayerConnected);
    

    if you can take a look at field implementation stability
    Sin título.jpg

    1 Reply Last reply
    0
    • S3VDITOundefined Offline
      S3VDITOundefined Offline
      S3VDITO
      wrote on last edited by S3VDITO
      #2

      xensik said in [BUG] Entity fields spam:

      use_hold

      It's simple, Notify ("use_hold") in GSC scripts is inside the loop, it is not surprising that it will spam... [That not bug, may be]

      OnPlayerDamage it probably handles not only player damage..., but what about using OnNotify to handle damage?

      1 Reply Last reply
      0
      • xensikundefined Offline
        xensikundefined Offline
        xensik
        wrote on last edited by xensik
        #3

        ??????? im talking about calling entity fields in a short period of time. dont have nothing to be with use_hold or playerDamage, u can crash then in other many ways, this was just an example.

        1 Reply Last reply
        0
        • S3VDITOundefined Offline
          S3VDITOundefined Offline
          S3VDITO
          wrote on last edited by
          #4

          I probably did not understand the question. Sorry, but this is strange that the server shuts down when multiple get/set to fields.
          then it turns out that this is a bug/error

          1 Reply Last reply
          0
          • reaaLundefined Offline
            reaaLundefined Offline
            reaaL Contributor
            wrote on last edited by
            #5

            xensik said in [BUG] Entity fields spam:

            player

            wouldnt you use player.getOrigin() ?

            1 Reply Last reply
            0
            • xensikundefined Offline
              xensikundefined Offline
              xensik
              wrote on last edited by
              #6

              yes, but using the field shouldnt crash

              1 Reply Last reply
              0
              • Snakeundefined Offline
                Snakeundefined Offline
                Snake
                wrote on last edited by
                #7

                I'm investigating this. I can't really tell if we did something wrong, or if it's chaiscript being gay.

                1 Reply Last reply
                0
                • S3VDITOundefined Offline
                  S3VDITOundefined Offline
                  S3VDITO
                  wrote on last edited by
                  #8

                  there is still a problem with reading Fields (it can return 0 / write an error to the console / return the normal value), there is also a problem with set Field (on screen shows the console with the angle)

                  I just wanted to write a simple MapEdit =(

                  // it's just an attempt to rewrite code with MW2
                  def createRamp(top, bottom) {
                  	var distance = gsc.distance(top, bottom);
                  	var blocks = (int)(distance / 30) + 1;
                  	
                  	var A = [(top[0] - bottom[0]) / blocks, (top[1] - bottom[1]) / blocks, (top[2] - bottom[2]) / blocks];
                  	var temp = gsc.vectorToAngles([top[0] - bottom[0], top[1] - bottom[1], top[2] - bottom[2]]);
                  	var BA = [temp[2], temp[1] + 90, temp[0]];
                  	
                  	for (var b = 0; b <= blocks; ++b) {
                  		print(BA);
                  		var crate = gsc.spawn("script_model", [bottom[0] + A[0] * b, bottom[1] + A[1] * b, bottom[2] + A[2] * b]);
                  		crate.set("angles", BA);
                  		//crate.set("angles", BA);
                  		crate.setModel("com_plasticcase_trap_friendly");
                  	}
                  }
                  

                  image.png

                  1 Reply Last reply
                  0

                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Donate