gtav-ent/GTAV-EnhancedNativeTrainer

Object/Prop Spawner?

Closed this issue · 10 comments

An Object/Prop Spawner would be an amazing feature to have to this mod.

Here's the current prop list for GTA http://ecb2.biz/releases/GTAV/lists/props.txt

Thanks for the list.

The question I ask myself is can we do something really worthwhile with props, especially something that hasn't been done before. I think I could do something good with the list - categorise, give them human readable names etc - but just spawning inanimate stuff along the lines of the vehicle spawner doesn't seem hugely useful or worth the effort.

If anyone has any ideas, post them up.

i have a vehicle / ped cannon that i wrote about a month back. I never submitted it as i didn't think it really fit in with the rest of this project. Its set up in its own cpp and h. If you would like to take a look ent i could submit a pull

I suppose i should give a few details.
I call it a cannon and not a spawner because i wrote it to create as much havoc as possible.
You can pick any vehicle or ped/animal (the tiger shark is pretty funny).
It's bound to a single key(I use N by default).
Hold the key to sent a line of entity's at whatever direction you happen to be looking/aiming.
For the vehicles it has something of an adaptive offset for things like trains or cargo planes.
It's pretty fun but it's not exactly an prop spawner. It seems like a good start thou.

Yeah, go for it. It won't be merged as-is but it's always good to have some sample code.

I'm wondering if it's feasible to apply an airbrake-style feature for prop placement. Unlike the player-centric one, it'd require a load of messing about with cameras though, so I'm not sure.

It might not have to be as complicated as the player brake system. you can toggle gravity for peds and i imagine as well for props. Also since props are not entities i doubt they are subject to native world updates. I had an issues when i first wrote the cannon where all the peds I shot ended up walking around mid air. At the time I was using a NULL group and was able to remedy the lack of gravity by using the native api's for setting gravity and its effect. Of course I later switched all the peds to a universal group without gravity issues.

I should have mentioned this last night but I submitted a pull request with the cannon I mentioned above

I saw, thanks. It looks like a useful guide to a few of the APIs.

I haven't had chance to do anything yet. The points about gravity are good info.

Re: the airbrake comment, my thoughts are that a prop spawner is only really useful if you can precisely place props in 3D space and thus create some sort of scene. Having them just plonked on the ground in front of the player - like we do vehicles - is only of novelty value. On the plus side there's a point-camera-at-entity function in the APIs so a kind of prop airbrake mode might be easier than I expected.

I suppose there's also the question of what we do regarding cleaning stuff up; for instance, how you delete something you accidentally made.

ENT if you need any help i don't mind helping with the prop/objects menu list.

As far as deleting misplaced props I have two suggestions.

Assuming that props/objects can be named and/or have unique hashes akin to ped's it should be possible to declare a few global strings or int's and store the last few objects the player spawned(perhaps a string with vector3 coords and a hash) and use them similar to a ctrl+z function.
I've seen an API for returning the hash of the ped the player is aiming at so I assume there may be a similar API for Objects(after saying it out loud I dosen't seem so likely anymore as I can't think of any point it the game where such an API would have been needed) that we can use to "on key push X delete ..." ... you get the jist.

The basics of this are done, so I'm going to close it and open multiple more specific issues.