Flammable Posted July 27, 2015 Ok so, i need to edit some weapons. For example, someone picked up BFG9000, and right after that every player on server sees a huge message like that The question is, how to do that in DECORATE? (On the screenshot i'v put a script execute on weapon, i need this to work everywhere) And how to replace *playername* to the name of player who picked up a weapon. 0 Quote Share this post Link to post
scifista42 Posted July 27, 2015 You will need to define the weapon pickup as a Custom Inventory. Upon pickup, it would give BFG9000 to the player and call a certain ACS script with the player as the activator (yes, I'm suggesting to call a script from within DECORATE). The script must be present within the map (or loaded via LOADACS), and call HudMessageBold or another ACS function that prints text to all players. Player's name should be possible to obtain from a CVAR "name" - try calling GetCVar or GetCVarString from within the script. 0 Quote Share this post Link to post
Flammable Posted July 27, 2015 scifista42 said: When I'm trying to get player's name i'm having this But the printbold works fine, when other player picks up chainsaw, i see the message How do i fix the problem of names? Do i need to make CVARINFO or something? 0 Quote Share this post Link to post
scifista42 Posted July 27, 2015 Function getcvarstring is used but not defined. The function is new since ZDoom 2.7.1, which was released only 2 years ago. Looks like your ACS compiler doesn't know it, and refuses to compile the script. Try updating the "zcommon.acs" referenced by your ACS compiler - I have no experience and no idea how to do it, but it should be the proper way to make it work. Or just try using GetCVar. 0 Quote Share this post Link to post
Flammable Posted July 27, 2015 scifista42 said: Trying to use GetCvar, but no success, am I doing it wrong? 0 Quote Share this post Link to post
scifista42 Posted July 27, 2015 Screw what I said, here is a better way to get player's name, right in the 2nd post: http://forum.zdoom.org/viewtopic.php?f=3&t=25262 Your declaration of "PlayerName" makes no sense, by the way. Also, GetCVar doesn't work for non-integers, sorry for advising you to try it, I was wrong. 0 Quote Share this post Link to post
Flammable Posted July 27, 2015 scifista42 said: script 602 (void) { PrintBold(n:0,s:" picked up chainsaw"); GiveInventory("Chain_saw", 1); } Yeah, that worked. Thx for help. 0 Quote Share this post Link to post
Gez Posted July 28, 2015 scifista42 said:Try updating the "zcommon.acs" referenced by your ACS compiler - I have no experience and no idea how to do it, but it should be the proper way to make it work. zcommon.acs only includes other files and hasn't changed for over ten years. The files you need to update are zdefs.acs and zspecials.acs. Just right-click save those two files, and use them to overwrite the existing ones wherever your ACC is (if you're using DB2 or GZDB, go to the Doom Builder install folder, and from there to Compilers\ZDoom\). 0 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.