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

Plutonium

  1. Home
  2. MW3 Modding Support & Discussion
  3. On-Screen Killstreak Counter

On-Screen Killstreak Counter

Scheduled Pinned Locked Moved MW3 Modding Support & Discussion
5 Posts 4 Posters 861 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.
  • FutureRaveundefined Offline
    FutureRaveundefined Offline
    FutureRave VIP
    wrote on last edited by FutureRave
    #1

    Hello, I'm new to the Pluto plugin/script development but I have some previous experience in Java (OOP alike).
    I friend of mine gave the script in c# for Tekno which displays the killstreak counter on screen. I wish to port this to Pluto MW3
    First of all, it would be great if some could clarify the pro and cons of using chaiscript rather than c++ plugins. What is the main difference (plugins more capable than scripts?).
    Which of those has the capability of doing some like this? Keep in mind that the counter should remain at a fixed position (let's say top screen).
    Has someone already made a similar thing?
    I really need someone to point me in the right direction before I start coding.
    Thanks

    Edit 1:
    Okay, I've read carefully other posts on this forum and this is where I am right now:
    1.PNG

    This is supposed to be the project setup.
    Now let's say I want to do the hello world message like in the tutorial.

    level.onNotify("connected", fun(arguments) {
    	var player = arguments[0];
    	
    	player.onNotify("spawned_player", fun[player](arguments) {
    		helloWorld(player);
    	});
    });
    
    def helloWorld(player)
    {
    	player.iPrintlnBold("^1Hello, world!");
    }
    

    where do I chuck this code? Do I need extra headers to code for Pluto?
    Thanks

    S3VDITOundefined Kalitosundefined 2 Replies Last reply
    0
    • naccibundefined Offline
      naccibundefined Offline
      naccib
      wrote on last edited by
      #2

      There are currently two ways of modding Pluto. One is using unmanaged C++ code - that's what you have in Visual Studio. The other, and more limited, is using managed ChaiScript code - that's the one you have in the tutorial post.

      To load the code from the tutorial, simply save it as a .chai file in %localappdata%\Plutonium\storage\iw5\scripts folder.

      1 Reply Last reply
      0
      • S3VDITOundefined Offline
        S3VDITOundefined Offline
        S3VDITO
        replied to FutureRave on last edited by S3VDITO
        #3

        I think this is enough to start
        In C ++, it will be very difficult to create such without knowledge

        // This is ChaiScript
        level.onNotify("connected", fun(arguments) {
                // you can make new var
                // var player = arguments[0];
        	var hud_text = gsc.newClientHudElem(arguments[0]);
        	hud_text.set("x", 0);
        	hud_text.set("y", 0);
        	hud_text.set("font", "hudbig");
        	hud_text.set("fontscale", 0.65);
        	hud_text.setText("^2HELLO WORLD, THIS IS HUD!");
        });
        

        There are a few problems:

        1. Do not spam SET/GET
        2. To update the numbers, it is better to use SetValue, not SetText (yes you have to tinker with the position, but otherwise your server may crash)
        3. Better to use Plutoscript Framework to handle event kill player
          alt text
        1 Reply Last reply
        0
        • Kalitosundefined Offline
          Kalitosundefined Offline
          Kalitos
          replied to FutureRave on last edited by
          #4

          Diavolo Did you get the kill streak counter script done?

          1 Reply Last reply
          0
          • FutureRaveundefined Offline
            FutureRaveundefined Offline
            FutureRave VIP
            wrote on last edited by FutureRave
            #5

            Kalitos No, I gave up 8 months ago because Chai script lacks everything I am used to when I code in other programming languages.
            Recently the clan I'm a part of opened a server on Pluto so I might do something although given the fact IW4M already has a built-in killstreak counter I don't think I will do this specifically.
            Also, Pluto doesn't have all the Hud Elements in handy so it's a nightmare to centre text on-screen since different players might have different resolutions.

            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