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!
Lab Assistant
Original Poster
#1 Old 28th Mar 2015 at 9:39 PM
Default Problem with the code
Hi!!! Can anybody help me please? I don't know what the problem is... (In addition I have no idea of programation)

Advertisement
Instructor
#2 Old 29th Mar 2015 at 4:52 AM
Using [code ] (the actual code) [/code] (delete the space) to enclose the code you've written can help us see clearly.
Now, no one can identify the problem. We couldn't see the whole code at all.
Lab Assistant
Original Poster
#3 Old 31st Mar 2015 at 9:40 PM
Quote: Originally posted by SimsMatthew
Using [code ] (the actual code) [/code] (delete the space) to enclose the code you've written can help us see clearly.
Now, no one can identify the problem. We couldn't see the whole code at all.


This is what I have:

[IMG][/IMG]
1978 gallons of pancake batter
#4 Old 31st Mar 2015 at 10:36 PM
Your code is missing a closing brace } at the end. It's also badly formatted btw.

Next time please post your actual code here like SimsMatthew said.

If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
Instructor
#5 Old 1st Apr 2015 at 2:17 AM
Yes, I can't stress enough the importance of posting ACTUAL CODE instead of giving us a screenshot. That's terrible to read, to copy (and give suggestions on how to change) parts of your code since we'd have to write it all over again to reproduce your code.

Also, by my observation, and according to what you've said (no idea in programming), it seems that all this code just mean nothing to you, right? Because it seems that you've just copied the decompiled code of TrainingDummy object class, I suppose?

This will help you to do nothing, nor it will help you learn anything at all. Studying the code is one thing, copying and pasting it to call it coding is another thing. I highly suggest you to read the tutorials here first, and then have an idea of what you want to accomplish (in terms of in-game results), and how you can do this in terms of coding. This is how I started with my first project, Subway Charge Mod. So yes, you'll need a clear goal first. Good luck
Lab Assistant
Original Poster
#6 Old 2nd Apr 2015 at 5:06 PM
Hi!!! The code is this: (I've tried to write another closing brace at the end but it gives too many errors)


using System;
using System.Collections.Generic;
using System.Text;
using Sims3.Gameplay.Objects.Miscellaneous;
using Sims3.Gameplay.Interactions;
using Sims3.Gameplay.Actors;
using Sims3.Gameplay.Autonomy;
using Sims3.SimIFace;
using Sims3.UI;

namespace Sims3.Gameplay.Objects.Miscellaneous.SilFantasy
{
public class TrainingDummy : GameObject
{
// Fields
private const int kMaxSimsInLine = 2;
private bool mPracticerInSlot;
private Sim mPracticingSim;
private SimQueue mSimQueue;
private Sim mTrainerSim;
private static readonly string sLocalizationKey;

// Methods
static TrainingDummy();
public TrainingDummy();
private static string LocalizeString(string name, params object[] parameters);
public override void OnStartup();
public bool RouteToSlot(InteractionInstance instance, Sim actor, Slot slot);
public bool WaitInLine(Sim actor, InteractionInstance interaction, out BaseInteractionResult failureResult);

// Properties
public bool PracticerInSlot { get; set; }
public Sim PracticingSim { get; set; }
public override SimQueue SimLine { get; }
public Sim TrainerSim { get; set; }

// Nested Types
private sealed class Practice : Interaction<Sim, TrainingDummy>
{
// Fields
private bool mBreatheHeavily;
private bool mExitOnCombatReady;
private bool mGrantCombatReady;
private DateAndTime mPracticeStartedTimestamp;
private bool mPracticing;
private GearObject mSword;
public static readonly InteractionDefinition Singleton;

// Methods
static Practice();
public Practice();
public override void Cleanup();
public override void ConfigureInteraction();
public void ConsiderCancellingPracticingSim();
private float GetPctToCombatReady();
private void LoopDelegate(StateMachineClient smc, Interaction<Sim, TrainingDummy>.LoopData loopData);
private void RequestNextAnimState();
protected override BaseInteractionResult RunAndReturnInteractionResult();
private void SetArmor();
private bool SetSword();
private float TrainIndefinitely(InteractionInstance instance);
private float TrainUntilCombatReady(InteractionInstance instance);
private void UpdateXPAndBreatheHeavily();

// Nested Types
[HasSpecializedTuning(typeof(TrainingDummy.Practice.SpecializedTuning))]
private sealed class Definition : InteractionDefinition<Sim, TrainingDummy, TrainingDummy.Practice>
{
// Methods
public Definition();
protected override bool Test(Sim a, TrainingDummy target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback);
}

public class SpecializedTuning : SpecializedInteractionTuning
{
// Fields
public float HighestPctChanceOfFailure;
public int LowestLevelWithNoFailure;
public int MinimumCombatLevelForHighSkill;
public float MinimumPctChanceForHighSkill;
public float MinutesUntilBreatheHeavily;
public float MinutesUntilCombatReady;
public float MinutesUntilCombatReadyWhenTrained;
public float PctChanceForHighSkillIncreasePerLevel;
public float XPMultiplierWhileTrained;

// Methods
public SpecializedTuning();
public float GetPctChanceOfFailure(int combatLevel);
public float GetPctChanceOfHighSkillMove(int combatLevel);
public override void Load(DataNode rootNode, bool bIsClone);
public override void WriteToXml(XmlTextWriter xmlWriter, string whitespace);
}
}

private class Train : Interaction<Sim, TrainingDummy>, ISimSelectingInteraction
{
// Fields
private const int kInteractionPriorityValue = 0x3e8;
private bool mHasChosenPracticer;
private bool mHasStartedTrainingAnims;
private int mMinimumCombatLevelForTrainee;
private SimDescription mSelectedSim;
private bool mStartedWaiting;
private DateAndTime mStartedWaitingTimestamp;
private bool mTimeToStartTrainingAnims;
public static readonly InteractionDefinition Singleton;

// Methods
static Train();
public Train();
public override void Cleanup();
public override void ConfigureInteraction();
protected bool ExcludeNonCombat(Sim targetSim, GameObject testObject);
public static bool ExcludeNonCombat(Sim targetSim, TrainingDummy targetObject, int minimumLevel);
public SimDescription GetTargetedSim();
protected bool IncludeCombatNonSelectable(Sim targetSim, GameObject testObject);
private void LoopDelegate(StateMachineClient smc, Interaction<Sim, TrainingDummy>.LoopData loopData);
private static string NoOneToTrainDelegate();
protected override BaseInteractionResult RunAndReturnInteractionResult();
private float TrainingLoop(InteractionInstance instance);

// Properties
public int MinimumCombatLevelForTrainee { get; set; }

// Nested Types
[HasSpecializedTuning(typeof(TrainingDummy.Train.SpecializedTuning))]
protected sealed class Definition : InteractionDefinition<Sim, TrainingDummy, TrainingDummy.Train>
{
// Fields
private int mMinimumCombatLevelForTrainee;

// Methods
public Definition();
public bool IncludeCombatSims(Sim targetSim, GameObject testObject);
public override InteractionTestResult Test(ref InteractionInstanceParameters parameters, ref GreyedOutTooltipCallback greyedOutTooltipCallback);
protected override bool Test(Sim a, TrainingDummy target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback);
}

public class SpecializedTuning : SpecializedInteractionTuning
{
// Fields
public int MinimumCombatLevelForTrainee;
public float MinutesToWaitForPracticer;

// Methods
public SpecializedTuning();
public override void Load(DataNode rootNode, bool bIsClone);
public override void WriteToXml(XmlTextWriter xmlWriter, string whitespace);
}
}
}
Inventor
#7 Old 2nd Apr 2015 at 5:20 PM
Add another one, at the end, then you have to add at the top a bunch of "using" statements
in order to be able to access classes defined in particular namespaces. You can use ILSpy
(or whatever) to get the namespaces you need, for instance GameObject requires
# using Sims3.Gameplay.Abstracts;
Instructor
#8 Old 3rd Apr 2015 at 2:31 AM
Now, I do wonder, what do you hope to accomplish with coding? lol
Lab Assistant
Original Poster
#9 Old 3rd Apr 2015 at 1:27 PM
What I wanted to do was to convert the objects from The Sims 3 Medieval to the Sims 3 with their own scripts. I suppose that it is needed to change something in the script to make the object available for the Sims 3, but I don't know what it is. I saw this ttorial on the intenernet:;

http://modthesims.info/wiki.php?tit..._Object_Modding

So I tried to edit an object from the Base Game and edit the script (copying parts of the medieval object script and pasting them into the new script) but it doesn't work. The truth is that I don't know what I'm doing and I know nothing about the C# language. Yes you can laugh at me because if I were you I would do the same thing... But I have very crazy ideas and I am very stubborn... even if I don't know how to work... :s
Back to top