Mythruna
May 25, 2019, 02:39:39 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to the new forums. See "Announcements" for a note for new users.
 
   Home   Help Search Login Register  
Pages: 1 [2] 3
  Print  
Author Topic: Battle Mod v0.1  (Read 15420 times)
Michael Musgrove
Donators
Hero Member
***
Posts: 2157



View Profile WWW
« Reply #15 on: April 11, 2013, 06:10:58 PM »

Off topic much? Lol, this always happens Cheesy
Eh, you know me.
Yea, I get things off topic, but I cannot get them ON topic x(
Logged

BenKenobiWan
Friendly Moderator
Donators
Hero Member
***
Posts: 673


Jesus loves you!


View Profile
« Reply #16 on: April 11, 2013, 06:29:10 PM »

lol I'm too smart for online schools Tongue
^ This is not true. Online schools teach harder things than public schools. I learned it the hard way. LITERALLY, GWAHAHA.
I'm in distance-learning college, which is basically online. High-five!

And cool mod. I'll test it out soon.
Logged
Moonkey
Hero Member
*****
Posts: 1587

This is probably a picture.


View Profile
« Reply #17 on: April 11, 2013, 07:38:52 PM »

lol I'm too smart for online schools Tongue
^ This is not true. Online schools teach harder things than public schools. I learned it the hard way. LITERALLY, GWAHAHA.
I'm in distance-learning college, which is basically online. High-five!

And cool mod. I'll test it out soon.
That sounds cool, if not difficult to work out since it's on the internet, which isn't always reliable.
Logged

Mythruna: Don't you dare read any posts I made before 2014.
BenKenobiWan
Friendly Moderator
Donators
Hero Member
***
Posts: 673


Jesus loves you!


View Profile
« Reply #18 on: April 11, 2013, 08:03:46 PM »

lol I'm too smart for online schools Tongue
^ This is not true. Online schools teach harder things than public schools. I learned it the hard way. LITERALLY, GWAHAHA.
I'm in distance-learning college, which is basically online. High-five!

And cool mod. I'll test it out soon.
That sounds cool, if not difficult to work out since it's on the internet, which isn't always reliable.
The tests are taken at a local college I'm not enrolled in, and the studying is done at home, mainly online.

Edit: The tests are CLEPs. The program I'm enrolled in is CollegePlus. You can google both of those (or PM me if you prefer, but let's try and keep this thread somewhat on topic).
« Last Edit: April 11, 2013, 08:14:56 PM by BenKenobiWan » Logged
Toboi
Newbie
*
Posts: 9


View Profile
« Reply #19 on: April 20, 2013, 12:58:56 PM »

Sorry that I'm ontopic... Cheesy
Nice mod, makes me think about doing some scripting myself again... Wink
Just one little thing about your code:
Code:
if(hp > 0) {
hp = hp-takeaway;

if(hp == 0) {
self.setModel("win")
echo("You won!");
} else {
echo("Health is now " + Integer.toString(hp) + "!");
}

}
is probably better done this way if anyone is going to use and extend this:
Code:
hp = hp-takeaway;

if(hp <= 0) {
self.setModel("win")
echo("You won!");
} else {
echo("Health is now " + Integer.toString(hp) + "!");
}
Else you could come to a point wher the hp are below zero, but never get noticed as won.
Logged
nh_99
Donators
Jr. Member
***
Posts: 71



View Profile
« Reply #20 on: April 20, 2013, 07:38:52 PM »

Sorry that I'm ontopic... Cheesy
Nice mod, makes me think about doing some scripting myself again... Wink
Just one little thing about your code:
Code:
if(hp > 0) {
hp = hp-takeaway;

if(hp == 0) {
self.setModel("win")
echo("You won!");
} else {
echo("Health is now " + Integer.toString(hp) + "!");
}

}
is probably better done this way if anyone is going to use and extend this:
Code:
hp = hp-takeaway;

if(hp <= 0) {
self.setModel("win")
echo("You won!");
} else {
echo("Health is now " + Integer.toString(hp) + "!");
}
Else you could come to a point wher the hp are below zero, but never get noticed as won.
Thanks for picking that up. I will work on an update.
Logged
Michael Musgrove
Donators
Hero Member
***
Posts: 2157



View Profile WWW
« Reply #21 on: May 18, 2013, 12:02:31 PM »

/* Adjusts to back on topic, hopefully. */

nh_99, I was wondering, when you code in Groovy do you use a simple text-editor or do you use an IDE?
Logged

nh_99
Donators
Jr. Member
***
Posts: 71



View Profile
« Reply #22 on: May 19, 2013, 03:50:31 PM »

/* Adjusts to back on topic, hopefully. */

nh_99, I was wondering, when you code in Groovy do you use a simple text-editor or do you use an IDE?
Text editors work, but I tend to use an IDE just to keep the code organized. I used Eclipse to make my mods.
Logged
Michael Musgrove
Donators
Hero Member
***
Posts: 2157



View Profile WWW
« Reply #23 on: May 19, 2013, 04:41:29 PM »

/* Adjusts to back on topic, hopefully. */

nh_99, I was wondering, when you code in Groovy do you use a simple text-editor or do you use an IDE?
Text editors work, but I tend to use an IDE just to keep the code organized. I used Eclipse to make my mods.
Do you grab the jar from the linux version? or do you use specific jars from the windows/mac version?
Logged

Sean
Donators
Hero Member
***
Posts: 598



View Profile
« Reply #24 on: May 19, 2013, 07:01:51 PM »

/* Adjusts to back on topic, hopefully. */

nh_99, I was wondering, when you code in Groovy do you use a simple text-editor or do you use an IDE?
Text editors work, but I tend to use an IDE just to keep the code organized. I used Eclipse to make my mods.
Do you grab the jar from the linux version? or do you use specific jars from the windows/mac version?
Errm the point of a jar is that it will run on any platform as long as the correct libraries are in place.
Logged

"People willing to trade their freedom for temporary security deserve neither and will lose both." - Benjamin Franklin
Michael Musgrove
Donators
Hero Member
***
Posts: 2157



View Profile WWW
« Reply #25 on: May 19, 2013, 07:58:11 PM »

Also, can you help me with setting up the environment nh_99? I added the jars and it gives me an error with this:
Code:

println 'MyMod by Shzylo'

class MyClass {  // <-- Error Here
                       // Says the class is already defined.
}                     // <-- Stupid thing.

on( [PlayerConnected] ) {

}

If i remove the println statement at the tom, and the on( [PlayerConnected] ) { } it works just fine.
Logged

nh_99
Donators
Jr. Member
***
Posts: 71



View Profile
« Reply #26 on: May 20, 2013, 02:30:48 PM »

Also, can you help me with setting up the environment nh_99? I added the jars and it gives me an error with this:
Code:

println 'MyMod by Shzylo'

class MyClass {  // <-- Error Here
                       // Says the class is already defined.
}                     // <-- Stupid thing.

on( [PlayerConnected] ) {

}

If i remove the println statement at the tom, and the on( [PlayerConnected] ) { } it works just fine.
Funny thing, if you rename that class it will work. You are going to want to call PlayerConnected outside of that class though. The println call says that there is an implied class there basically so it's name is already taken. Only use a class if you are planning on having a sort of API for your mod though, else you can do it all in the script.
Logged
Michael Musgrove
Donators
Hero Member
***
Posts: 2157



View Profile WWW
« Reply #27 on: May 20, 2013, 02:34:24 PM »

Also, can you help me with setting up the environment nh_99? I added the jars and it gives me an error with this:
Code:

println 'MyMod by Shzylo'

class MyClass {  // <-- Error Here
                       // Says the class is already defined.
}                     // <-- Stupid thing.

on( [PlayerConnected] ) {

}

If i remove the println statement at the tom, and the on( [PlayerConnected] ) { } it works just fine.
Funny thing, if you rename that class it will work. You are going to want to call PlayerConnected outside of that class though. The println call says that there is an implied class there basically so it's name is already taken. Only use a class if you are planning on having a sort of API for your mod though, else you can do it all in the script.
Oh cool Smiley I am still trying to figure out how the API is working, and understanding the unique-ness and algorithm of Groovy. Thank you!
Logged

Teknonick
Sr. Member
****
Posts: 438


View Profile
« Reply #28 on: May 20, 2013, 03:56:50 PM »

AWESOME MOD! Suggestion: How about making up your own AI, where the 'bot' will move forward until it touches something, then turn ETC. Maybe if there's a player nearby, it will face it and move towards it until it's like two feet in front, then randomly move forward, back, left, right and maybe jump, to dodge the player's attacks. :3
Logged
Michael Musgrove
Donators
Hero Member
***
Posts: 2157



View Profile WWW
« Reply #29 on: May 20, 2013, 04:03:11 PM »

AWESOME MOD! Suggestion: How about making up your own AI, where the 'bot' will move forward until it touches something, then turn ETC. Maybe if there's a player nearby, it will face it and move towards it until it's like two feet in front, then randomly move forward, back, left, right and maybe jump, to dodge the player's attacks. :3
Hehe, that would take his mod and multiply the amount of code by somewhere between 20 and 100. And plus, is would be kind of hard in Groovy I think, along with it being a Mod in mythruna..
Logged

Pages: 1 [2] 3
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!