Hey, I'm looking for a way to make the player slower, if he cary more items and weapons.
lets say that the normal playerspeed is 100.
a shotgun have 15 points of weight.
this will be the outcome of the player having this weapon:
playerspeed 100 - shotgun weight 15 = new playerspeed 85
I would do this myself if I could, but I got no idea how to make the player slower in this manner.
NOTE: the player should get faster again if item is used/dropped.
"weight of the player"
"weight of the player"
Combinebobnt wrote:i can see the forum league is taking off much better than the ctf ones
GalactusToday at 1:07 PM
are you getting uncomfortable jap
feeling something happen down there
- Hypnotoad
- Retired Staff / Community Team Member
- Posts: 528
- Joined: Tue May 29, 2012 8:50 pm
- Location: Britland
RE: "weight of the player"
Do an inventory check (if (CheckInventory("Shotgun") == 1)), and then adjust the player's APROP_Speed using SetActorProperty accordingly (SetActorProperty(0, APROP_Speed, 0.85);Lollipop wrote: Hey, I'm looking for a way to make the player slower, if he cary more items and weapons.
lets say that the normal playerspeed is 100.
a shotgun have 15 points of weight.
this will be the outcome of the player having this weapon:
playerspeed 100 - shotgun weight 15 = new playerspeed 85
I would do this myself if I could, but I got no idea how to make the player slower in this manner.
NOTE: the player should get faster again if item is used/dropped.
Last edited by Hypnotoad on Fri May 31, 2013 3:25 pm, edited 1 time in total.
-
Watermelon
- Zandrone
- Posts: 1244
- Joined: Thu Jun 28, 2012 9:07 pm
- Location: Rwanda
RE: "weight of the player"
To expand upon the above, you can manipulate how much each thing holds with respect to weight:
Code: Select all
script 123 (void)
{
int totalWeight;
while (true)
{
totalWeight = 0;
totalWeight += (CheckInventory("Shell") * 0.001);
totalWeight += (CheckInventory("Clip") * 0.0005);
totalWeight += (CheckInventory("Rocket") * 0.002);
// etc...
if (totalWeight > 1.0)
totalWeight = 1.0;
SetActorProperty(0, APROP_Speed, 1.0 - totalWeight);
delay(1);
}
}
RE: "weight of the player"
I will do this tomorrow, then I got some time at hand do work with it, but I wish to thank you now :)
Combinebobnt wrote:i can see the forum league is taking off much better than the ctf ones
GalactusToday at 1:07 PM
are you getting uncomfortable jap
feeling something happen down there
RE: "weight of the player"
This works out very well for me, I had to do a little of this and a little of that, but overall I am very pleased with this watermelonand hypnotoad, u will be on credits list :)
Combinebobnt wrote:i can see the forum league is taking off much better than the ctf ones
GalactusToday at 1:07 PM
are you getting uncomfortable jap
feeling something happen down there