• Dissolution Schema help
    13 replies, posted
I'm currently checking out the dissolution schema for the nutscript framework and so far its pretty fun but I don't know how to do a few things 1. Spawn weapons in certain area's so its more of a scavenge thing and save their position 2. Spawn cars around the map and save their position Also how do I add items to the Vendor? Im mostly concerned about the first two though any help will be greatly appreciated, ive looked through the scripts to see if there was anything about it :/
I dont understand what you want. Do you want to know how to make use of things that are already implemented or are you asking how to code them?
[QUOTE=G4MB!T;45369165]I dont understand what you want. Do you want to know how to make use of things that are already implemented or are you asking how to code them?[/QUOTE] I don't know whether they're already implemented but I want to make weapon spawns where a weapon would spawn in a specific place for a player to loot and car spawns around the map where cars would spawn there and someone can come and take it. I checked through the lua scripts and didnt really find anything to do with it.
I would probably forward this to code hire. CodeHire is the place to go when you basically want people to make things for you. This forum is more for help/guidance with small things.
All I need is someone to set me in the right direction I can do the rest.
If I'm honest, this is pretty basic stuff. Spawning things in a certain position is (or used to be) one of the basics covered in the tutorials that were on the [URL="http://wiki.garrysmod.com/"]wiki[/URL]. But in the case that they dont exist (I'm too lazy to check), you have a table containing the entities you want to use an the positions and angles you want them to spawn with, then iterate over that creating the entity and setting its position and angle (and other properties if you have specified them).
[QUOTE=G4MB!T;45369347]If I'm honest, this is pretty basic stuff. Spawning things in a certain position is (or used to be) one of the basics covered in the tutorials that were on the [URL="http://wiki.garrysmod.com/"]wiki[/URL]. But in the case that they dont exist (I'm too lazy to check), you have a table containing the entities you want to use an the positions and angles you want them to spawn with, then iterate over that creating the entity and setting its position and angle (and other properties if you have specified them).[/QUOTE] Ok thanks, I'll see what I can do now [editline]12th July 2014[/editline] Could this work though? [CODE]local function WeaponSpawn() if SERVER then local wep = ents.Create("m9k_ak74") wep:SetPos(Vector(0,0,0))-- I'll configure this wep:SetAngles(Angle(0,0,0))-- I'll configure this wep:Spawn() end end hook.Add( "InitPostEntity", "SpawnWeapon", WeaponSpawn)[/CODE]
If I recall correctly, you cannot spawn SWEPs but I might be wrong. As for the concept of the code, that is correct (including the hook).
[QUOTE=G4MB!T;45369547]If I recall correctly, you cannot spawn SWEPs but I might be wrong. As for the concept of the code, that is correct (including the hook).[/QUOTE] Ah right :/ I'll see what happens anyway and I'll see if I can figure something else out What about vehicles?
Vehicles are slightly harder to spawn. You need to set a vehicle script (so you can actually drive them) but I think thats it.
Ah looks like I ain't doing that :v: [editline]12th July 2014[/editline] [QUOTE=G4MB!T;45369644]Vehicles are slightly harder to spawn. You need to set a vehicle script (so you can actually drive them) but I think thats it.[/QUOTE] Thanks in advance
Here is some of the code from my gamemode for spawning vehicles: [code] local NewVehicle = ents.Create("prop_vehicle_jeep"); NewVehicle:SetModel(Vehicle["Model"]); NewVehicle:SetPos(SpawnPos[1]); NewVehicle:SetAngles(SpawnPos[2]); NewVehicle:SetKeyValue("vehiclescript", "scripts/vehicles/" .. Vehicle.Script .. ".txt"); NewVehicle:SetRenderMode(RENDERMODE_TRANSALPHA); // allows for coloring NewVehicle:Fire("turnoff"); // spawn the car turned off (cannot drive) NewVehicle:Fire("lock"); // spawns the car locked (cannot get in) NewVehicle:Spawn(); [/code]
[QUOTE=G4MB!T;45369728]Here is some of the code from my gamemode for spawning vehicles: [code] local NewVehicle = ents.Create("prop_vehicle_jeep"); NewVehicle:SetModel(Vehicle["Model"]); NewVehicle:SetPos(SpawnPos[1]); NewVehicle:SetAngles(SpawnPos[2]); NewVehicle:SetKeyValue("vehiclescript", "scripts/vehicles/" .. Vehicle.Script .. ".txt"); NewVehicle:SetRenderMode(RENDERMODE_TRANSALPHA); // allows for coloring NewVehicle:Fire("turnoff"); // spawn the car turned off (cannot drive) NewVehicle:Fire("lock"); // spawns the car locked (cannot get in) NewVehicle:Spawn(); [/code][/QUOTE] Thanks a lot for this, this will work with tdm cars and such too yes?
My gamemode actually uses TDM cars but that will work on all vehicles (as long as they are actually vehicles)
Sorry, you need to Log In to post a reply to this thread.