Page 13 of 14 FirstFirst ... 311121314 LastLast
Results 121 to 130 of 135

Thread: MOHAA Coop

  1. #121

    Default

    Quote Originally Posted by STAY2THELEFT View Post
    maybe something like,
    local.player give models/weapons/kar98sniper.tik
    Thanks, but we figured it out.
    $player[?] stufftext ("useweaponclass rifle")
    If I press 1,2,3 they are bound, checked what is bound to 2
    Last edited by chrissstrahl; November 16th, 2018 at 04:02 PM. Reason: added whole command

  2. #122

    Default

    The final solution looks like this, it will switch the players primary weapon.
    Player walks into a trigger where a spawned script_model bazooka is and
    he trades his current primary weapon for bazooka, or the other way around.

    PHP Code:
    //chrissstrahl - allow players to switch their weapons
    //============================================================================
    coop_bazookaSwitch:{
    //============================================================================
        //iprintlnbold_noloc("coop_bazookaSwitch")
        
    if( parm.other.targetname == "player"){
            
    local.player parm.other
            
    if( local.player.flags["coop_BaZookaSwitch"] == NIL ){    
                
    local.isPrimary 0
                local
    .primary waitexec coop_mod/main.scr::getActiveWeapon local.player
                
    for(local.x=0;local.x<4;local.x++){
                    if(
    local.player == NULL || local.player.health <= 0){    end    }
                    for(
    local.y=0;local.y<5;local.y++){
                        
    local.type "heavy"
                        
    if(local.== 0){ local.type "smg" }
                        else if(
    local.== 1){ local.type "rifle" }
                        else if(
    local.== 2){ local.type "mg" }
                        
    local.player stufftext ("useweaponclass "+local.type)
                        
    waitframe
                    
    }
                    
    local.primary waitexec coop_mod/main.scr::getActiveWeapon local.player
                    local
    .isPrimary waitexec coop_mod/main.scr::isPrimaryWeapon local.primary
                    
    if(local.isPrimary == 1){
                        
    local.player.flags["coop_BaZookaSwitch"] = local.primary
                        
    break                    
                    }
                }
                
    //if no more player
                
    if(local.player == NULL || local.player.health <= 0){    end    }
                
                
    //if the player still does not have a primary weapon stop right here
                
    if(    local.isPrimary == ){
                    
    local.player iprint ("You need a Primary Weapon in order to Trade your weapon!"1
                    end
                
    }
                
                
    exec coop_mod/main.scr::playerForcePrimary local.player "weapons/bazooka.tik"
            
    }else{
                
    exec coop_mod/main.scr::playerForcePrimary local.player local.player.flags["coop_BaZookaSwitch"]
                
    local.player.flags["coop_BaZookaSwitch"] = NIL
            
    }
        }
    }
    end 

  3. #123

    Default

    You don't need stufftext func if you don't want . useweaponclass is a Sentient class function so:

    local.player useweaponclass local.type

  4. #124

    Default

    Oh, thats odd, I tried that, but it didn't work.
    I tried again, it works now. Must have been a typo.
    Thanks.

    I really wish script errors would error out the game.
    The amount of time wasted because of a typo when working on such a big project is really a problem.
    It would really be useful if it did error out and not keep on going, printing a little tiny error message somewhere in 500 lines of console messages.
    Reading all the logfile each time you test the map is really not the right way...

  5. #125

    Default

    I tend to realise if a change I've made has crashed the script because either the fog isn't there or I don't have any weapons, or if anything else is missing from the main thread like objectives. But yeah having to look through the log can be a pain. It would be nice to give modders/devs an option.

  6. #126
    Developer Todesengel's Avatar
    Join Date
    Dec 2013
    Location
    St. Louis, Missouri, USA
    Posts
    276

    Default

    Just adding a date/time stamp to every line in qconsole.log would be huge......

  7. #127

    Default

    Quote Originally Posted by chrissstrahl View Post
    Oh, thats odd, I tried that, but it didn't work.
    I tried again, it works now. Must have been a typo.
    Thanks.

    I really wish script errors would error out the game.
    The amount of time wasted because of a typo when working on such a big project is really a problem.
    It would really be useful if it did error out and not keep on going, printing a little tiny error message somewhere in 500 lines of console messages.
    Reading all the logfile each time you test the map is really not the right way...
    Thats strange i never need to read the entire logfile to check a error.

    I always run the game as developer 3 because show all errors on the console.

  8. #128

    Default

    It is a bit different if you work with singleplayer maps that have not been made compatible with coop, and you test them you will get a lot of error messages.
    Most of them are very trivial, but some are important and they are sometimes very hard to find.

  9. #129

    Default

    I would like to make players invisible, but still showing the weapon to the player.
    As in viewmodel, visible to the player of the weapon, does anyone have a suggestion, how to do this ?

  10. #130

    Default

    Add a targetname to the weapon in hand, when you hide the player use the targetname to show the weapon.

Posting Permissions

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