UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

[Easy] Drawable Weaponchalks [like BO2]

broken avatar :(
Created 10 years ago
by fanmagic
0 Members and 1 Guest are viewing this topic.
5,624 views
broken avatar :(
×
broken avatar :(
Location: deDortmund
Date Registered: 20 December 2015
Last active: 2 years ago
Posts
307
Respect
Forum Rank
Perk Hacker
Primary Group
Scripter
My Groups
More
Personal Quote
Payback
Signature
Tears Of The Fallen | Join the project https://discord.gg/8gDNQRj
×
fanmagic's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
fanmagic's Contact & Social LinksTears Of The Fallen
Hello guys,
today I present you my drawable weapons for World at War. It's my first script i made so don't hate me if i made some mistakes. The function of this script is that you can take a weapon chalk and draw it somewhere you want to buy it - like the chalks from Buried. So lets start...

The Scripting-Part:

1. Create a new .GSC and call it something you like ( for example "weapon_chalks.gsc")
2. Copy the code below in it ...
Code Snippet
Plaintext
#include common_scripts\utility; 
#include maps\_utility;
#include maps\_zombiemode_utility;

//=========================================================== \\
// ===================== Drawable Chalk ===================== \\
//=========================================================== \\
main()
{
trigger_off("place_weap", "targetname"); // Point where you can draw the weapon
trigger_off("mp40", "script_noteworthy"); // Trigger to buy the weapon
brush = getEnt ("weap_draw","targetname"); // Weapon chalk after drawing
brush hide();

trig = getEnt ("weap_chalk","targetname"); // Trigger to take the chalk
trig setHintString ("Press &&1 to pick up the chalk");
trig setCursorHint ("HINT_NOICON");
trig UseTriggerRequireLookAt();
trig waittill ("trigger");
trig Delete();

iprintln ("You take the weapon chalk"); // Message to show on display

brush = getEnt ("weap_paint","targetname"); // Delete the chalk after you take it
brush delete();

trigger_on("place_weap", "targetname");

trig = getEnt ("place_weap","targetname"); // Trigger where you place your weapon
trig setHintString ("Press &&1 to draw the weapon");
trig setCursorHint ("HINT_NOICON");
trig UseTriggerRequireLookAt();
trig waittill ("trigger");
trig Delete();

brush = getEnt ("interrogation_point","targetname"); // Disable the interrogation point
brush delete();

brush = getEnt ("weap_draw","targetname"); // Show new weapon chalk
brush show();

trigger_on("mp40", "script_noteworthy"); // Trigger to buy the weapon
}

//=========================================================== \\
// ===================== Drawable Chalk ===================== \\
//=========================================================== \\

3. Customize the script for the weapon you want in these lines.
Code Snippet
Plaintext
trigger_on("mp40", "script_noteworthy");						// Trigger to buy the weapon
trigger_off("mp40", "script_noteworthy"); // Trigger to buy the weapon
In this script i use the MP40. You can choose any weapon you want.

4. Last thing we have to do is to call the function in our "Mapname.gsc" (for example "DeliveryBD.gsc")

  Search for this line in your Mapname.gsc:
Code Snippet
Plaintext
maps\_zombiemode::main();
and place this under it: ( replace "weapon_chalk" with your filename )
Code Snippet
Plaintext
thread maps\weapon_chalk::main();

So it looks like this:
Code Snippet
Plaintext
maps\_zombiemode::main();
thread maps\weapon_chalk::main();
That was the Scripting-Part. Next we go into Radiant...

5. Now we have to place all triggers and brushes we need for the script...

Things you need:

Trigger-Use
Code Snippet
Plaintext
Targetname - Weap_Chalk  // Trigger where you take the chalk
Trigger-Use
Code Snippet
Plaintext
Targetname - Place_Weap  // Trigger where you draw the weapon
Next you take a weapon prefab you like for example the MP40. Stamp the prefab and put the trigger and the gunmodel to the interrogation point/brushmodel you create next. You don't need the chalk from the prefab so put it under the map.
Now create the Brushes ( Rightclick on the 2d view --> Script --> Brushmodel ).

Brushmodel
Code Snippet
Plaintext
Targetname - Weap_Paint  // Chalk to draw the weapon  --> delete after you take it
Brushmodel
Code Snippet
Plaintext
Targetname - Weap_Draw  // New chalk after you draw the weapon
Brushmodel
Code Snippet
Plaintext
Targetname - Interrogation_Point  // Interrogation point where you draw the weapon --> delete after drawing

That's all. It looks like this for example:


Here is the sequence of the script in pictures:





Now you have a drawable weapon in your map. I hope you understand all because like I sad - It's my first tutorial and script. You can also add something to the script for example multiple points to draw or something. So I hope you enjoy it. Thanks for reading...  :)

-fanmagic.
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 3 years ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Looks like that only works once.

I'd recommend making multiple functions that handle each step instead of having everything run from the main block.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 2 years ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Signature
My preferred name is "xSanchez78".
Check me out here: www.steamcommunity.com/id/xSanchez78
×
alaurenc9's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
I have the anims for drawing the chalk as well as the chalk in the players hand, the chalk sounds, and the image for the chalk hud.

If you could make the script friendly to add these items in, I would certainly include this in my BO2 weapons pack if you would like.
I could make the Black Ops 2 script work with all that for you, when I have time.
broken avatar :(
×
broken avatar :(
Location: deDortmund
Date Registered: 20 December 2015
Last active: 2 years ago
Posts
307
Respect
Forum Rank
Perk Hacker
Primary Group
Scripter
My Groups
More
Personal Quote
Payback
×
fanmagic's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
fanmagic's Contact & Social LinksTears Of The Fallen
Looks like that only works once.

I'd recommend making multiple functions that handle each step instead of having everything run from the main block.
Like i sad - its my first script so i only made it very simple. I also have to learn more to make better scripts. So if you like to help me to make multiple functions in this script i'm very thankful.

-fanmagic.

 
Loading ...