On-Screen Killstreak Counter
-
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.
ThanksEdit 1:
Okay, I've read carefully other posts on this forum and this is where I am right now:
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 -
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. -
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:
- Do not spam SET/GET
- 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)
- Better to use Plutoscript Framework to handle event kill player
-
Diavolo Did you get the kill streak counter script done?
-
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.