Page 12 of 14 FirstFirst ... 21011121314 LastLast
Results 111 to 120 of 135

Thread: MOHAA Coop

  1. #111

    Default

    Yeah, I added it so you can queue earthquakes if the function is called again before previous ones have finished.

  2. #112

    Default

    I will have to look at the Earthquake stuff once this annoying error message is fixed:
    ^~^~^ Event 'spawnrangelinked' does not exist.
    ^~^~^ Failed execution of event for class 'ClientGameCommandManager'
    I suspect the following weapon causing it: models\statweapons\mg42_gun_fake.tik
    It spams the console so bad it has a real impact on the gameplay.

  3. #113

    Default

    Not sure about that error, sorry.

    I'm not gonna bother working on the earthquake code more than this, but it's currently not bad and similar to the source (didn't bother with queue stuff in the end). If it's helpful to someone then go ahead and make it better :


    Earthquake local.duration local.magnitude local.no_rampup local.no_rampdown:

    if (self.quakes == NIL)
    self.quakes = 0

    if (local.duration <= 0 || local.magnitude <= 0 || self.quakes > level.MAX_EARTHQUAKES)
    end

    // he's quaking
    self.quakes++

    // make the earthquake ent
    local.e = spawn Listener
    local.e.magnitude = local.magnitude
    local.e.starttime = level.time
    local.e.endtime = local.e.starttime + local.duration

    // do the quakes
    local.shakeangles = (0 0 0)
    while (local.e.endtime > level.time)
    {
    local.timedelta = level.time - local.e.starttime // grab earthquake time
    local.magnitude = local.e.magnitude // peak magnitude
    if (local.timedelta >= local.duration / 2)
    {
    // in the rampdown phase of the earthquake
    if (!local.no_rampdown)
    local.magnitude = local.magnitude * ((level.time - local.e.endtime) * 3.0 / local.duration)
    }
    else
    {
    // in the rampup phase of the earthquake
    if (!local.no_rampup)
    local.magnitude = local.magnitude * ((local.timedelta) * 3.0 / local.duration)
    }
    local.shakeangles[0] = ((randomint(2) - 1) * local.magnitude * 2)
    local.shakeangles[1] = ((randomint(2) - 1) * local.magnitude * 2)
    local.shakeangles[2] = ((randomint(2) - 1) * local.magnitude * 3)

    self.viewangles += local.shakeangles
    waitframe
    self.viewangles -= local.shakeangles
    }
    // get rid!
    local.e remove
    self.quakes--
    end
    Last edited by 1337Smithy; September 10th, 2018 at 06:28 AM.

  4. #114

    Default

    So I have a new issue
    How do I remove a hud that was drawn this way ?
    huddraw_shader 200 "textures/hud/gasmask_overlay"
    huddraw_align 200 left top
    huddraw_rect 200 0 0 640 480
    huddraw_virtualsize 200 1
    huddraw_color 200 1 1 1
    huddraw_alpha 200 1

  5. #115
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,603

    Default

    empty the shader or alpha

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

    Default

    I believe if you just set your alpha to 0, it will turn it off, so...

    huddraw_alpha 200 0

    Tode
    Last edited by Todesengel; November 11th, 2018 at 09:58 AM.

  7. #117

    Default

    Thanks, the alpha approach worked.
    I have not tested the other.

  8. #118
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,603

    Default

    In client internals it checks for string or shader, then checks for alpha. In that sequence. If first check is false or second one in sequence is false hud is not drawn.

  9. #119

    Default

    is there a command to force the primary weapon of a player ?
    I just need the player to hold primary weapon for 1 frame time, it doesn't matter if he switches back

  10. #120

    Default

    maybe something like,
    local.player give models/weapons/kar98sniper.tik

Posting Permissions

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