Jump to content

Recommended Posts

Posted

Hi!

I created a Bull entity which should breed with the cow ... but I don't know how to do this. I spent six hours trying different methods but nothing changed.

 

Would you help me please? :(

Posted
  On 2/18/2013 at 12:49 AM, Mazetar said:

How about telling us what you have tried? :)

 

I tried to edit the code "canmatewith", i tried to create a custom AIMate for cows and bulls, i tried to create a custom "canmatewith" code for cows and bulls ... T_T

Posted
  On 2/18/2013 at 1:53 PM, Mazetar said:

When u debugged the canmatewith method which you overrided, what happend when it was called?

 

o_o

uhm. Nothing happens ... I show you the AI i created and the canmatewith custom i made:

 

 

canMateWith

 

 

  Reveal hidden contents

 

 

 

AIMate

 

 

  Reveal hidden contents

 

 

 

 

BullEntity

 

 

  Reveal hidden contents

 

 

 

  Quote

what about extending entity bull by entity cow ?

so the bull gets recognized as a cow, not another entityliving.

 

dont know if that works though.

 

I thought of this as well but I just want cow and bull to breed, not cow and cow or bull and bull T_T

 

Posted
  On 2/18/2013 at 10:36 PM, Mazetar said:

nothing happends? as inn the code is never called? the breakpoints never seems to be passed or?

 

 

The cows keep mating each others, as well as bull; bulls and cows don't mate.

 

It's like the mod doesn't see my changes.

 

Sorry for my bad english :(

Posted

Thats not what I asked, I asked what happends when the code execute, when the code runs. What happends the exact moment each line of code runs trough the method?

 

Not what you see in-game but what do you see inn the code when it checks cow against bull?

 

If you can't tell me this, I promise you what you really need above and before all is to learn some programming somewhere before modding a game..

  Quote

If you guys dont get it.. then well ya.. try harder...

Posted

let me be even more specific inn my question:

 

What happends when THIS line is run?

}else if ((this instanceof BullEntity) && (entity instanceof EntityCow)){

Do you know what this code is checking for?

  Quote

If you guys dont get it.. then well ya.. try harder...

Posted
  On 2/19/2013 at 6:48 PM, Mazetar said:

let me be even more specific inn my question:

 

What happends when THIS line is run?

}else if ((this instanceof BullEntity) && (entity instanceof EntityCow)){

Do you know what this code is checking for?

 

The mod doesn't get to that point :(

 

 

Posted

why does it not, what prevents it from hitting that line of code?

and justa s important: Do you understand what it would do IF it hit that line?

  Quote

If you guys dont get it.. then well ya.. try harder...

  • 2 years later...
Posted

I know this thread has been closed for a while, but for anyone who has this problem, SenpaiSubaraki's suggestion works. Make one of the entities extend the other, then use the canmatewith method code Dren created in each of the entities.

Before you say that I need to learn java, I will have you know that I have completed an advanced java course from johns hopkins university with an A- average.

Thanks, and have a nice day and a smiley :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.