Author Message

Driftmonkey06370

fr
Posts: 21
http://https://discord.gg/3tqqP8V
Location: France Cannes
Occupation: BrapTeam
Age: 23
V$:
#481   2018-11-13 10:56          
Nice :D

TEKKE078

ar
Posts: 11

Location: Argentina , a province that is between rivers.
Occupation: Play some drumz and crash this shet.
Age: 14
V$: Crysis
#482   2018-11-13 16:34          
Dude, you are AWESOME! :bow:


> I still drive a bike, FOCKยก

gorgoil

pt
Posts: 192

Location: Portugal , "Oh Cristiano Ronaldo" Island
Occupation: Making SLRR crash since 2005
Age: 21
V$:
#483   2018-11-13 20:28          
man that's awesome :D with that I can finally make one of my dreams in SLRR wheelie competitions :P

RedCarDriver

us
Posts: 1184

Location: United States Arizona
Occupation: Programmer with not enough spare time
Age: 25
V$: 73560
#484   2018-11-15 23:01          
# amilmand : Almost there but as you found out (judging by the static cast to int) this function returns a float soo its no good for you the full call would be to get the address of the value and decode it as an int:
RawEdit.getI(the_car.getIndexedAddr(Chassis.IndexedData_Flags));
The clues would have been: LINK
And the comments in the chassis.java:
public static final int IndexedData_GearNumber = 0x20FC-0x304;
   //this is an int getIndexedData will return
     strange but the RawEdit.getI with getIndexedAddr will suffice
public static final int IndexedData_Flags = 0x70;//int
Thanks, I think that was what I needed. It's returning really weird values, though. It doesn't seem to be correctly changing when the turn signals turn on.

I dont know what your goal is with the flags but I found that access to this value is of a readonly manner as most of the flags the game updates each frame and invalidates any changes you try to force (though you can get interesting state indicators so to say, (whether the blinker is on, is the car running and some others)
The idea here is to program something like American turn signals, where a single red light is shared for the city, brake, and turn signal functions, and the light turns off entirely when the turn signals are on at the same time as the brake or city lights. (Reference if you have no idea what I'm talking about.)

So basically, the pseudocode should go like this:
if flags & 1
 > if flags & 16
 > > turn off brake light
 > otherwise
 > > turn on brake light
if flags & 1
 > if flags & 16
 > > turn off city light
 > otherwise
 > turn on city light
if !(flags & 1) && !(flags & 4)
 > if flags & 16
 > > turn on brake light
But I can't quite get the flags to work.

By the way, is there a convenient way to display a glow object (or other render) aligned to a part, through Java, besides making it a whole separate part that can then be manipulated? I haven't figured this out yet. I have figured out how to display a render as a child of the part, but it always shows up at the center of the map. I can in fact make attachment parts for all of the glow objects, and then make them disappear under the map by moving their slot position, but I'd prefer not to do this if there is a more light-weight alternative (in terms of part count as well as not slowing down the game).

This post was edited by RedCarDriver (2018-11-15 23:21, 5 days ago)

Bigg Boss93

it
Posts: 3964
http://rdbl.co/1Hmg5XL
Location: Italy - Sardegna
Occupation: Overhyping machine
Age: 25
V$: More than you can afford, pal.
#485   2018-11-16 00:17          
# amilmand :

Vibration when? :))
Diegorborges about my Valo fix: "Now all of you must have your slrr folder like this: C:/BIGBOSSisMYlordANDiamHISbitch/SLRR LOL" :O




amilmand

00
Posts: 249

Location: ---
Occupation:
Age:
V$:
#486   2018-11-16 09:23          
RedCarDriver:
It's returning really weird values
These are not the flags set in the cfgs those are lost upon loading of the cfg (or rather they are not loaded to memory so its impossible to manipulate them directly as of yet)

RedCarDriver:
American turn signals
I dont see a clear (reasonable) way to do this with the current setup.

RedCarDriver:
glow object (or other render) aligned to a part
I only know of the way you described with making parts and slots a sophistication of the method would be to use the SetRenderType function of the Part class as to circumvent the actual attachment and detachment, or the slot movement and avoid suffering the flying glows upon flipping the car, also speed up the process somewhat.
The bad solution would be active monitoring and aligning the matrices but that is a horrendous idea.

Also there are some functions in the RenderRef class which you can try (I managed to change the color of the glow of a given (head)light but not of the projected texture) these are:
public native void setLight( int diffuse, int ambient, int specular );
public native void setFlare( ResourceRef glowtexture, int glowColor, float glowMinSize, float glowMaxSize, int flareCount, int rayCount );
So if you had detachable indicator and other lights(bulbs maybe) you probably would be able to make them do what you want but its getting complicated :/ (need to check if the parent-chassis has ignition and what not)

Bigg Boss93:
Vibration
:)

RedCarDriver

us
Posts: 1184

Location: United States Arizona
Occupation: Programmer with not enough spare time
Age: 25
V$: 73560
#487   2018-11-16 09:43          
Alright, thanks. I was afraid it was going to be impossible to read the car's flags well enough to tell whether or not the headlights (or indicators, etc) are on. Thanks for the help, in any case.

RedCarDriver

us
Posts: 1184

Location: United States Arizona
Occupation: Programmer with not enough spare time
Age: 25
V$: 73560
#488   2018-11-21 04:11          
I'm experiencing reproducible crashing if the cursor is on a menu button while the ReShade effects are loading. Is there a way to fix this?

This post was edited by RedCarDriver (2018-11-21 06:15, 6 hours 23 minutes ago)

amilmand

00
Posts: 249

Location: ---
Occupation:
Age:
V$:
#489   2018-11-21 08:21          
Maybe, crash it with this: LINK
And tell me the faulting module(it should be d3d9.dll if its the slrr_gi.exe we may manage) and offset (if windows doesnt tell you off the bat in the error message try: LINK)

RedCarDriver:
I was afraid it was going to be impossible to read the car's flags well enough to tell whether or not the headlights (or indicators, etc) are on
I missed this somehow well this is not entirely true you can check for whether the car thinks its night time (this is the same flag that gets checked by the lights) and check for the rpm if its >0 if so the lights are most probably on, there is also a flag for the indicators (but of course for that to actually get flipped the cruse mode needs to be on) and all this is read only as the game overwrites changes.
Code would look along the lines:
int flags = RawEdit.getI(GameLogic.player.car.chassis.getIndexedAddr(Chassis.IndexedData_Flags));
float rpm = GameLogic.player.car.chassis.getIndexedData(Chassis.IndexedData_RPM);
if((flags & 0x8) != 0 && rpm > 1)
{
  //lights are most probably on
}
if((flags & 0x10000) != 0)
{
  //left indicator blinking (mind you this is true for the whole time its in the blinking state not just when its actually lit)
}
if((flags & 0x20000) != 0)
{
  /right indicator
}

But really you dont even need this, you can check for the steering with
getIndexedData(Chassis.IndexedData_CurrentSteering1) (the game does the same for the built in method)
for the indicators, (even enforce them when cruise mode is inactive).
And the current game time also can be acquired (the game checks for (currentTime < 75600 && currentTime >= 21600)) along with the rpm.
(and again the whole shabang for brake lights, IndexedData_BreakStrength, or clucth lights (if that is a thing) IndexedData_ClutchStrength ooor nitro lights IndexedData_NitroStrength and alot others)

RedCarDriver

us
Posts: 1184

Location: United States Arizona
Occupation: Programmer with not enough spare time
Age: 25
V$: 73560
#490   2018-11-21 09:31          
# amilmand : Maybe, crash it with this: LINK
And tell me the faulting module(it should be d3d9.dll if its the slrr_gi.exe we may manage) and offset (if windows doesnt tell you off the bat in the error message try: LINK)

Alright, I'll try that.

I missed this somehow well this is not entirely true you can check for whether the car thinks its night time (this is the same flag that gets checked by the lights) and check for the rpm if its >0 if so the lights are most probably on, there is also a flag for the indicators (but of course for that to actually get flipped the cruse mode needs to be on) and all this is read only as the game overwrites changes.
Code would look along the lines:
int flags = RawEdit.getI(GameLogic.player.car.chassis.getIndexedAddr(Chassis.IndexedData_Flags));
float rpm = GameLogic.player.car.chassis.getIndexedData(Chassis.IndexedData_RPM);
if((flags & 0x8) != 0 && rpm > 1)
{
  //lights are most probably on
}
if((flags & 0x10000) != 0)
{
  //left indicator blinking (mind you this is true for the whole time its in the blinking state not just when its actually lit)
}
if((flags & 0x20000) != 0)
{
  /right indicator
}

That's actually exactly what I wanted, thanks! I'll try that out. And yes, I did want it to happen only when cruise mode is on - I wanted the custom turn signals to come on at exactly the same times as existing SLRR turn signals, except with the changes necessary to make them behave like American signals.

This post was edited by RedCarDriver (2018-11-21 09:47, 2 hours 51 minutes ago)