Ulysses

Ulysses Stuff => Suggestions => Topic started by: PAL-18 on January 12, 2013, 05:07:57 PM

Title: [Request] Spawn Vehicle Plugin
Post by: PAL-18 on January 12, 2013, 05:07:57 PM
I'm no coder so i can't do this myself, but can anyone make this:

A command that when used (eg. !car) that spawns a vehicle for the player who uses it.  Just 1 vehicle should spawn and if they use it again, then their old vehicle is despawned and the new one replaces it.  There should also be a timeout of like 1 minute where they cant use it again (to prevent spamming).

P.S. I know this can be done in sandbox with the Gmod GUI, but im using a gamemode that doesnt allow spawning of props and such.
Title: Re: [Request] Spawn Vehicle Plugin
Post by: MrPresident on January 13, 2013, 12:47:58 PM
What kind of vehicle?
Title: Re: [Request] Spawn Vehicle Plugin
Post by: PAL-18 on January 13, 2013, 02:22:55 PM
Airboat or jeep.  When its used again, it replaces the previously spawned vehicle.

Here's what the vehicle entities look like in text form:

{
"model" "models/buggy.mdl"
"origin" "0 0 0"
"VehicleLocked" "0"
"actionScale" "1"
"vehiclescript" "scripts/vehicles/jeep_test.txt"
"screenspacefade" "0"
"solid" "6"
"fadescale" "1"
"fademaxdist" "0"
"fademindist" "-1"
"maxdxlevel" "0"
"mindxlevel" "0"
"disableshadows" "0"
"skin" "0"
"angles" "0 0 0"
"classname" "prop_vehicle_jeep"
}

{
"model" "models/airboat.mdl"
"origin" "0 0 0"
"VehicleLocked" "0"
"actionScale" "1"
"vehiclescript" "scripts/vehicles/airboat.txt"
"screenspacefade" "0"
"solid" "6"
"fadescale" "1"
"fademaxdist" "0"
"fademindist" "-1"
"maxdxlevel" "0"
"mindxlevel" "0"
"disableshadows" "0"
"skin" "0"
"angles" "0 0 0"
"classname" "prop_vehicle_airboat"
}
Title: Re: [Request] Spawn Vehicle Plugin
Post by: MrPresident on January 13, 2013, 08:55:01 PM
http://forums.ulyssesmod.net/index.php/topic,5961.0.html
Title: Re: [Request] Spawn Vehicle Plugin
Post by: PAL-18 on June 17, 2013, 10:54:05 PM
Hey Pres,

I was wondering you can make a variation of this plugin?  One that spawns a few types of npcs:

npc_headcrab_black
npc_metropolice
npc_stalker

Good short spawn names for the above would be:

!npc headcrab
!npc police
!npc stalker
Title: Re: [Request] Spawn Vehicle Plugin
Post by: JamminR on June 18, 2013, 06:16:52 AM
Pal, though I've not looked at code to know (and been so long I forget), if a vehicle entitiy is spawned the same way as a npc entity, perhaps his function would be a good chance to learn on your own.
:)
Best way I ever learned was by looking at others code when I wanted to do something similar.
Title: Re: [Request] Spawn Vehicle Plugin
Post by: MrPresident on June 18, 2013, 08:02:29 AM
I could do this, sure. The code wouldn't take too much modifying, and I could make it dynamic so that you could add new npcs to a table and it'll allow you to spawn them that way. I could also add a parameter for weapon and player affiliation of you want.

let me know what you want it to do.
Title: Re: [Request] Spawn Vehicle Plugin
Post by: PAL-18 on June 18, 2013, 02:50:48 PM
That would be AWESOME.  Many Thanks! <3

It would be great if there were an optional configurable setting that spawns the npc a few feet in the air (some big ones like the helicopter and combine dropship spawn in the ground and cant move around).

P.S. I tried myself, but i can't wrap my mind around programming schema.
Title: Re: [Request] Spawn Vehicle Plugin
Post by: PAL-18 on June 18, 2013, 02:54:37 PM
Pal, though I've not looked at code to know (and been so long I forget), if a vehicle entitiy is spawned the same way as a npc entity, perhaps his function would be a good chance to learn on your own.
:)
Best way I ever learned was by looking at others code when I wanted to do something similar.

I tried and crashed and burned.  That's why i made the reply.

In fact, a few years ago i even took a dedicated C++ programming program at college and 3 weeks into it i had a burn out because i couldnt keep up/understand things.

@Pres, can you make it work in any gamemode like the rest of ULX?  The vehicle script doesnt work in TTT and every other gamemode (i can still spawn ents with the rcon command though).