Jump to content

NovaViper

Forge Modder
  • Posts

    1061
  • Joined

  • Last visited

Posts posted by NovaViper

  1. So far, I have adapted the ItemWhistle code from Sophisticated Wolves (and given them proper credit of it) to make the whistle in Doggy Talents function, however I want to take the item to a whole new level. Basically, the entire purpose of the whistle is to recall all of the dogs that you have tamed to you in case you lost them somewhere. What I intend to do is take that furthur by allowing the item to call the dogs back from any distance, basically anywhere in the dimension. While the basic code is working, I can't figure out how to make the item scan the entire world for all entities that use the class EntityDog, select them and then make them teleport to the player. Here's what I have so far: https://hastebin.com/agodoqihix.swift

  2. This is something momentous I haven't attempted before but here goes nothing. I'm developing a skill for the dogs in DoggyTalents that would basically give the dogs ranged attacks. So the things I'm trying to work out are the following:

     

    1. Make the normal LeapAtTarget and my custom Ranged Attacks AI switch between each other. Whenever the dog's target comes within the normal range of the Leaping AI (in the code it says the distance of the target squared (d0) is 4.0 D<= d0 <= 16.0D Not sure how far this is in blocks however), then it will switch to the leaping ai and attack; while if the target is more than this range, then it will switch to the ranged attack ai and attack
    2. Have different "types" of ranged attacks. So, there would be different 'elements' that the attacks can feature and each respective element would use a specific entity for the actual projectile, such as fire (using a fireball or something like a dragon's breathe), water (potion bottle entity?), poison (dragon's breath possibly or the poison tipped arrow), ice (snowballs), physical (regular arrows/tipped arrows or a stone block). The elements can be switched around via items at the mastery level (which is level 5)
    3. There is a cooldown between each ranged attack. I already have a good idea on what to do with this but since the cooldown is only used
    4. Each attack shoot out differently and have different behaviors. For instance, the fire element is very similar to fire breath, so it shoots out a constant stream of fire particles or small fireballs, then it has a cooldown in between each breathe; ice is the exact same way. Poison and water is more a 'spitting' type of thing so it only shoots out one projectile and it lingers, basically how the Enderdragon's new magic breathe works. Physical is the exact same as a skeleton shooting an arrow.
    5. Each attack has a different effect as well. For instance, fire obviously burns entities, also would be cool if it burns the area around it as well. Ice and water can put out fires, however ice can turn water into ice blocks; water can leave behind a puddle of water. Poison obviously causes poison damage. and physical causes normal damage

    Some of the parts I already have started working on but those are the core aspects I need some advice on. If it helps, here is a link to the 1.12.2 source code (as that's the current version I'm working on).

  3. On 4/2/2018 at 3:06 PM, Ruukas said:

    Remove "int cooldown" and instead use a getCooldown() and setCooldown(), which reads or updates the NBT.

    I can't get the methods to work since the talent class doesn't have, the IDE keeps saying the class is undefined in IDataWatcher type. https://hastebin.com/opomumuvoq.java

     

    Nvm, I figured it out. I got it all working now. Thanks for the advice

  4. 3 hours ago, Ruukas said:

    Then, that should work. I won't be posting the full code, as I want you to read all of it, and put it together yourself. It also might have some typos.

    One thing I am concerned about, though is the cooldown simply being a variable. I would probably store it in NBT or dataManager.

    You should also initialize the value.
     

    I'm working on adding in NBT but. like I said, I'm a bit rusty with this. I'm not sure if I'm doing the NBT storing and retrieving correctly. https://hastebin.com/kicahibage.java

  5. Just now, jabelar said:

    You need to post the whole class code. Hard to tell what is going on with just a bit of it.

     

    Is this your code? The general code is quite complex and shows a fairly high degree of coding ability, but your questions show very little understanding of how to code. So it seems that you've copied code from somewhere else and are trying to modify it a bit. It is okay if you are doing that, but we need to know because otherwise we don't know how to help you -- do you need quick tips or do you need detailed step-by-step help?

    The original code came from another talent called Pest Fighter (No it's not mine basically). I've gotten a bit rusty when it comes to coding this year because of school taking away much of my free time to code in general. I did do a few more changes to the talent.

  6. I blanked out the cooldown and it worked perfectly, but kept firing constantly. I did something like this but now it doesn't seem to run at all

     

    				cooldown2 = level == 5 ? 20 : 50;
    				
    				if (dog.getEntityWorld().isRemote) {
    					if (this.cooldown2 > 0) {
    						this.cooldown2--;
    						// System.out.println(this.cooldown2);
    					}
    				}
    				List<EntityMob> list = dog.world.<EntityMob>getEntitiesWithinAABB(EntityMob.class, dog.getEntityBoundingBox().grow(level * 4, 4D, level * 4).expand(0.0D, (double)dog.world.getHeight(), 0.0D));
    				//List list = dog.world.getEntitiesWithinAABB(EntityMob.class, dog.getEntityBoundingBox().grow(level * 3, 4D, level * 3));
    	            //Iterator iterator = list.iterator();
    	            if(!list.isEmpty()) {
    	            	for(EntityMob mob : list) {
    	            		if (cooldown2 == 0) {
    							dog.playSound(SoundEvents.ENTITY_WOLF_GROWL, 1f, 1f);
    							mob.spawnExplosionParticle();
    							int knockback = (level == 5 ? 3 : 1);
    							mob.attackEntityFrom(DamageSource.GENERIC, damage);
    							//mob.addPotionEffect(MobEffects.SLOWNESS);
    							//mob.addVelocity(-MathHelper.sin(mob.rotationYaw * (float) Math.PI / 180.0F) * knockback * 0.5F, 0.1D, MathHelper.cos(mob.rotationYaw * (float) Math.PI / 180.0F) * knockback * 0.5F);
    						}
    	            	}
    	            }

     

  7. I'm trying to create a talent for DoggyTalents that has the dog produce a roar that has a certain AoE (Area of Effect) range and causes all entities that are extended from EntityMob to be stunned and take damage depending on how much the level of the talent itself. So far I have something like this but there are a few issues with it however:

    1. It only effects one mob at a time, instead of all of them at once
    2. The section that is uncommented now doesn't cause damage but produces the particles
  8. 6 hours ago, diesieben07 said:

    Yes, because some dufus started this at some point. I am not sure who it was and it doesn't really matter.

    Forge is a library like any other and there is no point in making a project for it. It is cached through Gradle just like any other library.

    Then you think I should have the Project variable set for EclipseCore? Then have all of the projects that need it added in the classpath to run?

  9. 1 minute ago, sir_titi said:

    oow well do you have your MC code in a separate project? cuss i do and the base Main project is Minecraft (kinda logical).

    Meaning all the MC/Forge code is in that project and let's say mod core has only the core code+assets and my radio mod has all the radio thingy's in it's dedicated project. And if i want to run it i actually run the MC/Forge, core and my radio mod

    I don't. the video I was going off of mentioned that you don't need to have a separate Minecraft Forge project

  10. 24 minutes ago, sir_titi said:

    Well not that hard also :p.

    Let's say you are at that menu i showed (picture), well there you see your project run/debug configurations, you could just right click the Client/Server and do "duplicate", then you can change that one that will have the 2/or more mods to the run/debug thingy. (as showed before).

     

    What about the main? What do I put for the Project variable?

  11. 1 hour ago, sir_titi said:

    You will now have to edit the run/debug click on "run/debug configuration" in there you have to go to tab "Class-path" and simply add the projects and you can run them all :).

    Hope this helps you some how it's not that hard.

     

    Quote

    5aa3f66525ce6_eclipseRun.png.cf45aee323f85881e2accadec0c1d35a.png

    Which Run/Debug configuration do I change? I have one Client and one Server for each project

  12. Hi, I just recently set up my workspace to feature multiple projects (in their respective folders) and I am wondering how I can get these two protects not only to run simultaneously, but also be able to use code from each other (i.e. I use methods from Project 1 to create a creature in Project 2 and so on.). I used this video by LexManos in order to setup everything, but I haven't been able to figure out how to make Eclipse accomplish these two tasks. Any idea what I can do?

  13. Hm.. I watched the end of @LexManos's video and he did say it is possible to have both mods running at the same time (and have them compile seperately) but he would show it in another tutorial.. which hasn't been made unfortunately. He also said that when doing so, you have to tell gradle that ModA (TerrakonCraft) depends on ModB(EclipseCore)...now how would I be able to do that is the question now.

  14. I just thought of idea that would (theoretically) work better for me. I was doing some searching and saw that it is possible to make Multiproject workspaces with Minecraft Forge and Eclipse. The reason why I thought of this way because I want to separate the Github repos for each of these projects (TerrakonCraft goes in the TerrakonCraft repo, and EclipseCore goes into the EclipseCore repo) and I go push each changes to these projects to their respective repos. With this also, it would make simply compiling these mods.

     

    I do however, have one question about this method, is it possible to pull classes from these mods? (I.e. import a registry class from EclipseCore in order to register an entity to TerrakonCraft)

×
×
  • Create New...

Important Information

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