Just a small tidbit if you try drawing this through menu good luck getting it to stretch properly according to the size.
Not all weapons are in the same size so if you try setting it to 256x128 some weapons are actually like 64x32 so they'll get horribly pixelated and flattened.
You can notice the size in hudiconration in the weapon file.
Just a small tidbit if you try drawing this through menu good luck getting it to stretch properly according to the size.
Not all weapons are in the same size so if you try setting it to 256x128 some weapons are actually like 64x32 so they'll get horribly pixelated and flattened.
You can notice the size in hudiconration in the weapon file.
I thought of that, and wouldn't that be solved if you started with the same size template and resized the image within the template rather than sizing the image to the template. That way it would size the image to what you told it to no matter what because it would be resizing more than just the image you put in. Like if you put it in a box. The box would always be the same size, but you would make the image inside the box smaller or larger.
Last Edit: February 23, 2016, 05:06:01 pm by MakeCents
Just a small tidbit if you try drawing this through menu good luck getting it to stretch properly according to the size.
Not all weapons are in the same size so if you try setting it to 256x128 some weapons are actually like 64x32 so they'll get horribly pixelated and flattened.
You can notice the size in hudiconration in the weapon file.
I plan on using these from BO2 or making my own by rendering them in Maya or Blender.
What is this hint_string at this point? If it is one of those &"Press...." things this method doesn't work.
Code Snippet
Plaintext
weapon_spawns[i] _sethintstring( hint_string );
If you add hint_string = "testing this"; above, does it show the hintstring testing this? I'm assuming it is one of those &"hint strings" is why I suggested trying this.
Edit: I looked at the script and those _sethinstring(&"hints") won't work either. It won't parse those for some reason.
I tried this and it didn't work work, no string was printed on screen for it or on the weapon buy, I also tried removing the & from every entry of of sethintstring (including all the weapons) and it still doesn't show, however after it does display the ammo string (I'll edit the ZOMBIE_WEAPONCOSTAMMO later) but not the ammo, etc.
A couple things. You can't just remove the & Some of these have additional vars, cost, ammo_cost, that all needs edited For it not to print anything or show anything would make me think that for loop isn't running except if it shows the ammo then it is, so it's a bit confusing
weapon_spawns[i] thread weapon_spawn_think(); model = getent( weapon_spawns[i].target, "targetname" ); model hide(); } }
That ^ should be what you have in your weapons now. And this is where you should put the iprints:
Code Snippet
Plaintext
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| //|||| Name : trem_hintstrings.gsc //|||| Info : Fixes hintstrings that don't update. //|||| Site : [url=http://www.ugx-mods.com]www.ugx-mods.com[/url] //|||| Author : [UGX] treminaor //|||| Notes : v1.3 //|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include maps\_utility;
_setHintString(string) //#bestengine2014 { self thread setHintString_fixed_thread(string); //so that i don't have to write "thread" before all of my trig calls. } setHintString_fixed_thread(string) { self notify("new_thread"); self endon("new_thread"); flag_wait("all_players_connected");//Added so you see the printlin wait(2);//Added more so you see the print line iprintln("Hint string defined? ", isdefined(string));//added to see if the string is defined if(!isDefined(string)) return; tokens = strTok(string, " "); end = false; leftstring = ""; rightstring = ""; for(i=0;i<tokens.size;i++) { if(tokens[i] == "&&1" || tokens[i] == "F" || tokens[i] == "[{+activate}]" || tokens[i] == "[Use]") //use key will be added by the menufile { tokens[i] = ""; end = true; } if(end) rightstring = rightstring + tokens[i] + " "; else leftstring = leftstring + tokens[i] + " "; } players = getPlayers(); while(isDefined(self)) { for(k=0;k<players.size;k++) if(players[k] islookingatent(self) && (distance(players[k].origin, self.origin) < 75) || players[k] isTouching(self)) { iprintln("show me the hint string");//added to print when triggered players[k].leftstring = leftstring; players[k].rightstring = rightstring; players[k] thread setHintString_show(self, leftstring, rightstring); } wait 0.1; } }
If any say 0 then there is an issue without the string being passed. If nothing prints, unless I made a mistake, then its not getting thread at all.
Last Edit: February 23, 2016, 05:42:10 pm by MakeCents
A couple things. You can't just remove the & Some of these have additional vars, cost, ammo_cost, that all needs edited For it not to print anything or show anything would make me think that for loop isn't running except if it shows the ammo then it is, so it's a bit confusing
weapon_spawns[i] thread weapon_spawn_think(); model = getent( weapon_spawns[i].target, "targetname" ); model hide(); } }
That ^ should be what you have in your weapons now. And this is where you should put the iprints:
Code Snippet
Plaintext
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| //|||| Name : trem_hintstrings.gsc //|||| Info : Fixes hintstrings that don't update. //|||| Site : [url=http://www.ugx-mods.com]www.ugx-mods.com[/url] //|||| Author : [UGX] treminaor //|||| Notes : v1.3 //|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include maps\_utility;
_setHintString(string) //#bestengine2014 { self thread setHintString_fixed_thread(string); //so that i don't have to write "thread" before all of my trig calls. } setHintString_fixed_thread(string) { self notify("new_thread"); self endon("new_thread"); flag_wait("all_players_connected");//Added so you see the printlin wait(2);//Added more so you see the print line iprintln("Hint string defined? ", isdefined(string));//added to see if the string is defined if(!isDefined(string)) return; tokens = strTok(string, " "); end = false; leftstring = ""; rightstring = ""; for(i=0;i<tokens.size;i++) { if(tokens[i] == "&&1" || tokens[i] == "F" || tokens[i] == "[{+activate}]" || tokens[i] == "[Use]") //use key will be added by the menufile { tokens[i] = ""; end = true; } if(end) rightstring = rightstring + tokens[i] + " "; else leftstring = leftstring + tokens[i] + " "; } players = getPlayers(); while(isDefined(self)) { for(k=0;k<players.size;k++) if(players[k] islookingatent(self) && (distance(players[k].origin, self.origin) < 75) || players[k] isTouching(self)) { iprintln("show me the hint string");//added to print when triggered players[k].leftstring = leftstring; players[k].rightstring = rightstring; players[k] thread setHintString_show(self, leftstring, rightstring); } wait 0.1; } }
If any say 0 then there is an issue without the string being passed. If nothing prints, unless I made a mistake, then its not getting thread at all.
I call hacks.
Seriously though thank you, I really appreciate the help, without it I wouldn't have been able to use trem's hintstring fix and in turn, have easier implementation of the icon. Also was able to set up the hintstrings for ammo, etc. correctly.
I can go from here now in adding the icons, etc. in menu and using dvars to do it, I've marked your original reply as best answer as I feel it better answers the main question.
Last Edit: February 23, 2016, 06:59:06 pm by Scobalula
If you want scripts / features made for you, then contact me by PM or email / skype etc it will cost you tho so if you have no intention of reciprocating don't even waste my time
I've been meaning to get around to this but I have been too busy troubleshooting ORBiT. I think it can be done in menu using an existing dvar, like the flamethrower uses. I've added icons to hints for perks, several of them, and started to try my one hud that requires the gun image, and it seemed to work but I didn't have images so it was the default texture for most, then I got distracted. I would look in the weaponinfo menuDef in the hud.menu for something commented out that relates to the weapon icon or something if I remember correctly. Then use that dvar. It might be set when your holding the weapon?
If I'm wrong about that, then it simply becomes a matter of you setting your own dvar, based on the weapon file name. You could simply make your material match the weapon file name with _icon or something on the end. Use gsc to get the current wall weapon with _icon at end and set the client dvar to that, for the itemdef you added to menu. Of course you would need to be using menu hinstring method for your wall weapons for this to work easily.
what was the "existing dvar"? Ive been trying to find this for ages
Just thought I'd update and say I got it working properly:
As Make said it's only a one line thing really if you're using trem's hintstring fix, where all the dvars are set I just set another one with the value being trig.script_noteworthy and _icon added at the end.
As Make said it's only a one line thing really if you're using trem's hintstring fix, where all the dvars are set I just set another one with the value being trig.script_noteworthy and _icon added at the end.
Looks good btw!
Last Edit: February 27, 2016, 02:06:45 am by MakeCents