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

How to make a model available for pick up and for use to place on the map?

broken avatar :(
Created 7 years ago
by Rattus
0 Members and 1 Guest are viewing this topic.
2,527 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 5 September 2017
Last active: 3 years ago
Posts
32
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
Rattus's Groups
Rattus's Contact & Social Linksrattus210
I want to make a model where players are able to pick up and place it somewhere in the map so that it can open a door or drawer. How would I be able to accomplish this?
Last Edit: October 10, 2017, 06:31:26 pm by Rattus
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 22 September 2015
Last active: 5 days ago
Posts
256
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
Signature
×
AllMoDs's Groups
question is do you want the player to have the model why they walk around
place the model in radiant
give it a Targetname
add a used trigger
link to player


or does it disappear when you pick it up and you get a hud icon

ill help need more info
Last Edit: October 14, 2017, 11:00:49 am by AllMoDs
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 5 September 2017
Last active: 3 years ago
Posts
32
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
Rattus's Groups
Rattus's Contact & Social Linksrattus210
I was thinking a hud icon as it seems easier to do... at least I assume. So yes I wanted it to disappear when a player picks it up, and appear as an icon. Then have the objective to place it somewhere in the map so that it can open a door
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 22 September 2015
Last active: 5 days ago
Posts
256
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
×
AllMoDs's Groups
ok easy
go to hud.menu if you dont have get one out of raw/ui put in your mods/mapname/ui
find this in that file
Spoiler: click to open...
itemDef
   {
      name         "playerscores"
      rect         0 0 100 0
      ownerdraw      CG_COMPETITIVE_MODE_SCORES
      visible         1                                             
   }      

under that put this dont edit
Spoiler: click to open...
itemDef
   {
      name         "hintstring"
      rect         100 150 0 0 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER
      textscale      .3
      textstyle      ITEM_TEXTSTYLE_SHADOWED
      textfont      UI_FONT_OBJECTIVE
      textalign      ITEM_ALIGN_CENTER
      forecolor      1 1 1 1
      exp text      ("" + dvarString("cus_text"))
      visible when   (dvarInt("show_cus_text") == 1);
      decoration
   }   

find this next

Spoiler: click to open...
itemDef
      {
         name         "weapname_lowdef"
         rect         (WEAPINFO_X -75) (WEAPINFO_Y +45) 290 40
         textstyle      ITEM_TEXTSTYLE_SHADOWED
         textscale      TEXTSIZE_BIG
         textfont      UI_FONT_OBJECTIVE
         forecolor      1 1 1 HUD_FOREGROUND_ALPHA
         ownerdraw      CG_PLAYER_WEAPON_NAME
         visible         1
         decoration
      }   

mine my be lil different but this line ant
ownerdraw      CG_PLAYER_WEAPON_NAME

put this under that

Spoiler: click to open...
itemDef                                                      
      {                                                         
         name         "pick_up_icon"                                       
         rect         (WEAPINFO_X -20) (WEAPINFO_Y +15) 40 40      
         forecolor      1 1 1 1                           
         ownerdraw      CG_PLAYER_WEAPON_BACKGROUND          
         background      "pick_up_icon"                  
         visible when    (dvarInt("show_hud_icon") == 1);
         decoration
      }
convert hud icon you want put this name for it
pick_up_icon
must be that name
change number here to put on hud where you want
(WEAPINFO_X -20) (WEAPINFO_Y +15)  the -20  & +15
the 40 40 is the size of the icon


now in your mapname.gsc
under this
Spoiler: click to open...
/*--------------------
    ZOMBIE MODE
   ----------------------*/
   [[level.DLC3.weapons]]();
   [[level.DLC3.powerUps]]();

put this


Spoiler: click to open...
thread maps\_ee_setup::init();

make a new gsc in mods/yourmapname/maps with this name
_ee_setup
put this in it

Spoiler: click to open...
#include maps\_utility;
#include common_scripts\utility;
#include maps\_zombiemode_utility;
#include maps\_hud_util;
#include maps\_zombiemode;

init()
{
   level thread on_player_connect();
   level thread onPlayerConnected();
   level thread hintstring_targetname();
   level.picked_up = 0;
   precacheshader("pick_up_icon");
}


on_player_connect()
{
   for(;;)
   {
      level waittill("connecting", player);
      player thread on_player_spawned();
      

   }
}

onPlayerConnected()
{   
    for(;;)
    {
        level waittill( "connected", player );
      player thread checkDistance();
      player thread checkDistance22();
   }
}

on_player_spawned()
{
   for(;;)
   {
      self waittill( "spawned_player" ); //prevents co-op issues
      wait 1.05;
      level.putdown Hide();
   }   
}

checkDistance() //// pick up model & deletes model after pick up
{
    self endon( "disconnect" );   
   while (1)
    {
        wait .05;
        if (distance(self.origin, level.pickup.origin) < 75 && level.picked_up == 0) 
        {
            for (;;)
            {
            if( distance( self.origin, level.pickup.origin ) < 75  && level.picked_up == 0)
            {
               self setClientDvar("show_cus_text", "1"); // show cus hint string  == 1
               self setClientDvar("cus_text", "you text b4 pickup"); // what t0 say
               if( self useButtonPressed() == true && distance( self.origin, level.pickup.origin ) < 75  && level.picked_up == 0)
               {
                  level.picked_up = 1;
                  self setClientDvar("show_hud_icon", "1");  // hud icon set to show ==1
                  self setClientDvar("show_cus_text", "0");  // hid hint string
                  self setClientDvar("cus_text", ""); // say not a thing
                  level.pickup delete(); // deletes model after pick up
                  wait 0.5;
               }
            }
            else if(distance(self.origin, level.pickup.origin) > 75  && level.picked_up == 0)
            {
               self setClientDvar("show_cus_text", "0");
               self setClientDvar("cus_text", ""); // say not a thing
               break;
            }
                wait 0.05;
            }
        }
    }
    wait 0.05;
}


checkDistance22() //// put down  model
{
    self endon( "disconnect" );   
   while (1)
    {
        wait .05;
        if (distance(self.origin, level.putdown.origin) < 75 && level.picked_up == 1) 
        {
            for (;;)
            {
            if( distance( self.origin, level.putdown.origin ) < 75  && level.picked_up == 1)
            {
               self setClientDvar("show_cus_text", "1"); // show cus hint string  == 1
               self setClientDvar("cus_text", "you text b4 putdown"); // what to say
               if( self useButtonPressed() == true && distance( self.origin, level.putdown.origin ) < 75  && level.picked_up == 1)
               {
                  level.putdown Show(); // show the model hid on game start
                  self setClientDvar("show_hud_icon", "0");  // hud icon set to hise == 0
                  self setClientDvar("show_cus_text", "0");  // hid hint string
                  self setClientDvar("cus_text", ""); // say not a thing
                  wait 0.5;
               }
            }
            else if(distance(self.origin, level.putdown.origin) > 75  && level.picked_up == 1)
            {
               self setClientDvar("show_cus_text", "0");
               self setClientDvar("cus_text", ""); // say not a thing
               break;
            }
                wait 0.05;
            }
        }
    }
    wait 0.05;
}

         
hintstring_targetname()
{
   level.pickup = GetEnt( "you set it", "targetname" ); // model targetname to pick up  must be   model
   level.putdown = GetEnt( "you set it", "targetname" ); // model targetname to put down must be  model
}


fill in you stuff here in the gsc you just made look for this stuff that i put edit only this stuff
stuff needs your input
Spoiler: click to open...

self setClientDvar("cus_text", "you text b4 pickup"); // what to say

self setClientDvar("cus_text", "you text b4 putdown"); // what to say

level.pickup = GetEnt( "you set it", "targetname" ); // model targetname to pick up  must be   model

   level.putdown = GetEnt( "you set it", "targetname" ); // model targetname to put down must be   model

place  models where you want the pick up one and put down model where its going to be put with different targetname

no use triggers
my  script dont need them
check new files off and add new icon to mod csv all dun

and if you did it right you have a new  hint string setup  you can use any time
with this
self setClientDvar("show_cus_text", "1"); // show cus hint string  == 1 hid it with 0 // self setClientDvar("show_cus_text", "0");
self setClientDvar("cus_text", "you text here can have collor"); // what t0 say
 

the  will hid the putdown model on game start and show it after you pick up pickup model and take it to where its going hud icon will show when you pick up the pickup model and hid after put down

you can add something in above this to make door open or what ever

self setClientDvar("show_hud_icon", "0");  // hud icon set to hise == 0
Last Edit: October 20, 2017, 08:33:25 am by AllMoDs
broken avatar :(
×
broken avatar :(
JbirdHaX
Location: se
Date Registered: 12 March 2012
Last active: 11 months ago
Posts
1,043
Respect
Forum Rank
Zombie Colossus
Primary Group
Community Mapper Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
(_̅(_̅м̅a̅я̅i̅j̅u̅a̅n̅a̅_̅0 ด้้้้้็็็็็้้้้้็็็็็้
Signature
▒█▀▄▀█ ░█▀▀█ ▒█▀▀█ ▒█▀▀█ ▒█▀▀▀ ▒█▀▀█  ▒█▀▀▀ ▒█░░ ▀█▀ ▀▀█▀▀ ▒█▀▀▀
▒█▒█▒█ ▒█▄▄█ ▒█▄▄█ ▒█▄▄█ ▒█▀▀▀ ▒█▄▄▀  ▒█▀▀▀ ▒█░░ ▒█░ ░▒█░░ ▒█▀▀▀
▒█░░▒█ ▒█░▒█ ▒█░░░ ▒█░░░ ▒█▄▄▄ ▒█░▒█  ▒█▄▄▄ ▒█▄▄ ▄█▄ ░▒█░░ ▒█▄▄▄
×
RadimaX's Groups
Community Mapper Elite Has shown excellence and experience in the area of custom mapping in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
even if you have an animation and a trigger to play it what if player looks away just as they press E on the drawer basicly 180 picking up nothing on screen but you add item in hud so have to take into account where the trigger is and how precise or lock down player movement almost like a tiny cutscene so its locked onto the object or money or whatever you plan for them to pick up, like a key or something?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 22 September 2015
Last active: 5 days ago
Posts
256
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
×
AllMoDs's Groups
If the distance is too far you can  change it everywhere the 75 is and if you want to add animation I can show you how to set up anime script event the way I set  that script up is the same way I have everything in my Dragon Ball Z map that you pick up and put down and that way no bud elms are getting used I'll help you out in Andy way if you got Skype of discord pm me info
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 5 September 2017
Last active: 3 years ago
Posts
32
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
Rattus's Groups
Rattus's Contact & Social Linksrattus210
Thank you very much for the help! Sorry I took a while to reply, I got a little busy with school and stuff... anyways to give you guys an idea of what I was trying to do is I was basically trying to make a desk with a locked drawer which requires an object to be placed in a certain location to unlock the drawer and be able to open up. Then inside the drawer you would find a key to open a locked door. And again, thank you AllMoDs for your tutorial! And I'll be sure to pm you if I end up getting stuck or something doesn't work
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 22 September 2015
Last active: 5 days ago
Posts
256
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
×
AllMoDs's Groups
Thank you very much for the help! Sorry I took a while to reply, I got a little busy with school and stuff... anyways to give you guys an idea of what I was trying to do is I was basically trying to make a desk with a locked drawer which requires an object to be placed in a certain location to unlock the drawer and be able to open up. Then inside the drawer you would find a key to open a locked door. And again, thank you AllMoDs for your tutorial! And I'll be sure to pm you if I end up getting stuck or something doesn't work
ok no prob i use that set up in my Dragon Ball Z map if you PM me you can add it to make it open the drawer for you as well and add another part they will let you pick up the key and add a hud icon and the other part to open the door with that key  but send me a PM and I'll help you out

 
Loading ...