Results 1 to 4 of 4

Thread: manipulating models

  1. #1

    Default manipulating models

    I dug up an old project I never finished using chess pieces on a board to play in game.

    you pick up the models and set them down using this -

    level.player = local.player

    while(isalive self && self != NULL && self != NIL)
    {
    local.origin = self.origin

    if(local.player.useheld)
    {
    wait .5
    if(local.player.useheld)
    {
    local.player thread drop_wp1 local.origin local.player
    level.pieceinplay = 0
    end
    }
    }
    wait .1
    }
    I want to give the player more control for example - expire the piece off the board rather than set it down. I can do this with cvar commands
    but was looking for a more elegant solution.

    I tried -

    player.useprimaryattack
    player.useprimary
    player.usereload
    player.usecrouch
    player.usedropweapon

    are there any other options than player.useheld ?


    Here are some pics
    Attached Images Attached Images

  2. #2

    Default

    You can use one of this:

    local.player.fireheld
    local.player.leanleftheld // Reborn only
    local.player.leanrightheld // Reborn only
    local.player.primaryfireheld // Breakthrough only
    local.player.runheld // Reborn only
    local.player.secfireheld // Reborn only
    local.player.secondaryfireheld // Breakthrough only
    local.player.useheld

    // you can also use this to detect leaning without reborn
    if ((local.player getcontrollerangles 0)[2] < -15) {
    // player is leaning right
    }
    if ((local.player getcontrollerangles 0)[2] > 15) {
    // player is leaning left
    }




    And for the holding models thing you want to do
    I have this code for that.
    It is for holding the models the same way you hold them in the source engine games


    main:
    thread createUseModel "models/test/box.tik" ( -800 -300 0 ) 1
    end

    createUseModel local.model local.origin local.scale:
    level.model = spawn "TriggerUse"
    level.model model local.model
    level.model scale local.scale
    level.model origin local.origin
    level.model setthread holding
    end

    holding:
    self nottriggerable

    local.player = parm.other
    local.angles = self.angles - local.player.angles
    local.vangle = local.player.viewangles[0]
    local.distance = vector_length (vector_subtract (local.player gettagposition "eyes bone") self.origin)

    while (local.player/*you probably need to add more checks here*/) {
    // self origin ( local.player.centroid + (vector_scale local.player.forwardvector local.distance) + ( 0 0 ((local.player getcontrollerangles 0)[0] * -(local.distance * 0.025)) ) )
    self origin ( local.player.origin + (vector_scale local.player.forwardvector local.distance) + ( 0 0 ((local.player.viewangles[0] - local.vangle) * -(local.distance * 0.015)) ) )
    self angles (vector_add local.angles local.player.angles)

    if (local.player.fireheld) {
    break
    }

    waitframe
    }

    self droptofloor
    self triggerable
    end



  3. #3

  4. #4

    Default

    Viper can you upload this map here please? i would be interested in playng with some friends this map.

Posting Permissions

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