@Eingenvector Well the script method will be spawing in a new car and replacing by deleting a naturally spawned vehicle the popcycle would spawn anyway. Its just a text file with some car names for specific areas.
So id say a script would be more of a drain.
If you want to replace a large number of vehicles, how well these vehicles are made is going to be the deciding factor on how many. A well tuned gameconfig is going to be a must too.
Posts made by mcal9909
-
RE: Dynamic Addon Vehicle Traffic Injection vs Popcycle Addon Vehicles
-
RE: Ls Life x Gang mod
From what people tell me they work ok together..
Just that what the gang mod does, LsLife does to a lesser degree and in different ways.
You can take and control turfs, and hire people to fight or work along aside you.I supose if you want the chaos turned upto 11 go for it.
LsLife is suppose to be a real struggle at the start.
-
RE: How can I make the player lose the cops before the next part of the mission goes on?
@Kieran_S sounds like the code for adding or creating the blip is running on concurrent frames. Always check
if (blip == null && !blip.Exists())
to make sure the blip isnt already present before. -
RE: Dynamic Addon Vehicle Traffic Injection vs Popcycle Addon Vehicles
Alot of addon vehicles will inherently cause stability issues when you start replacing ambient traffic with them, as they are mostly higher poly than the standard vehicles with insane texture resolutions and the games engine is just not designed to handle that sort of data.
Both methods will likely produce similar results.
Stick to well made models with reasonable polly counts / texture resolutions and correct lods and you will have less issues with stability. These vehicles tend to be made as replace, but that is not always the case.
-
RE: How can I make the player lose the cops before the next part of the mission goes on?
@Kieran_S
Tryif(getawayVehicle.AttachedBlip != null && getawayVehicle.AttachedBlip.Exists()) getawayVehicle.AttachedBlip.Delete();
Or make sure the player enters the vehicle and you delete the blip before moving into LoseCops.
-
RE: How can I make the player lose the cops before the next part of the mission goes on?
void Processing_LoseCops() { if(getawayVehicle.AttachedBlip.Exists()) getawayVehicle.AttachedBlip.Delete(); if(Game.Player.WantedLevel != 0) { GTA.UI.Screen.ShowSubtitle("Lose the cops"); } else { task = MissionTask.GoToSecretLocation; } }
You are only removing the blip in Processing_GetBackIntoVehicle(), if the player is in the vehicle, but you are moving to LoseCops no matter the state. So you are moving to LoseCops before the blip gets a chance to be removed.
-
RE: How can I make the player lose the cops before the next part of the mission goes on?
not sure, do you mean destinationBlip? if so just hide it or delete it when set
task = MissionTask.LoseCops;
and unhide it / add it back in when you settask = MissionTask.GotoSecretLocation;
-
RE: How can I make the player lose the cops before the next part of the mission goes on?
Ok looking at your code, i think the easiest way is to add a new case for when the player is finished the mission but has a wanted level, enter this case after the robbery has happened. and leave it when the player is no longer wanted.
case MissionTask.LoseCops: { If (Game.Player.WantedLevel != 0) { GTA.UI.Screen.ShowSubtitle("Lose the cops"); } else { task = MissionTask.GoToSecretLocation; } break; }
or add another MissionTask variable called something like
previousTask
, and then in the relevant MissionTasks check if the player is wanted. If so store the current taskpreviousTask = task;
and then settask = MissionTask.LoseCops;
and break out of the current task, then at the end of LoseCops when the player is no longer wanted settask = previousTask;
to carry on with the mission. -
RE: How can I make the player lose the cops before the next part of the mission goes on?
Discord would probably be the easiest way mcal9909#4168
Or upload it to pastebin / github or something and send me a link. -
RE: How can I make the player lose the cops before the next part of the mission goes on?
exactly how you implement it would depend on the structure of your code.
But checking the wanted level is the basis.If (Game.Player.WantedLevel != 0) { // Player is wanted so display your subtitle. } else { // Player is not wanted, so the mission can continue. }
-
RE: .pdb files edit
Why on earth would you want to edit this file? Its used for debugging and produces a more complete log of any errors the script encounters.
The script will work fine without it. -
RE: Is there a "DisplayHelpFromTextThisFrame" by Jedijosh for SHVDN3?
GTA.UI.Screen.ShowHelpTextThisFrame("Your text here.");
-
RE: How can I pre-spawn in cars for a c# script mod?
There are a couple of ways.
one easy way is to Have a Vector3 position that you check the players distance too.Vector3 somePosition = new Vector3(99f,99f,99f); // the location you want to check if the player is near bool spawnedStuff = false;
then in your ontick()
float distanceToMission = Game.Player.Character.Position.DistanceTo(somePosition); if(!spawnedStuff && distanceToMission < 200) { spawnedStuff = true; // spawn your stuff } else if(spawnedStuff && distanceToMission > 200) { spawnedStuff = false; // despawn your stuff }
There are other methods, but this would depend on how you have structured your code and if you keep track of the state of the mission using a
switch case
. -
RE: Problem with spawning custom cars in impulse mod menu.
@SamisBad Pretty sure impulse is an online mod menu..
- Its paid and not available on this site, so bug them for support.
- Online modding discussion is not allowed here.
-
RE: Enemy Peds
https://forums.gta5-mods.com/topic/32670/gta-5-group-making-and-peds-question/17
Enough code and examples in here to show you how to spawn peds and give them tasks.
-
RE: GTA 5 Group Making and Peds Question
@briancatmaster
Just set the scale, Ped.CurrentBlip.Scale = 0.5f; -
RE: GTA 5 Group Making and Peds Question
@briancatmaster Aslong the blip is assigned to an eitity with AddBlip(), it will follow them that entity
-
RE: GTA 5 Group Making and Peds Question
int MaxPeds = 15; //This is how many peds can be alive at anyone time.
-
RE: GTA 5 Group Making and Peds Question
yep this might be of some help to you, Once started it will spawn peds at a random location chosen from the List of locations to fight the player every 500ms until there are 15 peds, and keep spawning new peds to replace the dead peds until its told to stop. Not exactly what you are after but it demonstrates how handle alot of peds with a relatively small amount of code.
class EnemyHandler { List<Vector3> SpawnLocations = new List<Vector3> { new Vector3 (-131.695f, -1509.14f, 34.10052f), new Vector3 (-161.0194f, -1515.375f, 33.68655f), new Vector3 (-172.2392f, -1492.894f, 32.55872f) }; Vector3 ClosePos; List<Ped> Enemies = new List<Ped>(); int MaxPeds = 15; int TimeBetweenSpawns = 500; int Time; public bool Started { get; private set; } = false; List<PedHash> pedHashes = new List<PedHash> { PedHash.AvonGoon, PedHash.Juggernaut01M }; Random Rand = new Random(); public EnemyHandler() { } public void Ontick() { if (Started) { if (Game.GameTime > Time + TimeBetweenSpawns && Enemies.Count < MaxPeds) { int index = -1; bool posFound = false; ClosePos = SpawnLocations[0]; foreach (Vector3 v in SpawnLocations) { if (v.DistanceTo(Game.Player.Character.Position) < ClosePos.DistanceTo(Game.Player.Character.Position)) { ClosePos = v; } } while (!posFound) { index = Rand.Next(0, SpawnLocations.Count); if (SpawnLocations[index] != ClosePos) { posFound = true; } } int pedIndex = Rand.Next(0, 2); Ped enemy = World.CreatePed(pedHashes[pedIndex], SpawnLocations[index]); while (enemy == null) { Wait(0); } switch (pedIndex) { case 0: enemy.Weapons.Give(WeaponHash.CarbineRifle, 1000, true, true); Function.Call(Hash.SET_PED_COMBAT_MOVEMENT, enemy, 2); break; case 1: enemy.Weapons.Give(WeaponHash.Minigun, 10000, true, true); enemy.CanSufferCriticalHits = false; enemy.Health = 4000; Function.Call(Hash.SET_PED_COMBAT_MOVEMENT, enemy, 3); break; } Function.Call(Hash.SET_PED_COMBAT_ABILITY, enemy, 100); enemy.FiringPattern = FiringPattern.FullAuto; enemy.CanWrithe = false; enemy.Armor = 100; enemy.RelationshipGroup = enemyTeam; enemy.AlwaysKeepTask = true; enemy.Task.FightAgainst(Game.Player.Character); enemy.AddBlip(); enemy.CurrentBlip.IsFriendly = false; Enemies.Add(enemy); Time = Game.GameTime; } } CheckPeds(); } public void Start() { Started = true; } public void Stop() { Started = false; } void CheckPeds() { if (Enemies.Count > 0) { foreach (Ped p in Enemies.ToList()) { if (p == null || !p.Exists()) { Enemies.Remove(p); } else if (p.IsDead) { p.CurrentBlip.Remove(); Enemies.Remove(p); } } } } void RemoveEnemies() { foreach (Ped p in Enemies.ToList()) { p.CurrentBlip.Remove(); Enemies.Remove(p); } } }
-
RE: GTA 5 Group Making and Peds Question
No, a relasionship groups is not a collection that can be iterated. Its just an
int
Sounds like you want to use aList<Ped>
and add all your peds to that. -
RE: GTA 5 Group Making and Peds Question
First define your relationship group and its relationships with other groups when your script starts
public static int someRelationshipGroup = World.AddRelationshipGroup("RGROUPNAME"); // make sure the string is unique and unlikley to be used by other mods public static int playerRelationship = Function.Call<int>(Hash.GET_HASH_KEY, "PLAYER"); World.SetRelationshipBetweenGroups(Relationship.Hate, playerRelationship, someRelationshipGroup ); World.SetRelationshipBetweenGroups(Relationship.Hate, someRelationshipGroup , playerRelationship);
Then when you spawn a ped, simply:
Ped.RelationshipGroup = someRelationshipGroup;
-
RE: GTA 5 Group Making and Peds Question
Check this post out, it has some code regarding relationship groups.
https://forums.gta5-mods.com/post/167378 -
RE: GTA 5 Group Making and Peds Question
Relationship groups do not work like a traditional "group", A traditional group will act like a unit, all members following its leader. If the leader attacks, the members attack. If someone attacks the leader its members will defend him.
Relationship groups define how peds treat each other, peds in the same relationship group can fight together, but they will not follow each other.
Peds in a relationship group that Hate another Relasionship group will not actively seek out peds they hate, but they will attack the ped on sight and will generally not attack peds who have the same relationship group. (this is how all Ballas peds will fight together against Families, but not attack each other or follow each other)
Relationships can be configured as follows:
Hate>Dislike>Neutral>Respect>Like>Companion.A peds can be in a group and also be in a relasionship group.
-
RE: GTA 5 Group Making and Peds Question
Try adding them all to a relationship group that Hates the player.
-
RE: LS Life [SCRIPT] [RELEASED] [WIP]
0.2.36
- include missing lslife_spawns.xml
- drug demands based on amount of dealers working an area is now same for worker and player.
- Added a marker above the current worker being interacted with when a menu is open.
- Added subtitle for when stash vehicle is not close enough to the meeting spot.
0.2.37
- Area data cop/gang strengths, Area heat are now saved 4 times a day at 12am/12pm and 6pm/am, for every area you have visited and loaded when script starts.
- Area Rep can now be earned selling drugs in an area, each level earned though rep will increase your chances of a customer offering their services. (will do more with this later)
- Sales from a worker earns rep in workers area.
- Gang growth will only happen 4 times a day every 6 hours. At 12am/pm and 6am/pm.
- Area heat now decays alot slower 10 points per in game hour instead of 1 per in game min.
- Robbers bag will now contain the players money - 10% (it is no longer given to the ped to drop, cap peds have)
- Changed how things are spawned when placing an order, removes that little delay and maybe fix the scriptcrash people have?.
- Orders that require a stash vehicle will now be placed into the vehicles stash when picked up.
- Any stash house flagged as inside will be set to false if the player is closer to the entrance than the exit.
- Hopefully fixed any remaining bugs in workers becoming unresponsive.
- Fixed typo on stash vehicle save causing crackOz to never be saved correctly when taking out of the vehicle.
- Fixed inventory text not working on resolutions higher/lower than 1080p
- Fixed picking up Robbers bag contents overwriting any inventory the player is carrying.
- Area Debug info will close when any LsLife Menu is open.
- Added more debug info (AREADEBUG=true in ini).
- DEBUG can now be toggled without needing to change the ini and reload. To do this enter lsdebug in the cheat code box. gta cheat code box key is the grave key (underneath the escape key).
- areadebug in cheat code box will toggle AREADEBUG.
0.2.38
- Hopefully fixed any remaining problems with ordering drugs.
- Following workers will now switch to Unarmed if the player does so, and will switch to there best weapon if not. (this can be used to stop them shooting while in a vehicle)
- The amount of drugs a customer decides to purchase is now effected by your rep in the area you are selling, instead of Zee's rep.
- Not replying to customers asking for a drop will result in -10 rep for that area.
- New options menu, to access ring Zee and select options. For now only option is for setting the inventory text position.
- Most notifications should now be formatted like a text message, with a picture of the ped who is contacting you.
0.2.39
- Now requires SHVDN 2.10.14.
- Fixed a bug that can cause workers and Zee to not be interactable after player death.
- Fixed SetRandomCombatStats function causing a script crash when gang strength is less than 0.
- New function for loading positions from xml, should be compatible with all system language settings.
- Fixed a bug that can cause player heat to rise above 100.
- Added compatibility for Liberty City Rewind Map. To enable the use of this map with LsLife make sure "LCRWMAP = true" in the LsLife.ini.
- Added 2 new XML files in LSLife\zoneData\ these xml files control each areas assigned wealth and police unit type dispatched due to high heat.
- LsLife_LSSA.xml contains zoneData for the standard GTA map.
- LsLife_LCRW.xml contains zoneData for the Liberty City Rewind map.
- THESE XML FILES MUST BE PRESENT IN scripts\LSLife\zoneData\ OR THE SCRIPT WILL NOT WORK!!