Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: "cannot be applied to" error

  1. #1
    Member
    Join Date
    Jan 2011
    Posts
    88
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default "cannot be applied to" error

    heres my error

    .\icedice\content\minigames\FightCave.java:96: newNPC(int,int,int,int,int,int,in
    t,int,boolean) in icedice.Engine cannot be applied to (int,int,int,int,int,int,i
    nt,int,boolean,int)
                            Server.engine.newNPC(player.waveType[0], player.waveType
    [1], player.waveType[2], player.waveType[3], 0, 0, 0, 0, false, player.playerId)
    ;


    heres my method in the fightcave class

    	public void fightSystem() {
    		switch (player.waveCount) {
     
    			case 0:
    				player.waveType[0] = 2735;
    				player.waveType[1] = 2408;
    				player.waveType[2] = 5100;
    				player.waveType[3] = player.heightLevel;
    				player.waveType[4] = 1;
    			break;
     
    			case 1:
    				player.waveType[0] = 2735;
    				player.waveType[1] = 2405;
    				player.waveType[2] = 5095;
    				player.waveType[3] = player.heightLevel;
    				player.waveType[4] = 2;
    			break;
     
    			case 2:
    				player.waveType[0] = 2737;
    				player.waveType[1] = 2400;
    				player.waveType[2] = 5093;
    				player.waveType[3] = player.heightLevel;
    				player.waveType[4] = 3;
    			break;
     
    			case 5:
    				player.waveType[0] = 2739;
    				player.waveType[1] = 2387;
    				player.waveType[2] = 5104;
    				player.waveType[3] = player.heightLevel;
    				player.waveType[4] = 4;
    			break;
     
    			case 6:
    				player.waveType[0] = 2741;
    				player.waveType[1] = 2390;
    				player.waveType[2] = 5099;
    				player.waveType[3] = player.heightLevel;
    				player.waveType[4] = 5;
    			break;
     
    			case 7:
    				player.waveType[0] = 2743;
    				player.waveType[1] = 2391;
    				player.waveType[2] = 5089;
    				player.waveType[3] = player.heightLevel;
    				player.waveType[4] = 6;
    			break;
     
    			case 8:
    				player.waveType[0] = 2744;
    				player.waveType[1] = 2391;
    				player.waveType[2] = 5089;
    				player.waveType[3] = player.heightLevel;
    				player.waveType[4] = 7;
    			break;
     
    			case 9:
    				player.frames.showChatboxInterface(player, 241);
    				player.frames.animateInterfaceId(player, 9847, 241, 2);
    				player.frames.setNPCId(player, 2617, 241, 2);
    				player.frames.setString(player, "TzHaar-Mej-Jal", 241, 3);
    				player.frames.setString(player, "Watch out here comes Tztok-Jad!", 241, 4);
    				player.waveType[0] = 2745;
    				player.waveType[1] = 2415;
    				player.waveType[2] = 5081;
    				player.waveType[3] = player.heightLevel;
    				player.waveType[4] = 8;
    			break;
    		}
    		if (hasNeededKills())
    			Server.engine.newNPC(player.waveType[0], player.waveType[1], player.waveType[2], player.waveType[3], 0, 0, 0, 0, false, player.playerId);
    		player.waveDelay = -1;
    	}

    heres line 96
    			Server.engine.newNPC(player.waveType[0], player.waveType[1], player.waveType[2], player.waveType[3], 0, 0, 0, 0, false, player.playerId);

    heres it is in the engine

                    for (NPC n : npcs) {
                        if (n == null) {
                            continue;
                        }
                        npcUpdate.clearUpdateMasks(n);
                    }
                    for (NPC n : npcs) {
                        if (n == null) {
                            continue;
                        }
                        n.process();
                        if (!n.isDead) {
                            if (n.randomWalk && !n.attackingPlayer) {
                                npcMovement.randomWalk(n);
                            }
                        } else {
                            if (!n.deadEmoteDone) {
                                n.requestAnim(n.deathEmote, 0);
                                n.deadEmoteDone = true;
                                n.combatDelay = 3;
                            } else if (n.deadEmoteDone && !n.hiddenNPC && n.combatDelay <= 0) {
                                n.npcDied(Engine.players[1], n.npcType, n.absX, n.absY);
                                n.hiddenNPC = true;
                            } else if (n.deadEmoteDone && !n.hiddenNPC
                                    && n.combatDelay <= 0) {
                                n.hiddenNPC = true;
                            } else if (n.hiddenNPC && n.respawnDelay <= 0) {
                                if (n.needsRespawn) {
                                    newNPC(n.npcType, n.makeX, n.makeY,
                                            n.heightLevel, n.moveRangeX1,
                                            n.moveRangeY1, n.moveRangeX2,
                                            n.moveRangeY2, true);
                                }
                                npcs[n.npcId] = null;
                                rebuildNPCs();
                            }
                        }
                        lastEntityUpdate = curTime;
                    }

    i dont really know whats causing this.. im still a noob to java. please help and if u need any more information let me know!


  2. #2
    Junior Member
    Join Date
    Feb 2011
    Posts
    19
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default Re: "cannot be applied to" error

    "newNPC(int,int,int,int,int,int,in
    t,int,boolean) in icedice.Engine cannot be applied to (int,int,int,int,int,int,i
    nt,int,boolean,int)
    "
    (int,int,int,int,int,int,int,int,boolean)
    (int,int,int,int,int,int,int,int,boolean,int)
    Well, you noticed the difference, didn't you?

  3. The Following User Says Thank You to codesmuggler For This Useful Post:

    frozen java (February 14th, 2011)

  4. #3
    Member
    Join Date
    Jan 2011
    Posts
    88
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Re: "cannot be applied to" error

    i didnt notice it. thank you i got it fixed!!

Similar Threads

  1. Replies: 6
    Last Post: November 12th, 2010, 04:40 AM
  2. Replies: 1
    Last Post: March 31st, 2010, 09:42 PM
  3. Replies: 1
    Last Post: January 15th, 2010, 01:32 AM
  4. "java.lang.NoSuchMethodError: main" and "fatal exception occured."
    By joachim89 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 10th, 2010, 08:35 AM
  5. Replies: 4
    Last Post: June 18th, 2009, 09:23 AM

Tags for this Thread