Ga naar inhoud


Foto

Montana Mod v2.1 (In Development)


  • Please log in to reply
3199 replies to this topic

#3021 MountainMan90

MountainMan90

    Firefighter

  • Members
  • 11 Posts:

Gepost 27 juni 2015 - 04:17

Hmmm...sounds like a possibilty, because it constantly declares the Vehicle variable "car" each time the loop iterates. It makes use of the same variable all through out for sake of not having to create 10 different variables. The number of VehicleLists is also another possibilty since the game has to search for the specific vehicle x number of times depending on how many persons of those are present on map.

 

I am attempting a fix as we speak, and I will test it and report back. Keep in mind, I don't know much c++, I am more of a Java developer.



#3022 itchboy

itchboy

    Assistant Chief

  • Member
  • 1788 Posts:
  • Gender:Not Telling

Gepost 27 juni 2015 - 04:22

I am attempting a fix as we speak, and I will test it and report back. Keep in mind, I don't know much c++, I am more of a Java developer.

Some hints. Maybe pointer variables are more efficient, so get your asterisks and -> ready. Despite having some knowledge of C programming, I don't know the effect or difference of having pointers vs regular variables in Em4, except for functions.

 

The scripts I've made so far don't make use of functions so pointers to me didn't seem like a useful thing unless I was going to "pass" something. Another option would be to divide the command scripts further into individual functions and have them pass pointer variables instead.

 

I am unsure if this makes it more efficient, but from what I've learned, having a single permanent variable that changes in a case to case basis is more efficient than having 10 different variables which may or may not even be used.



#3023 MountainMan90

MountainMan90

    Firefighter

  • Members
  • 11 Posts:

Gepost 27 juni 2015 - 04:32

Some hints. Maybe pointer variables are more efficient, so get your asterisks and -> ready. Despite having some knowledge of C programming, I don't know the effect or difference of having pointers vs regular variables in Em4, except for functions.

 

The scripts I've made so far don't make use of functions so pointers to me didn't seem like a useful thing unless I was going to "pass" something. Another option would be to divide the command scripts further into individual functions and have them pass pointer variables instead.

 

I am unsure if this makes it more efficient, but from what I've learned, having a single permanent variable that changes in a case to case basis is more efficient than having 10 different variables which may or may not even be used.

So far everything is working excellent, I will continue to test a little bit more then release my fix.



#3024 FInn Rescue 12

FInn Rescue 12

    Battalion Chief

  • Members
  • 768 Posts:
  • Gender:Male

Gepost 27 juni 2015 - 07:59

So far everything is working excellent, I will continue to test a little bit more then release my fix.

Was the ATF issue all ready fixed or is not  factor in what is causing the game to glitch or lag?


Whats up!  

 

 

 

 

 

 

 

 

post-14435-0-36443700-1362212507.jpg

 

 

 

 

 


#3025 MountainMan90

MountainMan90

    Firefighter

  • Members
  • 11 Posts:

Gepost 28 juni 2015 - 12:26

Was the ATF issue all ready fixed or is not  factor in what is causing the game to glitch or lag?

I have seen noticeable increase in FPS when I added the breaks, however it could just be me imagining it. I have isolated the crash(for me anyways) to this:


?SpawnPoint "civspawnrowhouse2": Assigned path "civpath06" is blocked.
?VVideoTexture::StartPlayback(): could not run graph [80070008]
?SpawnPoint "civspawnhouse2": Assigned path "civpath10" is blocked.
!WARNING: global listener object is still registered! Unregister listener before destroying object!

 

I am unsure if it has to do with the volunteer script, I have been trying to pin point the exact cause but I haven't been able to find it. It seems plausible that if the civpath is blocked it leaves it registered and picks another civpath and attempts to destroy the civpath that was blocked, which causes this error. I am still looking into it(I really dislike notepad++).



#3026 itchboy

itchboy

    Assistant Chief

  • Member
  • 1788 Posts:
  • Gender:Not Telling

Gepost 28 juni 2015 - 12:38

I have seen noticeable increase in FPS when I added the breaks, however it could just be me imagining it. I have isolated the crash(for me anyways) to this:


 

I am unsure if it has to do with the volunteer script, I have been trying to pin point the exact cause but I haven't been able to find it. It seems plausible that if the civpath is blocked it leaves it registered and picks another civpath and attempts to destroy the civpath that was blocked, which causes this error. I am still looking into it(I really dislike notepad++).

The issue you described has something to do with the map itself, and not any scripts. There might be a spawnpoint that is glitched. Another thing to look for is the StopSign and NightSounds scripts because those run all throughout the duration of gameplay, unlike the volunteer script which only runs when called. I'd recommend also looking into those.

 

What breaks do you mean? What have you changed exactly. Your help is very appreciated and I would like to thank you for helping out in the development process.



#3027 MountainMan90

MountainMan90

    Firefighter

  • Members
  • 11 Posts:

Gepost 28 juni 2015 - 12:51

The issue you described has something to do with the map itself, and not any scripts. There might be a spawnpoint that is glitched. Another thing to look for is the StopSign and NightSounds scripts because those run all throughout the duration of gameplay, unlike the volunteer script which only runs when called. I'd recommend also looking into those.

 

What breaks do you mean? What have you changed exactly. Your help is very appreciated and I would like to thank you for helping out in the development process.

 

I like this mod and because I want to play for more than 5 minutes, I have spent sometime looking through issues reported here and try and fix.


if(ChildID == 0)
{
if(p.HasName(NAME_PERSON01))
{
VehicleList vl1(NAME_CAR01);
for(int j=0; j < vl1.GetNumVehicles(); j++)
{
car = vl1.GetVehicle(j);
break;
}
}
else if(p.HasName(NAME_PERSON02))
{
VehicleList vl2(NAME_CAR02);
for(int j=0; j < vl2.GetNumVehicles(); j++)
{
car = vl2.GetVehicle(j);
break;
}
}
else if(p.HasName(NAME_PERSON03))
{
VehicleList vl3(NAME_CAR03);
for(int j=0; j < vl3.GetNumVehicles(); j++)
{
car = vl3.GetVehicle(j);
break;
}
}
else if(p.HasName(NAME_PERSON04))
{
VehicleList vl4(NAME_CAR04);
for(int j=0; j < vl4.GetNumVehicles(); j++)
{
car = vl4.GetVehicle(j);
break;
}
}
else if(p.HasName(NAME_PERSON05))
{
VehicleList vl5(NAME_CAR05);
for(int j=0; j < vl5.GetNumVehicles(); j++)
{
car = vl5.GetVehicle(j);
break;
}
}
else if(p.HasName(NAME_PERSON06))
{
VehicleList vl6(NAME_CAR06);
for(int j=0; j < vl6.GetNumVehicles(); j++)
{
car = vl6.GetVehicle(j);
break;
}
}
else if(p.HasName(NAME_PERSON07))
{
VehicleList vl7(NAME_CAR07);
for(int j=0; j < vl7.GetNumVehicles(); j++)
{
car = vl7.GetVehicle(j);
break;
}
}
else if(p.HasName(NAME_PERSON08))
{
VehicleList vl8(NAME_CAR08);
for(int j=0; j < vl8.GetNumVehicles(); j++)
{
car = vl8.GetVehicle(j);
break;
}
}
else if(p.HasName(NAME_PERSON09))
{
VehicleList vl9(NAME_CAR09);
for(int j=0; j < vl9.GetNumVehicles(); j++)
{
car = vl9.GetVehicle(j);
break;
}
}
else if(p.HasName(NAME_PERSON10))
{
VehicleList vl10(NAME_CAR10);
for(int j=0; j < vl10.GetNumVehicles(); j++)
{
car = vl10.GetVehicle(j);
break;
}
}


When it loops through the number of vehicles, it never stopped. It would continue to cycle through eating at the memory a little bit, so adding the simplistic breaks where applicable, it saved a little bit on the memory. I am going to rewrite this to be more efficient on the memory, as making it cycle through the number of vehicles every time it declares a new vehicle seems a little weird.

#3028 itchboy

itchboy

    Assistant Chief

  • Member
  • 1788 Posts:
  • Gender:Not Telling

Gepost 28 juni 2015 - 12:54

 

I like this mod and because I want to play for more than 5 minutes, I have spent sometime looking through issues reported here and try and fix.
 



When it loops through the number of vehicles, it never stopped. It would continue to cycle through eating at the memory a little bit, so adding the simplistic breaks where applicable, it saved a little bit on the memory. I am going to rewrite this to be more efficient on the memory, as making it cycle through the number of vehicles every time it declares a new vehicle seems a little weird.

 

Hmmm..I think this is it. The loop would declare a new vehicle as it cycles. Let me know of the improvements. Such a simple piece of code was overlooked unfortunately due to the rush to release this mod back in Chrismas 2014.



#3029 MountainMan90

MountainMan90

    Firefighter

  • Members
  • 11 Posts:

Gepost 28 juni 2015 - 12:57

Hmmm..I think this is it. The loop would declare a new vehicle as it cycles. Let me know of the improvements. Such a simple piece of code was overlooked unfortunately due to the rush to release this mod back in Chrismas 2014.

If you guys need any help in the future, I am more than happy to review any piece you guys want. I am reviewing the stop sign script as we speak.



#3030 itchboy

itchboy

    Assistant Chief

  • Member
  • 1788 Posts:
  • Gender:Not Telling

Gepost 28 juni 2015 - 12:58

If you guys need any help in the future, I am more than happy to review any piece you guys want. I am reviewing the stop sign script as we speak.

Thank you so much. We definitely appreciate it and would need any advice or help you can give.



#3031 FInn Rescue 12

FInn Rescue 12

    Battalion Chief

  • Members
  • 768 Posts:
  • Gender:Male

Gepost 29 juni 2015 - 07:04

Hum! I think it is something else I removed all the new script for Montana Mod Development , except for the police random patrol not sure how to do that?  The game plays for a while before CTD hour and half.  


Whats up!  

 

 

 

 

 

 

 

 

post-14435-0-36443700-1362212507.jpg

 

 

 

 

 


#3032 Chris07

Chris07

    Senior Captain

  • Member
  • 292 Posts:
  • Gender:Male
  • Location:Los Angeles, CA, USA
  • Interests:Medicine & Computer Science...what a combo!

Gepost 29 juni 2015 - 08:10

I like this mod and because I want to play for more than 5 minutes, I have spent sometime looking through issues reported here and try and fix.
When it loops through the number of vehicles, it never stopped. It would continue to cycle through eating at the memory a little bit, so adding the simplistic breaks where applicable, it saved a little bit on the memory. I am going to rewrite this to be more efficient on the memory, as making it cycle through the number of vehicles every time it declares a new vehicle seems a little weird.


Adding the break in the way you did to the loop negates the need for the for-loop. The way you used it essentially breaks out of the for-loop on the first iteration. You might as well forego the loop and just say car = vl8.getGetVehicle(0);

#3033 holyorangejuice

holyorangejuice

    Firefighter

  • Members
  • 5 Posts:
  • Gender:Male
  • Location:TX
  • Interests:EM4/911 FR USA Mods

Gepost 30 juni 2015 - 02:35

SUGGESTION!!!!

I would do anything! Anything at all for the units to stop saying copy, 10-4, ect when you click on the map. It gets to be EXTREMELY annoying to hear that non stop when trying to position people or vehicles. I've been reading a few pages back and it looks like you're aware and working on the other issues. Please if this can be addressed. Who wants to listen to that non stop. 
 



#3034 Fred03

Fred03

    District Chief

  • Members
  • 1412 Posts:
  • Gender:Not Telling
  • Location:The path less traveled

Gepost 30 juni 2015 - 03:34

SUGGESTION!!!!

I would do anything! Anything at all for the units to stop saying copy, 10-4, ect when you click on the map. It gets to be EXTREMELY annoying to hear that non stop when trying to position people or vehicles. I've been reading a few pages back and it looks like you're aware and working on the other issues. Please if this can be addressed. Who wants to listen to that non stop. 
 

Maybe a variation of phrases instead... (I've never personally find a issue with that myself)


Also Supporting: RCMP mod, Stillwater mod, Lampard mod, Ravenna sub-mod,  Rockport mod.

xnzgxu9.png

State & National Park enthusiast can help modders in park related issues.

My statements in no way respect the views of any agency I am or was formerly associated with.


#3035 holyorangejuice

holyorangejuice

    Firefighter

  • Members
  • 5 Posts:
  • Gender:Male
  • Location:TX
  • Interests:EM4/911 FR USA Mods

Gepost 30 juni 2015 - 05:58

After a while you zone it out but I try to position vehicles and do things to add a little RP to the regular routine of things for myself and just hearing them speak every time i click gets to me after a while. Despite the issue with crashing I am constantly playing this mod. It is a lot like where I've work EMS for real.



#3036 FInn Rescue 12

FInn Rescue 12

    Battalion Chief

  • Members
  • 768 Posts:
  • Gender:Male

Gepost 30 juni 2015 - 06:14

SUGGESTION!!!!

I would do anything! Anything at all for the units to stop saying copy, 10-4, ect when you click on the map. It gets to be EXTREMELY annoying to hear that non stop when trying to position people or vehicles. I've been reading a few pages back and it looks like you're aware and working on the other issues. Please if this can be addressed. Who wants to listen to that non stop. 
 

10-4


Whats up!  

 

 

 

 

 

 

 

 

post-14435-0-36443700-1362212507.jpg

 

 

 

 

 


#3037 YukonRob

YukonRob

    Firefighter

  • Members
  • 16 Posts:
  • Gender:Male

Gepost 30 juni 2015 - 07:00

Copy



#3038 Fred03

Fred03

    District Chief

  • Members
  • 1412 Posts:
  • Gender:Not Telling
  • Location:The path less traveled

Gepost 30 juni 2015 - 01:40

10-4, copy, acknowledged, roger, en-route


Also Supporting: RCMP mod, Stillwater mod, Lampard mod, Ravenna sub-mod,  Rockport mod.

xnzgxu9.png

State & National Park enthusiast can help modders in park related issues.

My statements in no way respect the views of any agency I am or was formerly associated with.


#3039 Ace612

Ace612

    Captain

  • Members
  • 137 Posts:

Gepost 30 juni 2015 - 01:48

Roger-roger
AN5yXEz.jpg



#3040 MountainMan90

MountainMan90

    Firefighter

  • Members
  • 11 Posts:

Gepost 30 juni 2015 - 02:58

Adding the break in the way you did to the loop negates the need for the for-loop. The way you used it essentially breaks out of the for-loop on the first iteration. You might as well forego the loop and just say car = vl8.getGetVehicle(0);

 

The way I did it was a quick, dirty and cheap way of handling volunteer spawning, which took 2 minutes to do(if that). It was meant to cycle to the unit requested and spawn the volunteer's required and then break as you don't need to cycle through all 10 cars if you only need to spawn one. I have written a better method of doing this, and a bunch of more memory effective patches throughout the entire mod that I will be giving to Itch to review and add if he wishes.  

I don't know nothing of how scripting works as their isn't a documentation that goes in depth, although I found one in German. So for example, if I spawn 3 units, the breaking does not stop the mod from spawning the necessary volunteer's.