Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Flammable

Item pickup with message. (in co-op)

Recommended Posts

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.

Share this post


Link to post

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.

Share this post


Link to post
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?

Share this post


Link to post

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.

Share this post


Link to post
scifista42 said:


script 602 (void)
{
PrintBold(n:0,s:" picked up chainsaw");
GiveInventory("Chain_saw", 1);
}

Yeah, that worked. Thx for help.

Share this post


Link to post
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\).

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×