Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 20 21 [22] 23 24 ... 27

Author Topic: LCS 4.04 Download (April 2011 Graduation Gift)  (Read 90589 times)

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: LCS 4.04 Download (April 2011 Graduation Gift)
« Reply #315 on: November 05, 2011, 08:16:38 pm »

Hmm, it looks like something about this is wrong

Code: [Select]
  if(mode==GAMEMODE_CHASECAR)
  {
  Vehicle * targetCar = vehicle[id_getcar(t.carid)];
  if(LCSrandom(9)<(targetCar->protection()))
  {
  offset=0;
  }
  }

(Here I set offset to 0 so it always hits a leg when the armor protection is met so the person is not damaged).

Same error.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: LCS 4.04 Download (April 2011 Graduation Gift)
« Reply #316 on: November 06, 2011, 03:07:04 am »

Allright yeah, if I remove that

Vehicle * targetCar = vehicle[id_getcar(t.carid)];

and just use

 if(LCSrandom(9)<I))
where I is any integer, it works just fine... Any ideas?

P.S. Tried again:

Code: [Select]
int prot=0;

prot=vehicle[id_getcar(t.carid)]->protection();
if(LCSrandom(9)<prot)
{
hitcar=true;
} else hitcar=false;
Crash on hit... Something is wrong with "vehicle[id_getcar(t.carid)]->protection();"
If I replace it with integer, it does not crash.

P.S.

Shhhh... Trying to get this

Code: [Select]
if(mode==GAMEMODE_CHASECAR)
{
  Vehicle * targetCar = vehicle[id_getcar(t.carid)];
  if((targetCar->shortname())=="Van")
  {
hitcar=true;
  } else hitcar=false;
  }
leads to a crash on hit too... What the hell.
« Last Edit: November 06, 2011, 04:32:56 am by Deon »
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Coronel_Niel

  • Bay Watcher
    • View Profile
Re: LCS 4.04 Download (April 2011 Graduation Gift)
« Reply #317 on: November 06, 2011, 04:25:45 am »

The -> Operator is used to indirectly call a function on another object. Which I think means it dereferences the value and then calls the function on the value. Which means it works fine where it is placed, seeing as targetCar is a pointer.

Is "Protection" a function and is it returning the right values?

I cant see it in the code you put up.

Note you could probably inline the function to get a performance boost. Making it a constant function will help too as then it can not be edited accidentally, instead just returning a value.
« Last Edit: November 06, 2011, 04:34:29 am by Coronel_Niel »
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: LCS 4.04 Download (April 2011 Graduation Gift)
« Reply #318 on: November 06, 2011, 04:32:07 am »

The protection is totally the same as drivebonus.

I've introduced it as Johnathan said here: http://www.bay12forums.com/smf/index.php?topic=83375.msg2736009#msg2736009.

I hope he comes and clears it out, I can't wait to add various armor levels for cars :).
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Coronel_Niel

  • Bay Watcher
    • View Profile
Re: LCS 4.04 Download (April 2011 Graduation Gift)
« Reply #319 on: November 06, 2011, 04:41:55 am »

Try:

(&targetCar.shortname())=="Van"
(*targetCar.shortname())=="Van"

Just brain storming a little here. When drivebonus is used as a function, it is used like the first example. Try that.

I have no idea if dereferencing it first and then using a direct member call is different to a indirect call but its worth a try.
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: LCS 4.04 Download (April 2011 Graduation Gift)
« Reply #320 on: November 06, 2011, 06:38:53 am »

Tried, it offers me ->, also I still need that protection() which is the same :).

Code: [Select]
Vehicle * targetCar = vehicle[id_getcar(t.carid)];
if((mode==GAMEMODE_CHASECAR)&&((*targetCar.protection())<LCSrandom(10)))
{
hitcar=true;
} else hitcar=false;

The error is:

Quote
..\src\combat\fight.cpp(778): error C2228: left of '.protection' must have class/struct/union
          type is 'Vehicle *'
          did you intend to use '->' instead?
« Last Edit: November 06, 2011, 06:42:11 am by Deon »
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Carlos Gustavos

  • Bay Watcher
    • View Profile
Re: LCS 4.04 Download (April 2011 Graduation Gift)
« Reply #321 on: November 06, 2011, 10:58:52 am »

As I suspected, enemy cars are not stored in the vehicle vector. That should be why it crashes. You have to search the chaseseq.enemycar vector instead for enemies. You also have to consider hostages because they don't know what car they're in.
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: LCS 4.04 Download (April 2011 Graduation Gift)
« Reply #322 on: November 06, 2011, 10:58:37 pm »

Ah, that must be it! I had an idea that it COULD cause a problem but I hoped that it's not the issue :P. Oh well, it will be harder than I thought so I will postpone it a bit, until I learn more :). Thanks, I will try to solve it.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Grimith

  • Bay Watcher
  • Terminator Founder
    • View Profile
Re: LCS 4.04 Download (April 2011 Graduation Gift)
« Reply #323 on: November 19, 2011, 11:03:39 am »

I have a very limited understanding of C++, so, after seeing this in activities.cpp, I thought I'd ask...

Code: [Select]
   //SOLICITORS
   int total_income=0;
   for(s=0;s<solicit.size();s++)
   {
      if(!checkforarrest(*solicit[s],"soliciting donations",clearformess))
      {
         int income=solicit[s]->skill_roll(SKILL_PERSUASION) *
                    solicit[s]->get_armor().get_professionalism()+1;
         
         // Country's alignment dramatically affects effectiveness
         // The more conservative the country, the more effective
         if(publicmood(-1) > 90)
            income /= 2;
         if(publicmood(-1) > 65)
            income /= 2;
         if(publicmood(-1) > 35)
            income /= 2;
         if(publicmood(-1) > 10)
            income /= 2;

         solicit[s]->income=income;

         total_income += income;

         solicit[s]->train(SKILL_PERSUASION,max(5-solicit[s]->get_skill(SKILL_PERSUASION),2));
      }
   }
   ledger.add_funds(total_income,INCOME_DONATIONS);

...Does this mean that "publicmood" has absolutely no impact on how much money you earn through soliciting donations, or am I misreading the code?

klingon13524

  • Bay Watcher
  • The Mongols are cool!
    • View Profile
Re: LCS 4.04 Download (April 2011 Graduation Gift)
« Reply #324 on: November 19, 2011, 11:51:18 am »

I have a very limited understanding of C++, so, after seeing this in activities.cpp, I thought I'd ask...

Code: [Select]
   //SOLICITORS
   int total_income=0;
   for(s=0;s<solicit.size();s++)
   {
      if(!checkforarrest(*solicit[s],"soliciting donations",clearformess))
      {
         int income=solicit[s]->skill_roll(SKILL_PERSUASION) *
                    solicit[s]->get_armor().get_professionalism()+1;
         
         // Country's alignment dramatically affects effectiveness
         // The more conservative the country, the more effective
         if(publicmood(-1) > 90)
            income /= 2;
         if(publicmood(-1) > 65)
            income /= 2;
         if(publicmood(-1) > 35)
            income /= 2;
         if(publicmood(-1) > 10)
            income /= 2;

         solicit[s]->income=income;

         total_income += income;

         solicit[s]->train(SKILL_PERSUASION,max(5-solicit[s]->get_skill(SKILL_PERSUASION),2));
      }
   }
   ledger.add_funds(total_income,INCOME_DONATIONS);

...Does this mean that "publicmood" has absolutely no impact on how much money you earn through soliciting donations, or am I misreading the code?
Speaking of which, soliciting donations needs to be buffed. My high persuasion founder, in an expensive suit, with 100% of people respecting the power of the LCS and 98% of them liking me, barely pulls a few dollars a day. As I said, soliciting donations needs a buff...
Logged
By creating a gobstopper that never loses its flavor he broke thermodynamics
Maybe it's parasitic. It never loses its flavor because you eventually die from having your nutrients stolen by it.

Bdthemag

  • Bay Watcher
  • Die Wacht am Rhein
    • View Profile
Re: LCS 4.04 Download (April 2011 Graduation Gift)
« Reply #325 on: November 19, 2011, 01:31:54 pm »

Regardless of how much you believe in something, it's not like your going to be giving out hundreds of dollars to a guy on the street asking for donations.

I want a cure for Aids, but I don't really want to be donating large amounts of money.
Logged
Well, you do have a busy life, what with keeping tabs on wild, rough-and-tumble forum members while sorting out the drama between your twenty two inner lesbians.
Your drunk posts continue to baffle me.
Welcome to Reality.

Coronel_Niel

  • Bay Watcher
    • View Profile
Re: LCS 4.04 Download (April 2011 Graduation Gift)
« Reply #326 on: November 19, 2011, 02:44:11 pm »

I have a very limited understanding of C++, so, after seeing this in activities.cpp, I thought I'd ask...

Code: [Select]
   //SOLICITORS
   int total_income=0;
   for(s=0;s<solicit.size();s++)
   {
      if(!checkforarrest(*solicit[s],"soliciting donations",clearformess))
      {
         int income=solicit[s]->skill_roll(SKILL_PERSUASION) *
                    solicit[s]->get_armor().get_professionalism()+1;
         
         // Country's alignment dramatically affects effectiveness
         // The more conservative the country, the more effective
         if(publicmood(-1) > 90)
            income /= 2;
         if(publicmood(-1) > 65)
            income /= 2;
         if(publicmood(-1) > 35)
            income /= 2;
         if(publicmood(-1) > 10)
            income /= 2;

         solicit[s]->income=income;

         total_income += income;

         solicit[s]->train(SKILL_PERSUASION,max(5-solicit[s]->get_skill(SKILL_PERSUASION),2));
      }
   }
   ledger.add_funds(total_income,INCOME_DONATIONS);

...Does this mean that "publicmood" has absolutely no impact on how much money you earn through soliciting donations, or am I misreading the code?

EDIT:
No. Read below please

It used to be a fair way of making cash but it was debuffed at some time. I asked Jonathan about it and he said anyone with enough skill can earn a lot of money, but it really doesnt.

Side Note to Bdthemag:
There also needs to be an effect of multiple people seeing your person asking for cash. In one day in a town centre I can collect £150 for a poppy appeal (British) and if your donating to change your OWN country then people may even donate more.
« Last Edit: November 19, 2011, 03:06:06 pm by Coronel_Niel »
Logged

Grimith

  • Bay Watcher
  • Terminator Founder
    • View Profile
Re: LCS 4.04 Download (April 2011 Graduation Gift)
« Reply #327 on: November 19, 2011, 02:57:00 pm »

Thanks for the confirmation, Coronel_Niel. I don't frequent the forums, so I completely missed anyone pointing out this problem. Continuing to look at activities.cpp, I see the same problem in selling t-shirts, art, and music. At least selling brownies continues to work as advertised.

My problem, Bdthemag, is that the game says public opinion matters. As this appears to have been changed intentionally, I'd think - at the very least - someone would alter the game's own descriptions to say that public opinion doesn't matter.

Coronel_Niel

  • Bay Watcher
    • View Profile
Re: LCS 4.04 Download (April 2011 Graduation Gift)
« Reply #328 on: November 19, 2011, 03:05:05 pm »

Thanks for the confirmation, Coronel_Niel. I don't frequent the forums, so I completely missed anyone pointing out this problem. Continuing to look at activities.cpp, I see the same problem in selling t-shirts, art, and music. At least selling brownies continues to work as advertised.

My problem, Bdthemag, is that the game says public opinion matters. As this appears to have been changed intentionally, I'd think - at the very least - someone would alter the game's own descriptions to say that public opinion doesn't matter.

Actually no. Sorry. It isnt an else if. That means it runs it through.

If it is above 90, it halfs it.

Above 65 and it halfs it again.

ect ect.

Which means the LOWER the public opinion the better.
Logged

Grimith

  • Bay Watcher
  • Terminator Founder
    • View Profile
Re: LCS 4.04 Download (April 2011 Graduation Gift)
« Reply #329 on: November 19, 2011, 03:14:07 pm »

...okay, so public opinion does matter, meaning I was incorrect, although I'm all right with being wrong here because what you've just suggested is hilarious.

Step #1: Make nation more conservative.
Step #2: ?
Step #3: Receive greater profit through donations than you would have in an Elite Liberal society!
Pages: 1 ... 20 21 [22] 23 24 ... 27