Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Model name

  1. #1
    ... connecting
    Join Date
    Apr 2017
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Model name

    Hi, i want to write hide and seek mod, but i have some problems.
    How can i get model name by using aim throw bullettrace f.e? I need model from map, f.e. tree, barrels, cars or tanks models from toujane.
    PHP Code:
    while(isAlive(self))
    {
       
    trace bullettrace(self geteye() + (0020), self geteye() + (0020) + maps\mp\_utility::vectorscale(anglestoforward(self getplayerangles()), 99999), trueself);
       
    self iprintlnbold(trace["entity"]); //display player name

    Im junior in scripting, mb I'm using wrong steps, idk

  2. #2
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    trace[ "entity" ] is either the player, any other entity (script-models etc) or undefined

    I do not know if your player has a static model, the trace-entity will show it as a player.

    If so, check for these cases and pront the name:

    PHP Code:
    ent trace"entity" ];

    if( 
    IsDefinedent ) && IsPlayerent ) )
        
    IPrintLnBoldent.name ); 

    Also: you can only 'detect' models that are scrip-models. This means they must be entities (either set in the radiant or spawned via script). Normal models (like trees, barrels, tables etc.) cannot be detected via bullettrace afaik.

    Also: in your script: you should add a wait-statement in there, otherwise it will issue an error.

  3. The Following 2 Users Say Thank You to serthy For This Useful Post:

    kung foo man (17th April 2017),strainik (17th April 2017)

  4. #3
    ... connecting
    Join Date
    Apr 2017
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Ok, thx.
    Can there be alternative ways to determine the model? or its impossible?

  5. #4
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Decompile the map and open in radiant, then you can see the modelnames in Radiant.
    Why do you want to know every model's name?

  6. #5
    ... connecting
    Join Date
    Apr 2017
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I want to make hide and seek, where user who is hiding saw the barrel or other object, pressed the f and took it model.

  7. #6
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Then you might wanna decompile the map and create a list of all models in the map + their origin. Then see what the bullettrace["position"] is closest to, and use the list as a lookup.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  8. #7
    ... connecting
    Join Date
    Apr 2017
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Too expensive by time
    Ok, can i add additional menu items(wm_messages) for one gametype, f.e?
    Last edited by strainik; 17th April 2017 at 14:14.

  9. #8
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Yes you can. Check _menus.gsc how it's handeled

  10. #9
    Corporal voron00's Avatar
    Join Date
    Nov 2014
    Posts
    248
    Thanks
    64
    Thanked 216 Times in 116 Posts
    Also maybe add some triggers, so it would be like player can stand near a model and press f...?
    sudo apt-get rekt

  11. #10
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Quote Originally Posted by strainik View Post
    Too expensive by time
    Ok, can i add additional menu items(wm_messages) for one gametype, f.e?
    I meant reading it through a script
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •