Everything posted by PNWParksFan
-
Attach boat to trailer?
There's no way for players to attach a boat to the boat trailer. But is there a way to do it from a script? I looked through the natives and didn't really see anything promising. There must be some way because boats on trailers spawn in traffic.
-
Having a look at the Further Adventures in Finance and Felony Trailer
Just in time for me to resume work on Coastal Callouts!
-
CREATE_MISSION_TRAIN
From looking at your maps it appears that trains1 and trains2 overlap on a section of track, so depending on which track you end up on when you start the mission train, it'll go different directions. Later I'll try spawning it at the precise coordinates listed in one of the dat files and the other, to see what it does. I looked for all instances of the switch native in the decompiled scripts and found nothing in any of the heists-related scripts. I might go to one of the switch locations and just try every switch ID from 0 to 11 and see if it works.
-
CREATE_MISSION_TRAIN
BTW... I noticed that there's a fourth parameter and I'm not sure what it is. It's usually 0, but sometimes anything from 1-4. Could you set a different color for the blips depending on that parameter? e.g. white = 0, yellow = 1, blue = 2, green = 3, red = 4? Then we could see if there's a pattern to it... perhaps it means something to do with the switches or something like that.
-
CREATE_MISSION_TRAIN
Hm, very interesting. I wonder what's up with several of the tracks apparently being in the middle of the ocean? The switches are definitely weird. In several places, going over switches that weren't configured for the track I was on caused the train cars to just despawn as they hit the junction. Over by the quarry was especially weird; the direction of the train seemed to affect which direction it went at the switch! If the train engine was facing north, it would stay on the main track (regardless of whether the train was moving forward or backwards). If the train engine was facing south, it would take the siding into the quarry. In the decompiled scripts there's references to track junctions 1 through 11 being switched in various configurations. Not sure yet which switches are where.
-
CREATE_MISSION_TRAIN
I've got several things working, and several not. I'll start a github repo tomorrow for it. I can't get any of the removal methods to work, although just deleting the vehicle does work. Here's the crux of the code: Game.LogTrivial("Set random trains"); NativeFunction.Natives.SetRandomTrains(0); Game.LogTrivial("Delete trains"); NativeFunction.Natives.DeleteAllTrains(); Game.LogTrivial("Load models"); new Model("freight").LoadAndWait(); new Model("freightcar").LoadAndWait(); new Model("freightgrain").LoadAndWait(); new Model("freightcont1").LoadAndWait(); new Model("freightcont2").LoadAndWait(); new Model("freighttrailer").LoadAndWait(); Game.LogTrivial("Create train"); uint train_handle = NativeFunction.Natives.CreateMissionTrain<uint>(variation, x, y, z, direction); Vehicle train = NativeFunction.Natives.GetTrainCarriage<Vehicle>(train_handle, 0); Game.LogTrivial("Set speed"); NativeFunction.CallByName<uint>("SET_TRAIN_SPEED", train, 15.0f); Game.LogTrivial("Set cruise speed"); NativeFunction.CallByName<uint>("SET_TRAIN_CRUISE_SPEED", train, 15.0f);
-
New to this, Request for Custom F250 K9 for my son.
There's a few existing models which are close-ish. Modeling is very very time consuming and only a few people do it. Fewer yet do it well, so it's unlikely somebody will be able to create a custom model for you. But, making liveries for existing models is relatively easy and quick. If you're cool with one of the models below, somebody may be able to make a skin for you: This is probably the closest, a slicktop F350. And this one is IMO a higher quality model, definitely the best slicktop pickup truck on the site, but it's not as similar to your rig: If you're happy with one of those, let us know which one and perhaps someone can help you out. Or, you could download Paint.NET and give it a try yourself! Both models include templates in the downloads.
-
CREATE_MISSION_TRAIN
And that, ladies and gentlemen, is how you end up on a list at a three-letter agency. :P
-
Creating an INI file?
I don't prefer this method because it requires reading the file every time, vs reading it once when you start the mod. I expect you'd get better performance not having to read a file every time you check a setting.
-
Creating an INI file?
Here is a look at how I do it, with just a few of the settings shown for the sake of example: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Rage; using System.Windows.Forms; namespace BetterEMS { internal static class Settings { internal static Keys DispatchKey = Keys.OemSemicolon; internal static ControllerButtons DispatchButton = ControllerButtons.RightShoulder; internal static float DriveSpeed = 20f; internal static bool ShowReport = true; internal static void LoadSettings() { LogWrapper.LogTrivial("Loading EMS settings"); string path = "Plugins/LSPDFR/BetterEMS.ini"; InitializationFile ini = new InitializationFile(path); ini.Create(); DispatchKey = ini.ReadEnum<Keys>("Keybindings", "DispatchEMSKey", Keys.OemSemicolon); DispatchButton = ini.ReadEnum<ControllerButtons>("Keybindings", "DispatchEMSControllerButton", ControllerButtons.RightShoulder); DriveSpeed = (float)ini.ReadDouble("Response", "DriveSpeed", 20f); ShowReport = ini.ReadBoolean("Cleanup", "ShowIncidentReport", true); } } } Basically, you need to create an InitializationFile object, then call various Read[Something] methods to get the values you want. Details here: http://docs.ragepluginhook.net/html/DEEB0B71.htm There are methods to read pretty much all common types of values. For enums you have to specify what type of enum you're trying to read in the <brackets>, as shown for the key and button examples in the code snippet above. If you want to read a float you need to coerce it from a double, as shown. Your INI file should be layed out with sections and variables then, like so. Note how the [section names] are the first parameter in the Read functions above, and the variable names are the second. [Keybindings] DispatchEMSKey = OEMSemicolon DispatchEMSControllerButton = RightShoulder [Response] DriveSpeed = 20 [Cleanup] ShowIncidentReport = true You also need to make sure that you actually call that LoadSettings() method at some point. For example, in your Initialize() method would be a good place to put Settings.LoadSettings(). If you don't do that, you'll never actually load the settings, so it'll always use the defaults.
-
Creating an INI file?
It makes it a lot easier to keep things organized when you break out code for different features into different functions. I try to keep as little as possible in EntryPoint, for what it's worth. To elaborate on my suggestion from earlier: Create a new file called Settings.cs. Within it, create a static class called Settings. Add all of the settings you'll want in your file as static fields: internal static class Settings { internal static bool PlayMusic = true; internal static bool DoSomeOtherThing = false; internal static Keys SomeHotKeyOrWhatever = Keys.D8; internal static string PlayerName = "Name Not Set"; } Now add a static method called LoadSettings to load the settings: internal static class Settings { internal static bool PlayMusic = true; internal static bool DoSomeOtherThing = false; internal static Keys SomeHotKeyOrWhatever = Keys.D8; internal static string PlayerName = "Name Not Set"; internal static void LoadSettings() { // initialize the INI file // read each setting and set it // For details on how to do all this, look at docs.ragepluginhook.net under the InitializationFile class // I don't have access to look it up myself at this moment but will update this example later. } } In your Initialize function, call Settings.LoadSettings(). Then, whenever you need to use a setting in your code, just call it like so: if(Settings.PlayMusic) { // Play the music }
-
CREATE_MISSION_TRAIN
TRAINS!!!! lcpdfr.com converts from whacker forum to foamer forum in 3... 2... 1... Also, can I suggest that as we figure this out, maybe we could create an open source Trains project which could be on GitHub? That way everybody could benefit from the development.
-
CREATE_MISSION_TRAIN
Hahaha. I'm not even home from work yet, but hopefully sometime this weekend I can check it out.
-
CREATE_MISSION_TRAIN
I've never had to use pointers for natives, even those with an asterisk. Just using the ref keyword seems to work in my experience, e.g. // definition from nativeDB: SOME_NATIVE_NAME(param1, *param1) NativeFunction.Natives.NATIVE_NAME(thing1, ref thing2); Perhaps it doesn't work in all situations, but it's worked fine for me so far everywhere I've encountered that.
-
GTAV Update
The way GTA updates works, it doesn't replace most existing files, it just adds new RPF files to the DLC folder, e.g. patchday10ng will probably come next or something like that. But, if you update the game it will overwrite any files that have been modified if they aren't in the mods folder. If you only ever change things in the mod folder, then the only thing you'll need to re-setup is anything in update.rpf. Everything in the dlc folders or x64e.rpf shouldn't need to be changed if you keep them in the mod folder. The stuff that goes in update.rpf is mostly meta files, so you will need to re-do your vehicles.meta file and possibly some other stuff if you've messed with things like visualsettings.dat or gameconfig.xml.
-
Creating an INI file?
What I usually do is I create a static class called Settings, with static fields for all of the settings I want with default values declared. Then I create a LoadSettings method which loads each setting (if possible) or sets the default otherwise. Makes it easy to keep all the settings in one place.
-
CREATE_MISSION_TRAIN
Which decompiled script has the train mission stuff you're looking at? I can think of a few train-related missions from singleplayer. Do they all do it the same way?
-
CREATE_MISSION_TRAIN
Oooh. If you can get a train working that would be awesome... I have a few ideas for callouts involving trains but haven't yet tried to actually make the train work.
-
GTAV Update
There's easier ways. And yes, updates pretty much always break everything. Using a mods folder makes it a lot easier, because then you only have to replace things in update.rpf for the mostpart. Just put steam in offline mode and it'll be a lot easier. You can also make a backup of all your game files so you can just restore them after the update.
-
I believe your website might be infected.
Or just use the manual installer. Much safer that way.
-
Can I put ANY plugin into plugin/lspdfr folder ?
It just won't do anything. LSPDFR looks for a class that inherits the Plugin class and runs the Initialize method. RPH looks for something entirely different. You can only use plugins... in the way they were meant to be used.
-
Custom Backup
You want to be able to configure a hotkey to call in a specific unit, so you don't have to go through the menu?
- 378 comments
- 23 reviews
-
Make a Ped Play an Animation?
A little tip, you don't need to create an AnimationDictionary object because there's an implicit conversion from string to AnimationDictionary. So, you can just call Ped.Tasks.PlayAnimation("anim_name", "animation@dictionary@name", ...); directly rather than PlayAnimation("anim_name", new AnimationDictionary("animation@dictionary@name"), ...);
-
A way to have a Ped hold an object (guitar)?
Entity.AttachTo http://docs.ragepluginhook.net/html/C1ED0C53.htm
-
[WIP, REL] Better EMS
Beta 4 is now available! The same download link as Beta 3 will take you to the new Beta 4, so if you have that link just go ahead and download the new version. Lots of significant fixes and improvements in this version, with big thanks to everybody who helped report the various bugs and issues now resolved: The INI file will actually work... hehe. Animations are 1000% better. No more peds flying up in the air, and when the peds get set to alive in order to apply the CPR animations, they'll only insta-pop up for a split second - you can hardly see it. Overall the animations should actually look fairly smooth and natural now. Internal improvements to the integration with Custom Backup, so if you're using Custom Backup you'll need to copy over the new DLL provided in the extras folder of the beta download. Fixed a bug where canceling the EMS response would result in patient peds being frozen, invincible, and alive but in a death-like animation. Now when you cancel the EMS call peds will be cleaned up correctly. Fixed a bug where if the 2nd unit to arrive on scene got stuck in traffic, its driver would stand up inside the vehicle and not actually be "in" the driver's seat if the first unit finished treating all patients before the 2nd unit arrived. Various small bug fixes and many internal improvements. We are getting pretty close to a public release! At this time I'm not in need of any additional beta testers, but for those of you already helping with the beta testing please do continue to provide feedback on the new version. Also, if anybody who makes LSPDFR YouTube videos is interested in doing a feature of this mod in their video, please PM me for details.