as we really have a lot of time to spend actually, I've decided to write some code !
I've understood how to play with gravity, control and accel coefs, and it works fine.
but I'm stucked at a point :
I can't change these coefs once the round has started,
well, in fact, I can change the values, and if I read them, they have changed, but it seems that these modifications doesn't work ...
As I'm not sure to be understandable, , here's an exemple :
Let's say that, at the start of the map, gravity is 0.1 and accel is 1.
If I trry to make to invert these values (gravity 1. and accel 0.1) at a checkpoint, then the car will still accelerate a lot and fly too much ...
First, I thought that once the round has started, I can't change these coefs, but as some block can now do the same thing, I don't think that the problem is there.
Here's a piece of code, am I doing something wrong ?
Code: Select all
#S_GraviyCoef = 0.1
#S_AccelCoef = 1.
***Match_InitRound***
***
foreach (Player in Players) {
SetDefaultCoefs(Player);
}
***
***Match_PlayLoop***
***
foreach (Event in PendingEvents) {
if (Event.Type == CTmModeEvent::EType::WayPoint) {
SetNewCoefs(Event.Player);
// this won't work either :
// Event.Player.Gravity = 1.;
// Event.Player.Accel = 0.1;
}
}
***
// --------------- //
// Functions
// --------------- //
Void SetDefaultCoefs (CTmPlayer _Player) {
_Player.GravityCoef = S_GravityCoef;
_Player.AccelCoef = S_AccelCoef ;
UIManager.UIAll.SendChat(TextLib::Compose("Default coefs set : Gravity: %1, Accel: %2", TextLib::ToText(_Player.GravityCoef), TextLib::ToText(Player.AccelCoef)));
}
Void SetNewCoefs(CTmPlayer _Player) {
_Player.Gravity = 1.;
_Player.Accel= 0.1;
UIManager.UIAll.SendChat(TextLib::Compose("New coefs set for player %1 : Gravity: %2, Accel: %3",_Player.User.Login TextLib::ToText(_Player.GravityCoef), TextLib::ToText(Player.AccelCoef)));
}
At the begining of the round : Default coefs set : Gravity: 0.1, Accel: 1
When I reach a checkpoint : New coefs set for player viok_buse : Gravity: 1, Accel: 0.1
My prob is that even if the values changed, the car still have the same behaviour before and after the first checkpoint ...
So, can't I change the values during the round ? or Have I made a mistake in my code ?
Any other ideas ?
Thanks a lot for your responses =)