Forum Jump :

Author Message


Posts: 105
Rank:


Level: Member

Country: us
Location:
Occupation: Marine
Age:
In-game name: shadowmarine578

 
#1 Posted at 2014-10-01 22:27        
     
im using a mod to allow my players in MP to jump and climb i have a mission where players are jumping roof top to roof top in an urban environment i want the player to be able to fall 20ft with out being hurt anything above that it starts damaging them. also it doesn't haft to only effect players it can be a variable for any kind charter ive seen some of my unit spawn scripts put AI on roof tops and they just walk to there death. just tired of dieing or being seriously hurt from a 4ft fall.

if (isTouchingGround player = false) then {player allowDamage false;}; // dont know if this works
if (isTouchingGround player) then {player allowDamage true;}; //i Do know this will work

haven't tested this but if it works if the player is not touching ground he cant be hurt as soon as player touches the ground he can be hurt again, i don't like that the way it is i only want to change the fall damage amount but that's all i got.

This post was edited by shadowmarine578 (2014-12-21 15:05, 1093 days ago)


Author Message


Posts: 317
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name: BrotherhoodOfHam

 
#2 Posted at 2014-10-02 08:57        
     
player allowDamage (isTouchingGround player);

This would be the super neat way of doing it.
Not sure if you are going to put it in a loop though?

Some delicious stuff:
3D marker script
Some WIP delicious stuff:
Modular Customization Interface

Advertisement


Author Message

Tajin  



Posts: 433
Rank:


Level: Member

Country: de
Location: Bavaria
Occupation: Communications Designer
Age: 33
In-game name: Tajin

 
#3 Posted at 2014-10-02 09:21        
     
Try this:
player addEventHandler ["HandleDamage", {
    private ["_unit", _damage", "_source"];
    _unit = _this select 0;
    _damage = _this select 2;
    _source = _this select 4;

    if ( (_source == "") && !(isTouchingGround _unit) ) then {0} else {_damage};
}];

Should be alot neater ;) and also stills allows them to get shot in mid-air.

In fact you could easily change this to be more detailed. For example, so it only reduces the damage instead of eliminating it completely.

There are a lot of very capable people on this forum, willing to spend some of their time to help you out. So if you have a problem, it surely isn't too much to ask that you atleast take the time to describe it properly. Thanks.

Author Message


Posts: 317
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name: BrotherhoodOfHam

 
#4 Posted at 2014-10-02 09:49        
     
Or there is that too :-D

Some delicious stuff:
3D marker script
Some WIP delicious stuff:
Modular Customization Interface

Author Message


Posts: 105
Rank:


Level: Member

Country: us
Location:
Occupation: Marine
Age:
In-game name: shadowmarine578

 
#5 Posted at 2014-10-02 18:21        
     
lol i love you guys :)

with this code the is the {0} part setting the damage amount? i just want to make sure i under stand and learn what each part of the code does

    player addEventHandler ["HandleDamage", { //<-- this just creates the Eventhandler for the fall damage so it can be called latter or over and over again any time the below happens.
        private ["_unit", _damage", "_source"]; //<-- this is an array for the stuff below
        _unit = _this select 0;
        _damage = _this select 2;
        _source = _this select 4; // source would be the fall damage amount? or is this just an open variable for any damage type? 
     
        if ( (_source == "") && !(isTouchingGround _unit) ) then {0} else {_damage}; // is this checking for a "source" of damage and if is not touching ground then no damage if touching ground then damage right?
    }];

lol hopefully i got that right i am garbage when it comes to reading scripts.


Author Message


Posts: 317
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name: BrotherhoodOfHam

 
#6 Posted at 2014-10-02 23:06        
     
You basically understood it I would say.

Some delicious stuff:
3D marker script
Some WIP delicious stuff:
Modular Customization Interface

Author Message


Posts: 105
Rank:


Level: Member

Country: us
Location:
Occupation: Marine
Age:
In-game name: shadowmarine578

 
#7 Posted at 2014-12-21 15:03        
     
O.o im having truble finding the place that i can mark this topic [how to set the fall damage amount (solved)] found it NVM :)






Tags: Falldamage