div class="quote-body">
Hi all, I wonder if this problem I'm having is a bug or just my noob knowledge...
EDIT: feel free to slap me around here, I am humbly bad at code and this is mostly how I am learning my way. I'm watching videos and searching elsewhere as well... I see that some tricks are required to use console commands from CNPC. Maybe I can find a way to do it using only CNPC commands
I'm trying some simple stuff such as using kill command to get rid of all creepers. code is such:
function update(event){ kill @e[type=Creeper];}
Your script hurts my eyes! slap
especially since I used a MC command just 2 post up from yours - slap
function update(event){
event.npc.executeCommand("kill @e[type=Creeper]");
}
I just updated to 1.9 and now whenever I make an NPC with a ranged attack, they apparently can't make a melee attack anymore. This wasn't true before. Is there a way to fix this?
I've seen videos where the npc is leaning on a wall or hugging another npc. I've been wanting to do that and I can't figure out how. Is there a way to do that. There's an example below.
I've seen videos where the npc is leaning on a wall or hugging another npc. I've been wanting to do that and I can't figure out how. Is there a way to do that. There's an example below.
That was probably done with the puppet job, and possibly some scripting magic if it wan't a cut.
Rollback Post to RevisionRollBack
If you require aid with Custom NPC's give me a shout (In the thread, not PM's). I can read a bit of error reports, know most of the NPC workings (I'm attempting to work on scripting) and have been using it since its 1.0 version. Otherwise I'll help with any questions or problems I can.
(Its such a shame that Npcs cant walk through nether portals in 1.7.10...) Would've enjoyed Glorious Mongol- I mean Mangalians invading the Thousands of Nether Npcs.... Such as: Mini Zombie Pigmen, Wither Skeletons, Skeleton Dragons, Giant Pigmen etc... Nether's Natural Population is around 500-950 (Estimated).... Now that Mangalians have colonized the Nether, (Sadly they cant go through portals) Population in my World will soon rise... Once I finish creating Muscovian Federation... (Still not done creating towns and cities and filling them with hundreds of Npcs..... THEN Create a backup, Unleash a Zombie that has the infection script, And watch Literally every single Nation in my world fall into a Zombie Wasteland. That is until the OP Hacki- I mean Totally Legit NPC Snipers that have OP Sniper Rifles which do 5000 Damage.... Stomp an Army of 200-500 Zombies running towards them with 2-3 losses. That is until more Npcs come and Minecraft starts to slow down a bit... cus limitations... Then load your backup, Continue expansion, Repeat the Process until you've created a World with a Population of 500k Npcs... Or even 1 Million... (That is if Minecraft wont crash when loading new chunks when mixing mods together :D)
I noticed a little bug/annoyance in the 1.7.10d version. When a custom texture is added to an NPC wolf it goes back to vanilla when it rains, and the wolf has to manually have its texture put back on each time. I'm guessing this has something to do with the way they shake the rain off now since it only seems to happen during and after the weather changes. I'm not expecting a fix in 1.7.10 of course, just reporting it for later versions
Rollback Post to RevisionRollBack
“I know there's a proverb which that says 'To err is human,' but a human error is nothing to what a computer can do if it tries.”
― Agatha Christie, Hallowe'en Party
Ok I know Noppes isn't around at the moment but I have to beg anyway. I've just tested what has to be the most heart bursting Biome mod ever, The Realistic biomes mod transformed my picaso coded map generation into a renasonse painting so beautiful and workable with mountains so big I can fit an entire Dwarven city with battlements to spare, but the best bonus is that it works all with vanilla materials.. testing it made me so happy my eyes leaked
But I was horribly dashed when the 1.8.9 bug remained to haunt me.. the Custom npcs 1.8.9 ,,invisible arrow bug remains even after all this time, true I can't expect Noppes to backtrack that far to fix a bug in a version that never grew from beta ..sad but it would be unfair on Noppes.
So I beg I plead please can he tell me the invisible arrows bug did not migrate into 1.9 as well T_T"
Noppes is around, on Discord. Ive talked to him recently there.
Trying to learn scripting, can someone help me make 2 or more scripts fire at once? This example below is only firing the second script.
function died(event){ event.npc.executeCommand("playsound minecraft:entity.generic.explode @p");
}
function died(event){ event.npc.executeCommand("particle smoke ~ ~ ~ 1 1 1 0.5 200");
}
Also would love to see a few example for executing commands when the npc reaches specific health levels percentages. Im trying to make a boss that gets harder at certain levels.
Trying to learn scripting, can someone help me make 2 or more scripts fire at once? This example below is only firing the second script.
function died(event){ event.npc.executeCommand("playsound minecraft:entity.generic.explode @p");
}
function died(event){ event.npc.executeCommand("particle smoke ~ ~ ~ 1 1 1 0.5 200");
}
Also would love to see a few example for executing commands when the npc reaches specific health levels percentages. Im trying to make a boss that gets harder at certain levels.
You don't need to put the died event twice. Just put the two scripts into the same tab and they should execute at the exact same time.
Thanks! Any idea how to make commands fire at certain health levels? Also if its possible to fire commands randomly between perhaps four different commands?
When You choose accuracy, and change the number, after you save it resets.
Also when choosing a sound, Fire sound and Ground sound are the only selectable buttons, you cannot select Hitsounds... But sadly only Fire Sound works, when you add something to Ground sound it overwrites Firesound. If you choose to type in your sounds for all three it ignores them.
Thanks! Any idea how to make commands fire at certain health levels? Also if its possible to fire commands randomly between perhaps four different commands?
Probably (in 1.8.9) use in a damaged or tick function
if ( event.npc.getHealth() < 25 ) {
// do something
}
Here is a real cheap an easy random routine ( I think this should work)
var random_number = Math.floor(Math.random() * 4);
switch (random_number) {
case 0:
// something
break;
case 1:
// something
break;
case 2:
// something
break;
case 3:
// something
When You choose accuracy, and change the number, after you save it resets.
Also when choosing a sound, Fire sound and Ground sound are the only selectable buttons, you cannot select Hitsounds... But sadly only Fire Sound works, when you add something to Ground sound it overwrites Firesound. If you choose to type in your sounds for all three it ignores them.
Can confirm that the accuracy still does not change in the 1.9 version.
Thanks! Any idea how to make commands fire at certain health levels? Also if its possible to fire commands randomly between perhaps four different commands?
nice
I put an npc on natural spawns on all biomes and 100 spawn chance. But I don't see him anywhere.
Ok, no problem
I just updated to 1.9 and now whenever I make an NPC with a ranged attack, they apparently can't make a melee attack anymore. This wasn't true before. Is there a way to fix this?
Dang. Well thank you much for the reply. ^^
sweet golly I've messed up the toads eyes with horrid code
self.isSlapped = true;
Wow thanks, that was too simple haha and now a lot more makes sense x)
I found the full documentation and will book it for a bit!
I've seen videos where the npc is leaning on a wall or hugging another npc. I've been wanting to do that and I can't figure out how. Is there a way to do that. There's an example below.
That was probably done with the puppet job, and possibly some scripting magic if it wan't a cut.
So is the Attack Invi function broken for 1.7.10d? Anytime I set it to yes it just reverts to no.
EDIT: Also, why are all cloned npc's linked by the night settings? I can't change one npc's night time settings without changing them all.
(Its such a shame that Npcs cant walk through nether portals in 1.7.10...) Would've enjoyed Glorious Mongol- I mean Mangalians invading the Thousands of Nether Npcs.... Such as: Mini Zombie Pigmen, Wither Skeletons, Skeleton Dragons, Giant Pigmen etc... Nether's Natural Population is around 500-950 (Estimated).... Now that Mangalians have colonized the Nether, (Sadly they cant go through portals) Population in my World will soon rise... Once I finish creating Muscovian Federation... (Still not done creating towns and cities and filling them with hundreds of Npcs..... THEN Create a backup, Unleash a Zombie that has the infection script, And watch Literally every single Nation in my world fall into a Zombie Wasteland. That is until the OP Hacki- I mean Totally Legit NPC Snipers that have OP Sniper Rifles which do 5000 Damage.... Stomp an Army of 200-500 Zombies running towards them with 2-3 losses. That is until more Npcs come and Minecraft starts to slow down a bit... cus limitations... Then load your backup, Continue expansion, Repeat the Process until you've created a World with a Population of 500k Npcs... Or even 1 Million... (That is if Minecraft wont crash when loading new chunks when mixing mods together :D)
Thanks! Maybe you can make a thread with basics of scripting, or a some updates to the wiki. The very least, 4 or 5 examples?
http://customnpcs.wikia.com/wiki/Customnpcs_Wiki?action=edit§ion=1
Maybe another example could be timed events or events that occur when the npc is a certain health percentages?
Btw ill let you know how well this works! I have some spell particle effect ideas, perhaps ill make a video after I put together a cool boss.
I noticed a little bug/annoyance in the 1.7.10d version. When a custom texture is added to an NPC wolf it goes back to vanilla when it rains, and the wolf has to manually have its texture put back on each time. I'm guessing this has something to do with the way they shake the rain off now since it only seems to happen during and after the weather changes. I'm not expecting a fix in 1.7.10 of course, just reporting it for later versions
“I know there's a proverb which that says 'To err is human,' but a human error is nothing to what a computer can do if it tries.”
― Agatha Christie, Hallowe'en Party
Noppes is around, on Discord. Ive talked to him recently there.
Trying to learn scripting, can someone help me make 2 or more scripts fire at once? This example below is only firing the second script.
Also would love to see a few example for executing commands when the npc reaches specific health levels percentages. Im trying to make a boss that gets harder at certain levels.
You don't need to put the died event twice. Just put the two scripts into the same tab and they should execute at the exact same time.
Thanks! Any idea how to make commands fire at certain health levels? Also if its possible to fire commands randomly between perhaps four different commands?
I noticed some bugs in 1.8.9
While in the RangedOptions Under Stats
When You choose accuracy, and change the number, after you save it resets.
Also when choosing a sound, Fire sound and Ground sound are the only selectable buttons, you cannot select Hitsounds... But sadly only Fire Sound works, when you add something to Ground sound it overwrites Firesound. If you choose to type in your sounds for all three it ignores them.
Probably (in 1.8.9) use in a damaged or tick function
if ( event.npc.getHealth() < 25 ) {
// do something
}
Here is a real cheap an easy random routine ( I think this should work)
var random_number = Math.floor(Math.random() * 4);
switch (random_number) {
case 0:
// something
break;
case 1:
// something
break;
case 2:
// something
break;
case 3:
// something
}
Can confirm that the accuracy still does not change in the 1.9 version.
this page has all of the functions that are included in Custom NPCs. It may be helpful
http://www.kodevelopment.nl/customnpcs/api/