Author | Message |
Lagano
Posts: 1739
Location: Slovenia West side Occupation: Taking it easy Age: 24 V$: :$V |
#201 2018-02-27 01:26 |
# RedCarDriver : Another question: Would it be feasible to write a function to queue a gear change into a specific gear, to make it possible to use a shifter controller (e.g. on the Logitech G27) to shift into specific gears?^ I wanted this for a long time! I'm sure you guys can figure something out |
|
amilmand
Posts: 259
Location: --- Occupation: Age: V$: |
#202 2018-02-27 11:50 |
It can be done with some limitations as always, I added a new function to the chassis.class
public native int getIndexedAddr( int index );which acts similar to the getIndexedData but instead of returning the data as float pointed by the offset it returns the offset this coupled with the address of the current gear as an int which is the gear ratio + 0x20 or public static final int IndexedData_GearNumber = 0x20FC-0x304;is enough to set the gear to a specific hmm gear the numbering goes as expected but the R is 7. With an example call of RawEdit.setI(player.car.chassis.getIndexedAddr(Chassis.IndexedData_GearNumber),4);the result is: (mind you I have the ThrottleOnInAutoShiftDeadTime at 1.0 that is why the original shifting results in some throttling this also exemplifies that ofcourse there is some difference in setting the gear like this and through the "controller" (the ingame class not the peripheral) and this can be a limitation there will be no dead time just an instant shift) If the car is set to automatic in the settings the game will overwrite the changes made to this offset. I updated the files under the links of SlrrExhaustive Bits (including the AdditionalChassisFunctions.txt) |
|
holeecrab
Posts: 882
Location: Indonesia Occupation: Delusional Artist Age: 26 V$: vipka |
#203 2018-02-27 14:37 |
Pardon my stupidity, but is the thing you did right now was to imitate how clutch kick works irl?
|
|
amilmand
Posts: 259
Location: --- Occupation: Age: V$: |
#204 2018-02-27 15:11 |
Well I dont really know how "clutch kick"-ing works taking the def from this post (LINK) no, I mean the engine will not rev up it is more like you change the gear really fast like lightning fast so the ratio changes but the rpm stays exactly the same as in the previous gear, but this is as of yet just a potential mod, I only did the groundwork, didn't change gameplay in any way.
Added 2 minutes later: Thinking about it the clutch kicking is already in the game if you have the ThrottleOnInAutoShiftDeadTime at 1 and the ClutchOnInAutoShiftDeadTime at 0 this will mean that when you change the gear the clutch wont be pressed but the throttle will be floored |
|
Bigg Boss93
Posts: 4024
http://rdbl.co/1Hmg5XL Location: Italy - Sardegna Occupation: Swimming out of the shit pool Age: 30 V$: More than you can afford, pal. |
#205 2018-02-27 16:11 |
The last time i checked, clutch kicking has nothing to share with shifting, you literally give a kick to the clutch while accelerating so that the engine does momentarily overrev and, once the clutch has stopped the frictioning moment, and thus is stuck back to the flywheel, the car will have a kind of "boost" effect, the wheels will start spinning and thus, on an rwd, help you getting sideways.
You can do this in sl by its own, no need to edit anything, just have to make sure you're at the right rpm before... kicking. |
|
amilmand
Posts: 259
Location: --- Occupation: Age: V$: |
#206 2018-02-28 21:27 |
gorgoil: This was quite some time ago but I found out that there is a box trigger "natively" in the game check the source of the Trigger class there is a constructor for it: public Trigger( GameRef parent, GameRef type, Vector3 pos, float x, float y, float z, String alias) { if( type == null ) type = new GameRef( DEFAULT ); trigger = new GameRef(parent, type.id(), pos.toString() +",0,0,0,box,"+ x +","+ y +","+ z, alias); } Added 30 minutes later: Oh and I'm fairly certain that the 3 zeros following the position are the ypr rotation coordinates. trigger = new GameRef(parent, type.id(), pos.toString() +",y,p,r,box,"+ x +","+ y +","+ z, alias);So someone can make box triggers with 9 degrees of freedom if needs be. Added 1 hour 23 minutes later: Here is a function for ease of use (this can be used with the addTrigger function of the track class with the signature: public Trigger addTrigger( Trigger t, Vector3 pos, RenderRef marker, String handler )) public Trigger MakeBoxTrigger( GameRef parent, GameRef type, Vector3 pos, float x, float y, float z, float yaw, float pitch,float roll, String alias) { Trigger ret = new Trigger(parent,type,pos,alias); ret.trigger.destroy(); ret.trigger=null; if( type == null ) type = new GameRef( system:0x00000034r ); ret.trigger = new GameRef(parent, type.id(), pos.toString() +","+yaw+","+pitch+","+roll+",box,"+ x +","+ y +","+ z, alias); return ret; } This post was edited by amilmand (2018-02-28 23:21, ago) |
|
GolfPlaya |
#207 2018-03-01 17:08 |
Hey Guys
I'm new to this whole scripting thing. Wanted to find out how to put pure sound packs for engines *LINK* *LINK* Normally just add text lines to the java yet it crashes when I try Or is it easier to put sounds and select them via chassis can someone show me how Game play is awesome I would love to have some good engine sounds for all those engines |
|
amilmand
Posts: 259
Location: --- Occupation: Age: V$: |
#208 2018-03-01 19:25 |
Thanks for the links yes I think the most reasonable way would be to add them to the chassis' sound overwrite functionality I will try to merge it and add it to the patch.
Added 1 hour 44 minutes later: I updated the file under the patch link to include the additional sound overwrites. (SlrrExhaustive Patch Link) This post was edited by amilmand (2018-03-02 04:01, ago) |
|
adnan54
Posts: 289
Location: Brazil Occupation: student Age: 25 V$: |
#209 2018-03-02 20:12 |
I was wondering if it is possible to set the player car (and bot car aswell) speed and rpm using the RawEdit.setF method? It would help a lot
|
|
Something wrong is not right.
|
|
amilmand
Posts: 259
Location: --- Occupation: Age: V$: |
#210 2018-03-02 22:23 |
The speed can be set by the setvel command detailed and exemplified on the previous page LINK
The rpm will be conform with the new velocity if the tyres got traction. Though setting the rpm directly will not work because the game-engine will overwrite the data you force on it. However you can simulate the behaviour by setting the throttle strength with a script like: RawEdit.setF(player.car.chassis.getIndexedAddr(Chassis.IndexedData_ThrottleStrength),10);mind you this value is supposed to be in the range of [0-1] nevertheless the game accepts and handles extreme values relatively well (setting it to some obscene amount will brake the engine for example, but if you set it to like 10 the engine wont brake it will just simulate the possibility that you can press the throttle actually through the floor if this makes sense) But this value again will be overwritten by the engine the next frame but will fall of from where you set it so if you set the throttle value the engine will rev up and rev down normally as if you released the pedal, you would need to set this actively (every frame or similarly) to simulate a pressed state but I think that is logical. |
|
Snowyy
Posts: 560
Location: Poland Occupation: fursuiting Age: 22 V$: yes |
#211 2018-03-02 22:40 |
Hi amilmand, I am experiencing a weird bug/feature (not sure lol) which makes it impossible to quick repair the car/open it's dorrs when outside of the garage. Is there a way to fux this? I am using your reshadepack for MWM simply because it makes my game finally somewhat decent looking. Thanks
|
|
amilmand
Posts: 259
Location: --- Occupation: Age: V$: |
#212 2018-03-03 01:33 |
I do not use these features though I did not remove them intentionally (I think you have to activate cheat mode for them to be available but I dont know how thats done either)
I think BB's pack has them tested (and more of these screenshot related features) he also was kind enough to adopt my modifications to his track implementation try using his with a version based on his game rather than pure MWM but I dont know you can try it on MWM it might work I skimmed through the script I didn't find anything standing out to be incompatible with MWM but I might be wrong. LINK |
|
adnan54
Posts: 289
Location: Brazil Occupation: student Age: 25 V$: |
#213 2018-03-03 02:07 |
# amilmand : The speed can be set by the setvel command detailed and exemplified on the previous page LINK I've tried the setvel but what actually i need is something more "simple": basically i need something that limits the car speed, like the cruise control in valo city, but working for all tracks Setting the throttle strength kinda worked but not as expected |
|
Something wrong is not right.
|
|
amilmand
Posts: 259
Location: --- Occupation: Age: V$: |
#214 2018-03-03 03:30 |
adnan54:Sadly I dont know of a simpler method For the AI cars you can use a spline in an spl and the followSplineTrack function with that you can limit the speed and set the route. For the player as of yet you will need an active monitor to enforce the speed limit. The cruise control uses data from the .trc file maybe you can take a look at the decoder and the decoded city.trc as you seem to have motivation. |
|
adnan54
Posts: 289
Location: Brazil Occupation: student Age: 25 V$: |
#215 2018-03-03 05:01 |
I've used the following "script":
if (playerspeed>80) { RawEdit.setF(player.car.chassis.getIndexedAddr(Chassis.IndexedData_ThrottleStrength),0.0); RawEdit.setF(player.car.chassis.getIndexedAddr(Chassis.IndexedData_BreakStrength),1.0); } it keeps the car near to the designated speed, but sometimes the car speed slowly increase (and also the car engine sounds weird). Limiting the speed in the spl would help me too (i had read about it sometime ago, but cant remember where(and also i cant remember the correct "syntax" for spl files)) |
|
Something wrong is not right.
|
|
amilmand
Posts: 259
Location: --- Occupation: Age: V$: |
#216 2018-03-03 15:06 |
oh we have the spl syntax in the endnotes of the article (LINK)here is the relevant part:
The .spl file spline row format (%LF is float %d is int) is: (%lf %lf %lf) (%lf %lf %lf) %lf %lf %d %lf %lf %d: (pos XYZ), (normal XYZ), splineWidth, targetVelocity, I do not know the rest the two ints are used as bools the list of first two vectors define a closed cubic Hermite spline. I have posted a program before that can be used to create spl files so the syntax is not directly useful (though this program was not made for general use it is functional) (originally I made this to define the tournament tracks so there is functionality that is not needed for simple spl generation) Spls as I mentioned in the article must be closed and this program enforces that and it generates the normals for the control points. For spl creation you should click Render select the rpk of the map you want to define the spl for. After it loads select the Marker from the list, you can move around the marker with the middle mouse button held down rotate the camera with the other buttons, if you have the left shift held down the marker will move up/down The AddSpl button loads an spl file already saved. Del deletes the closest control point to the marker. AddNodeAtMarker will add a control point at the marker (keep in mind we are defining a closed spline) Snap will snap the closest control point to the marker. SaveSpl is evident. DuplicateNode will copy and slightly move the closest control point to the marker. GenAllNorms is not needed the normals will be generated upon saving regardless. RndSpl will randomize the position of the control points a little. You can also directly edit the properties of a control point with the text boxes. MarkStart and MarkFinish are for the tournament definition. The other controls are for other modes of editing (this program can be used to modify(on a very low level) the map vertices and phys objects by selecting a "different" file extension in the openfiledialog) Here is a link to the program. LINK I must emphasise that this was made for a direct purpose (defining the tournaments in slrrexhaustive) and its code is terrible more of a test or a proof of concept I really wouldn't want to extend this program further before refactoring (nevertheless the source code is available from the SlrrExhaustive main download) the program needs the .net framework 4.5.2 |
|
adnan54
Posts: 289
Location: Brazil Occupation: student Age: 25 V$: |
#217 2018-03-04 05:07 |
# amilmand : I must emphasise that this was made for a direct purpose (defining the tournaments in slrrexhaustive) and its code is terrible more of a test or a proof of concept I really wouldn't want to extend this program further before refactoring (nevertheless the source code is available from the SlrrExhaustive main download)Still a very powerful tool, thank you |
|
Something wrong is not right.
|
|
amilmand
Posts: 259
Location: --- Occupation: Age: V$: |
#218 2018-03-04 11:15 |
I found a way to set the speed limit for the cruise mode luckily it is set in the AI part of a vehicle which is relatively easy to access here are some lines that can be used to engage the cruise mode and set the speed limit for a given car:
public static final int IndexedData_Flags = 0x70; //these should go in the chassis.java public static final int IndexedData_SpeedLimit = 0x2104; ... int flags = RawEdit.getI(player.car.chassis.getIndexedAddr(Chassis.IndexedData_Flags));//these should go where you want to set the limit flags |= 0x1000;//this sets the cruise mode on to set it to off this line should be flags &= 0xFFFFEFFF RawEdit.setI(player.car.chassis.getIndexedAddr(Chassis.IndexedData_Flags),flags); RawEdit.setF(player.car.chassis.getIndexedAddr(Chassis.IndexedData_SpeedLimit),1.0);this 1.0 will be the speed limit mind you this is not in kph or anything related its in some arbitrary unit, 13.33 is the fall back value so this 13 should be some theoretical maximum you would need to play with the values to find an optimum. (1.0 is around 5-10 kph) Added 1 minute later: I mean this will work on tracks that do not define their trc file I did not test it in Valocity but I would presume the original values in the trc file will overwrite direct manipulation with the RawEdit class. |
|
amilmand
Posts: 259
Location: --- Occupation: Age: V$: |
#219 2018-03-04 14:11 |
I tried it out the AI cars will stick to the limit set in this way when they are following a spline, and for the player's car (I only tested the player's) the limit will not get overwritten in valocity.
|
|
gorgoil
Posts: 271
Location: Portugal , "Oh Cristiano Ronaldo" Island Occupation: Valo City Drag Racer/Organizer Age: 27 V$: 0 |
#220 2018-03-04 18:39 |
# amilmand : I found a way to set the speed limit for the cruise mode luckily it is set in the AI part of a vehicle which is relatively easy to access here are some lines that can be used to engage the cruise mode and set the speed limit for a given car: this is really useful I've figured 1 is around 3.3km/h, and 20 sets the speed limit at 62km/h, this will help me with an idea I had a year ago I didn't made that idea because I needed to have a way to set speed limit |
|
|
|
amilmand
Posts: 259
Location: --- Occupation: Age: V$: |
#221 2018-03-04 20:46 |
I improved the cruise behaviour a little I added a break factor to the cruise mode when the car is travelling faster than the limit it will brake by that amount this is a global value at the address 0x618034 the default value is 0.5 (this value will overwrite the players input if the car is going faster than the limit so 0.0 is inadvisable) there is a way now to disable the automatic steering of the cruise control (globally again) int at the address 0x618038 default value 0 (not disabled) these values can be accessed from the reshade config and also from the RawEdit class.
I updated the links of SlrrExhaustive Bits |
|
adnan54
Posts: 289
Location: Brazil Occupation: student Age: 25 V$: |
#222 2018-03-05 00:34 |
awesome
|
|
Something wrong is not right.
|
|
Runaeh
Posts: 130
Location: Denmark Occupation: building cars,motorcycles,scooters ect Age: 28 V$: |
#223 2018-03-05 16:37 |
how about a "wheel" mode where you can insert buttons for each gear so we can use a h-pattern shifter like a g27, then switchable so when not on you have the standard up and downshift buttons ?
|
|
amilmand
Posts: 259
Location: --- Occupation: Age: V$: |
#224 2018-03-05 18:28 |
I dont have the hardware, the groundwork is done someone with access to proper testing environment should be the one to do this.
If you do then jump on it surely people will love the mod |
|
gorgoil
Posts: 271
Location: Portugal , "Oh Cristiano Ronaldo" Island Occupation: Valo City Drag Racer/Organizer Age: 27 V$: 0 |
#225 2018-03-05 19:01 |
# Runaeh : how about a "wheel" mode where you can insert buttons for each gear so we can use a h-pattern shifter like a g27, then switchable so when not on you have the standard up and downshift buttons ? that's already on progress |
|
|
|
Holy Shit Man
Posts: 2554
Location: Poland Occupation: Faking skills like a pro Age: V$: No |
#226 2018-03-05 19:21 |
Hey, is this possible to make some sort of fast loader for SLRR that would go instantly into last used career instead of showing main menu?
|
|
amilmand
Posts: 259
Location: --- Occupation: Age: V$: |
#227 2018-03-06 02:21 |
Thats not a bad idea ALAN.
For that I added two new functions to the File class though they are pretty hmm peculiar. I'm calling the GetFileTime API and returning the low and high DWORD of the LastWriteTime but these values are unsigned and the slrr script engine only supports signed integers so the return values are strange though not impossible to use (I added a "continue last saved carrier" button to the SlrrExhaustive patch link) If you have two unsigned integers interpreted as signed ones their arithmetic changes significantly for example a function deciding if a > b given the two numbers are badly interpreted would look like: int BadReinterpretGreater(int a, int b) { if(a >= 0 && b < 0) return 0; if(a < 0 && b >= 0) return 1; if(a > b) return 1; return 0; } But this is enough to find the most recent saved file so I stopped here. I also added these functions to the SlrrExhaustive Bits although I doubt it will be used frequently |
|
adnan54
Posts: 289
Location: Brazil Occupation: student Age: 25 V$: |
#228 2018-03-06 03:27 |
It come in handy for who makes car mods, especially for fixing the driver position or the car weight distribution
|
|
Something wrong is not right.
|
|
Stevo2
Posts: 100
Location: Thailand Occupation: Age: 62 V$: สองร้อย |
#229 2018-03-06 08:40 |
Good point, Adnan .. also for setting up car wheelbase and track dimensions when fine scaling the car.
Good job, Amilmand... your contribution is a huge leap forward for SLRR |
|
Holy Shit Man
Posts: 2554
Location: Poland Occupation: Faking skills like a pro Age: V$: No |
#230 2018-03-06 18:10 |
Downloaded Exhaustive, applied patch...
I'm using ReShade version (because as far I can see it's the only updated so far) |
|
amilmand
Posts: 259
Location: --- Occupation: Age: V$: |
#231 2018-03-06 18:28 |
Hmmm which patch?
The downloads on SlrrExhaustive Bits are not for SlrrExhaustive. For that the patch link is PatchLink But this error suggests that you somehow have the MainMenu from SlrrExhaustive in a base game All the links have been updated with the new exe and the new function definitions in the File.java I wont include a MainMenu.java there because it is different for each version of the game. If you want to add this button (continue last) to some arbitrary MainMenu.java from the MainMenu of SlrrExhaustive copy the CMD_CONTINUE related part and the BadReinterpretGreater function. But you can delete that line MainMenu.java line 35. Thats just there to preload some lookups they will be loaded in first request anyway. That line should look like: PartsCache.GetEntry(0);Why is it looking for the function in the MainMenu class? |
|
Holy Shit Man
Posts: 2554
Location: Poland Occupation: Faking skills like a pro Age: V$: No |
#232 2018-03-06 18:47 |
I meant SlrrExhaustive Bits, yeah. And I've just noticed the patch is standalone. I've reinstalled the no ReShade version on clean SLRR (BB's) and now I cannot buy any car...
|
|
amilmand
Posts: 259
Location: --- Occupation: Age: V$: |
#233 2018-03-06 20:28 |
BB's clean version does not have a Honda in it as far as I know so this is not a clean install.
Also the SlrrExhaustive Bits downloads do not modify anything related to this error (not even the chassis.class by default and certainly not the brake classes) Which version did you use of BB? I tried this one LINK it works as intended. Though I suspect you still have SlrrExhaustive mixed in this because the chassis.java I'm fairly certain is from SlrrExhaustive because it is the only one (from the pure MWM chassis.java, stock Slrr chassis.java and the exhaustive one) that has an updatevariables() call on line 400. The patch (PatchLink) is not standalone it is for the new SlrrExhaustive (1.8). The Bits versions are fore arbitrary installs. |
|
Holy Shit Man
Posts: 2554
Location: Poland Occupation: Faking skills like a pro Age: V$: No |
#234 2018-03-06 20:35 |
Exhaustive bits don't do anything with installed cars too, so that's not the case. And I don't even have your game, so... Whatever. I'll stick to vanilla
|
|
amilmand
Posts: 259
Location: --- Occupation: Age: V$: |
#235 2018-03-06 20:53 |
Dont give up
There are some very essential fixes (car deloading from behind the camera, decal crashfix [..]) included in these patches at least use the new exe from one of them. |
|
RedCarDriver
Posts: 1211
Location: United States Arizona Occupation: it's complicated... more complicated than my relationships Age: 30 V$: 86310 |
#236 2018-03-08 00:52 |
I'm getting a game crash from the d3d9.dll from approximately Feb 21, by the way. If that's not the latest one, I can go download the current one.
|
|
|
|
amilmand
Posts: 259
Location: --- Occupation: Age: V$: |
#237 2018-03-08 01:22 |
March 4 is the latest one
|
|
Franco
Posts: 1082
Location: Argentina hmmmm Occupation: Franco Age: 33 V$: |
#238 2018-03-10 15:54 |
really love what you acomplished here, and i have a question, i'm a bit rusted with slr, used to mod it, i did lots of rims, and i always wanted a feature.... may be posible....
like a lot of other games do, is it posible for change the mesh of a rim, lets say at certain speed, so this way, we can have motion blur efecto on the wheels, even with the game paused, i think Assetto Corsa does it this way, you have a mesh for when the Wheel is stationary, and once it moves to a certain speed, lets say 10kmph, the mesh switchs for another one which looks blurred, so when you pause the game, the blur on the wheels stay there... dont know if i made myself clear... |
|
amilmand
Posts: 259
Location: --- Occupation: Age: V$: |
#239 2018-03-10 16:23 |
The part class has getMesh/setMesh, getRenderType/setRenderType functions it may be achievable with those but I recall these returning typeIDs with an rpk index of 0xff meaning they are runtime generated but who knows, maybe you can make a part with the wanted visuals and then just use the typeIDs returned by that.
If there is no standard way to do this than I'm afraid it can not be done yet, this would need full understanding of the virtual draw calls and then further more adding some parameters to the hierarchy (so reshade would know which draw calls correspond to the desired meshes and so on), far too advanced compared to the simple hacks I've been doing. |
|
Bigg Boss93
Posts: 4024
http://rdbl.co/1Hmg5XL Location: Italy - Sardegna Occupation: Swimming out of the shit pool Age: 30 V$: More than you can afford, pal. |
#240 2018-03-10 16:40 |
Wouldnt a simple check with getspeedsquare, done in multiple steps(for the different speeds), mixed with a renderref with a new mesh' render id do the job?
Kinda like RedCarDriver did for my "Community Rimpack", you can see it in the HK15_WheelWithExtras and HK15_WheelFace javas. |
|