Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Field Researcher
#26 Old 11th Feb 2014 at 4:02 AM Last edited by Sleepy-Genius : 17th Feb 2014 at 5:37 AM.
Quote: Originally posted by CmarNYC
You really should try to figure out where your logic was wrong. Debugging is a huge part of programming.


Oh yeah, I am. I was just letting you know, an update. I've been working on this.

I tried with a switch case method, but didn't work the way I wanted. :/

I should finish this version soon. I've gone from version 6 to now version 11. I'm thankful that Any Game Starter loads fast.

E D I T: So, I think this one is near perfect (to me). There are still some things that need to be added. Um, I'll write later what I did. I'm too tired right now.

Also, do you know the code to disable notifications? I don't want to see notifications for the sims whom are not in my household. I couldn't find it in the Notication system(s) coding. :/

ANOTHER EDIT I'm going to take another short, very short break on this. I have some other things that need to be done before Monday, and I have yet to work on them because I can NOT get this out of my mind. I'm eager to finish it. I have some other "flavors" I want to add to this. These loops will drive me insane!
Advertisement
Test Subject
#27 Old 17th Feb 2014 at 7:16 AM Last edited by CoSm1c gAm3r : 17th Feb 2014 at 9:26 PM.
I'll be happy to use it when it will be stable and 100% finished. For now I got to many mods to test and still creating my own tweaks to that overly to much childish game. I miss sims 1 that was not full of weird infantile things.
I am not sure but in sims 2 there was fee for taxis. Weird and stupid thing that they started to remove SIM elements from SIMs games... Maxis started to hire to much infantile people maybe. Or they think that only 4-8 yo kids play that game. To bad :/
I wish that they would add option to their game "DISABLE ALL INFANTILE, FANTASY, MYTHICAL, UNREAL stuff!"
That would be really cool for older gamers that like SIM/ECONOMY games and not infantile crazy stuff.
Anyway thank you m8 for trying to make taxi aspect real. I dont know what those silly people think in maxis. Maybe that taxi drivers work for free.
Sims game are more and more losing any immersion and go into insane, brainless FUN :/

Thank you for your work m8
Test Subject
#28 Old 6th May 2014 at 8:15 PM
I hope you have not given up on this mod. I am interested in it myself. I like the idea of having to pay to take the taxi, I also want to be able to CALL for a taxi. One of my characters insists on riding her bike EVERYWHERE! Being able to call for a taxi and take it instead would be handy and having to pay for it good too.

Dyn & Lynn
Copyright holders for:
Dyn & Lynn {RE-OLD School Programming
Ms. Byte (Deceased)
#29 Old 8th May 2014 at 12:55 PM
Quote: Originally posted by Sleepy-Genius
Also, do you know the code to disable notifications? I don't want to see notifications for the sims whom are not in my household. I couldn't find it in the Notication system(s)


You mean the notification in your script? Just remove it. Or you can test whether the sim is the active sim or a member of the active household before displaying the notification.

Please do not PM me with mod, tutorial, or general modding questions or problems; post them in the thread for the mod or tutorial or post them in the appropriate forum.

Visit my blogs for other Sims content:
Online Sims - general mods for Sims 3
Offline Sims - adult mods for Sims 3 and Sims 4
Field Researcher
#30 Old 4th Jun 2014 at 9:38 AM
Quote: Originally posted by CmarNYC
You mean the notification in your script? Just remove it. Or you can test whether the sim is the active sim or a member of the active household before displaying the notification.


Yeah. Okay. That was the main problem. It become annoying to get a notification for such-and-such and that sim is not in my active household.
I haven't given up. I've been thinking about some stuff. This creating-of-the-mod has inspired me to work on some other scripts, and improve my java coding skills. I will update this post later, before the weekend with what I have done now.
Field Researcher
#31 Old 11th Jul 2014 at 10:32 AM Last edited by Sleepy-Genius : 12th Jul 2014 at 3:50 PM.
Yes, this is a double post. So, okay.

The now problem after not being able to build a release (I can build one now) is that the code still doubles the payment + notification per sim.

Example: Maggie pays for cab. Bob pays for cab. Tom pays for cab. Maggie pays for cab. Bob pays for cab. Tom pays for cab.

See it doubles. The something in the for loop makes it double like that. That's the only explanation I have for that. At least it stopped tripling the payments.

[code deleted]

Does anything I said make sense?
Ms. Byte (Deceased)
#32 Old 11th Jul 2014 at 12:40 PM
NM: Sorry, didn't understand the question.

Please do not PM me with mod, tutorial, or general modding questions or problems; post them in the thread for the mod or tutorial or post them in the appropriate forum.

Visit my blogs for other Sims content:
Online Sims - general mods for Sims 3
Offline Sims - adult mods for Sims 3 and Sims 4
Forum Resident
#33 Old 11th Jul 2014 at 12:55 PM
Why are you setting fee=0 if the sim is an NPC?
Is that so nobody gets charged after an NPC is found in the sim list?
Because that's what will happen.
Field Researcher
#34 Old 11th Jul 2014 at 2:25 PM
Quote: Originally posted by CmarNYC
NM: Sorry, didn't understand the question.

The active sim(s) are being charged twice, not once. That is what I was trying to say. But besides that, it works fine.

Quote: Originally posted by lenglel
Why are you setting fee=0 if the sim is an NPC?
Is that so nobody gets charged after an NPC is found in the sim list?
Because that's what will happen.

Well, people are being charged. The NPC is not being charged. If I didn't have that fee=0 in there, then the NPC would be charged. Don't want that. :/
I haven't had trouble with that part.
Ms. Byte (Deceased)
#35 Old 11th Jul 2014 at 8:09 PM
I meant I gave an answer but realized I hadn't understood, and took it back until I had time to look deeper.

Lenglel is right - you shouldn't be setting the fee to 0 for NPCs in your current logic. If you have one NPC in your list of passengers you're going to set the fee to 0 and all passengers after him/her in the list will get charged 0. It's more logical to just restructure your if statement to process only non-NPCs:

if (!sim.IsNPC)
{
< charge fee and do notification >
}

What I'm getting in my game with three passengers is that the first sim is being charged three times, the second sim is charged twice, and the third sim is charged once. Please check whether this is what's happening for you rather than what you described. I think what's happening is that the kUsedVehicle event is being fired for each sim as he/she gets in the taxi and is added to the passenger list, which makes sense. If that's true, the sequence is this:

Sim 1 gets in: is charged/notified.
Sim 2 gets in: Sim 1 and Sim 2 are charged/notified.
Sim 3 gets in: Sim 1, Sim 2, and Sim3 are charged/notified.

If you want to charge each sim separately, you can charge only the Actor sim instead of looping through the passenger list. If you want one sim to pay for all, you can test whether the sim is the current active sim and then charge:

if (sim.IsActiveSim)
{
< do charge and notification >
}

Please do not PM me with mod, tutorial, or general modding questions or problems; post them in the thread for the mod or tutorial or post them in the appropriate forum.

Visit my blogs for other Sims content:
Online Sims - general mods for Sims 3
Offline Sims - adult mods for Sims 3 and Sims 4
Field Researcher
#36 Old 12th Jul 2014 at 4:28 PM Last edited by Sleepy-Genius : 15th Jul 2014 at 6:13 PM.
I think this is the one. Everything (to me) checks out great!
My code now looks like this:

[code deleted]

I formatted the message a bit. It was a tad bland. I wanted to show clarity as to why teen, elder, child received different prices.
Couldn't find the simoleon symbol to insert into the message...


I also added code to subtract elder, teen, and child prices from the default price (now 20).

[code deleted]

Elder: fee-10; Teen: fee-5; Child: fee-10.
I want to change this so that elder and child is half of fee; teen is 1/3 of fee. I think that is where remainder comes in play, yes?
I know my constant fee of 20 will change because someone may want a different price.
Ms. Byte (Deceased)
#37 Old 12th Jul 2014 at 7:27 PM
The code is looking good!

What you could do with fees is put the discounts in the tuning as new tuning variables, either as percentages or flat rates. Then it becomes very easy to adjust the rate and the discounts.

Please do not PM me with mod, tutorial, or general modding questions or problems; post them in the thread for the mod or tutorial or post them in the appropriate forum.

Visit my blogs for other Sims content:
Online Sims - general mods for Sims 3
Offline Sims - adult mods for Sims 3 and Sims 4
Field Researcher
#38 Old 15th Jul 2014 at 6:08 PM Last edited by Sleepy-Genius : 17th Jul 2014 at 3:46 PM.
Thank you! A lot of thanks to you especially.
I really could not have kept my head together if you had not bothered to help me.
I feel like I have to buy you something now. Haha.

My updated code.
I wanted to add the thumbnail of the sim to the notification. You know, when you sim gets a job or ups their skill a notification comes up along with with their thumbnail? I didn't see that in the StyleNotification code. I'm still looking for the simoleon symbol also.


if (sim.SimDescription.Elder)
{
fee = (fee * kElderFee) / 100;
}

That is how I get the percentage of the adult fee. You can edit the percents in the tuning, just don't put the actual percent symbol.
It took forever! to get that equation right and working.

I've been trying to get this to work with the boat taxi buy doing this, but it doesn't work.

if (e.TargetObject is Taxi || e.TargetObject is BoatTaxi)
{
int fee = kAdultFee;
Sim sim = e.Actor as Sim;
Taxi taxi = e.TargetObject as Taxi;
BoatTaxi boatTaxi = e.TargetObject as BoatTaxi;
Screenshots
Ms. Byte (Deceased)
#39 Old 15th Jul 2014 at 8:14 PM Last edited by CmarNYC : 15th Jul 2014 at 8:38 PM.
You can also declare kElderFee, kTeenFee, and kChildFee as floats and make them .50, .70, and .30. Then your calculation becomes "fee = fee * kElderFee;"

Quote:
if (e.TargetObject is Taxi || e.TargetObject is BoatTaxi)
{
int fee = kAdultFee;
Sim sim = e.Actor as Sim;
Taxi taxi = e.TargetObject as Taxi;
BoatTaxi boatTaxi = e.TargetObject as BoatTaxi;


What do you mean by 'it doesn't work?' Do you get an error message, does the sim not get charged, what happens?

Just guessing, but if that's the actual code you tried, casting an object as a type it isn't will probably give you an error. You need to test for type and then cast accordingly:

Code:
if (e.TargetObject is Taxi || e.TargetObject is BoatTaxi)
{
  int fee = kAdultFee;
  Sim sim = e.Actor as Sim;
  if (e.TargetObject is Taxi)
  {
    Taxi taxi = e.TargetObject as Taxi;
  }
  else if (e.TargetObject is BoatTaxi)
  {
    BoatTaxi boatTaxi = e.TargetObject as BoatTaxi;
  }
}


However, since you no longer use the taxi or boattaxi in your calculations but only as a test of whether it's a 'taxi' vehicle, you don't need to do any casting of the vehicle at all:

if (e.TargetObject is Taxi || e.TargetObject is BoatTaxi)
{
int fee = kAdultFee;
Sim sim = e.Actor as Sim;
<charge fee>
}

For the notification, try this format of the StyledNotification.Format:

StyledNotification.Show(new StyledNotification.Format(sim.FullName + " paid " + fee.ToString("D") + " for taxi.", sim.ObjectId, StyledNotification.NotificationStyle.kGameMessagePositive));

sim.ObjectId is added as the second argument and gives me a thumbnail of the sim's face. You could experiment with different types of StyledNotification.NotificationStyle (StyledNotification.NotificationStyle.kSimTalking, etc.) to get it the way you want it.

Please do not PM me with mod, tutorial, or general modding questions or problems; post them in the thread for the mod or tutorial or post them in the appropriate forum.

Visit my blogs for other Sims content:
Online Sims - general mods for Sims 3
Offline Sims - adult mods for Sims 3 and Sims 4
Field Researcher
#40 Old 15th Jul 2014 at 8:52 PM
When I tried to float the percentages, I couldn't do it without converting the float to an int. Something like that. I kept getting an error about float to integer.
One site say to use TryParse, another say to use Convert.To() ... So, I just used the percentage equation I knew. It works in game thus far.

The boat taxi part of the code (mine) didn't work; no charge to the sims. It was like the code wasn't even there.

I saw sim.ObjectId in something, but didn't think anything about it. I was mainly looking for keyword 'thumbnail'.

I'll do an edit to this post later. I want to finish this website; I'm finally on a roll!
Thanks for the update.
Field Researcher
#41 Old 17th Jul 2014 at 3:25 PM
The sim.ObjectID worked perfectly!
I also found how to insert the simoleon symbol. I used this code from Sims3.UI.ShopInventoryPrice: UIUtils.FormatMoney(value).

So the updated code looks like this and works fine in game:
StyledNotification.Show(new StyledNotification.Format(sim.FullName + " paid " + UIUtils.FormatMoney(fee) + " for taxi.", sim.ObjectId, StyledNotification.NotificationStyle.kGameMessagePositive));

The edit I made to add the BoatTaxi interaction works. However, you are charged after the boat drops you off. Its fine, but I wanted where you are charge before.

I'd like to say I'm almost done with this, but I have a feeling you are going to say "there is more to do".
Attached files:
File Type: zip  PayForTaxi.zip (4.5 KB, 34 downloads) - View custom content
Ms. Byte (Deceased)
#42 Old 17th Jul 2014 at 10:12 PM
Quote: Originally posted by Sleepy-Genius
The sim.ObjectID worked perfectly!
I also found how to insert the simoleon symbol. I used this code from Sims3.UI.ShopInventoryPrice: UIUtils.FormatMoney(value).

So the updated code looks like this and works fine in game:
StyledNotification.Show(new StyledNotification.Format(sim.FullName + " paid " + UIUtils.FormatMoney(fee) + " for taxi.", sim.ObjectId, StyledNotification.NotificationStyle.kGameMessagePositive));

The edit I made to add the BoatTaxi interaction works. However, you are charged after the boat drops you off. Its fine, but I wanted where you are charge before.

I'd like to say I'm almost done with this, but I have a feeling you are going to say "there is more to do".


No, it sounds great and pretty much ready for prime time. A bit odd that car taxis charge when the sim gets in and boat taxis charge when they get out, but you have no control over that. Whenever you feel it's ready, it's ready!

Please do not PM me with mod, tutorial, or general modding questions or problems; post them in the thread for the mod or tutorial or post them in the appropriate forum.

Visit my blogs for other Sims content:
Online Sims - general mods for Sims 3
Offline Sims - adult mods for Sims 3 and Sims 4
Field Researcher
#43 Old 17th Jul 2014 at 10:24 PM
Quote: Originally posted by CmarNYC
No, it sounds great and pretty much ready for prime time. A bit odd that car taxis charge when the sim gets in and boat taxis charge when they get out, but you have no control over that. Whenever you feel it's ready, it's ready!

OMG!
This is very exciting! You are obviously going to receive a crap load of credit. I could not have finish this if not for you. You made me learn new things. Have you ever thought about being a mentor to someone?

I'm going to look over this a bit more... but I think I it's close to being done.
I'm thinking about adding a scam charge to this. Since you can get mugged in a subway, why not get scammed by a taxi driver.
Ms. Byte (Deceased)
#44 Old 17th Jul 2014 at 11:35 PM
Quote: Originally posted by Sleepy-Genius
OMG!
This is very exciting! You are obviously going to receive a crap load of credit. I could not have finish this if not for you. You made me learn new things. Have you ever thought about being a mentor to someone?

I'm going to look over this a bit more... but I think I it's close to being done.
I'm thinking about adding a scam charge to this. Since you can get mugged in a subway, why not get scammed by a taxi driver.


LOL! Yeah, you could generate a random chance of a scam.

Please do not PM me with mod, tutorial, or general modding questions or problems; post them in the thread for the mod or tutorial or post them in the appropriate forum.

Visit my blogs for other Sims content:
Online Sims - general mods for Sims 3
Offline Sims - adult mods for Sims 3 and Sims 4
Field Researcher
#45 Old 18th Jul 2014 at 4:21 AM
Quote: Originally posted by CmarNYC
LOL! Yeah, you could generate a random chance of a scam.

Stop laughing at yourself, Miss.

Working on that in a bit.
Mad Poster
#46 Old 26th Jul 2014 at 6:20 AM
I'm really looking forward to this mod <3
Forum Resident
#47 Old 26th Jul 2014 at 9:41 AM
I'd suggest taking traits into account when triggering the scam. Some drivers just won't do that, some customers just won't fall for it, that kind of thing.
Glad to see this coming together. You might want to release it, then add the scam in an update when you finish that part.
Field Researcher
#48 Old 29th Jul 2014 at 10:07 PM
It has been uploaded and posted today.

Currently the Boat Taxi charge part of this code, does not work, again. *sigh*
I've tried casting it... nothing.

The 'scam' part is a bit trickier. It won't be 'change a bit here' 'change a bit there' type of code, i fear.
I basically wanted to add the subway's code to the taxi, just for a test and work from there, but nada.
Field Researcher
#49 Old 2nd Aug 2014 at 12:11 AM
So, this mod is not working for everyone. I have spent days trying to figure out why, but nothing. I'm just frustrated.
I didn't want to ask for help because I didn't want to continue to bother people, but at this point, I would like some help.
Ms. Byte (Deceased)
#50 Old 3rd Aug 2014 at 1:16 PM Last edited by CmarNYC : 3rd Aug 2014 at 1:42 PM.
Welcome to the wonderful world of "It doesn't work!"

When a script mod doesn't work, usually it's either because the user doesn't have their game set up right, hasn't installed the mod right, or there's a game version incompatibility. Here's some handy questions to ask:

Quote:
Do you get the warning popup when starting the game, with this mod listed? Do other script mods work in your game? If not, your game is not properly set up in the Documents location or you haven't installed the mod right. (CC may work in Program Files but scripts won't.)

If the script is loading (you get the popup), please describe how it's not working. Are there no charges for taxis? Wrong charges? Are there error messages? Are there any script error output files in The Sims 3 folder? Is your game at the patch level required by the mod?


The last time I saw your code, there was no error handling in it. This means if the script fails for any reason it will just exit, not sure with or without ugly error text all over the user's screen. My advice is to add error handling with output to a file. What I've found with several of my mods is that if the script runs into corrupted data or a sim/object that's null for whatever reason, it throws an error. That kind of error should write an error file and then quietly continue instead of making the script exit. Then if the script doesn't work you can ask the user for the script error file as mentioned above, which will have a name starting with "ScriptError".

Here's how:

Add a try-catch to your InUsedVehicle method:

private static ListenerAction InUsedVehicle(Event e)
{
try
{
< all of your taxi charging code>
}
catch (Exception exception)
{
Exception(exception);
}
}

Add the Exception method:

public static bool Exception(Exception exception)
{
try
{
new ScriptError(null, exception, 0).WriteMiniScriptError();
return true;
}
catch
{
return false;
}
}

BTW, I saw your mention of X86 vs Any CPU compilation. Sims 3 runs as 32-bit so I don't quite understand how that makes a difference, but it's an interesting possibility. I use "Any CPU" for my scripts. It could affect games running on Macs, I guess. Make sure you're compiling for .NET Framework 2.0, also.

Please do not PM me with mod, tutorial, or general modding questions or problems; post them in the thread for the mod or tutorial or post them in the appropriate forum.

Visit my blogs for other Sims content:
Online Sims - general mods for Sims 3
Offline Sims - adult mods for Sims 3 and Sims 4
Page 2 of 3
Back to top