New LUA AI Functions
Moderator: Team Members
- thefoof
- Retired
- Posts: 630
- Joined: Wed Nov 07, 2012 7:36 pm
- Location: Florida
Re: New LUA AI Functions
I know I did the same thing to a spells function also related to casting speed so just fixed that.
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: New LUA AI Functions
Hmm, still erroring on linux compile. Same error.
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: New LUA AI Functions
What the hell is this? LOL
I think my own Brain just exploded.
Code: Select all
return 100 * max((float) 0.5, (float) 1 + (1 - (1 / (1 + (cast_speed * .01)))));- thefoof
- Retired
- Posts: 630
- Joined: Wed Nov 07, 2012 7:36 pm
- Location: Florida
Re: New LUA AI Functions
LOL it returns the percentage of the amount casting speed will mod somebody (capped at 50%)
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: New LUA AI Functions
Sorry was in a hurry to commit the fix forgot to add the ( ) around the equationJohn Adams wrote:Hmm, still erroring on linux compile. Same error.
If you want the maximum to be 50% (0.5) you should use min() not max(), max will take the higher value of the two numbers so if you have 0.5 and 0.75 it will return 0.75 giving you a 75% boostthefoof wrote:LOL it returns the percentage of the amount casting speed will mod somebody (capped at 50%)
Proper fix is on Dev SVN
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: New LUA AI Functions
Reading the code again I think I miss read it, the return value will be multiplied against the base cast time, if that is the case you have it correct sorry for the confusionJabantiz wrote:If you want the maximum to be 50% (0.5) you should use min() not max(), max will take the higher value of the two numbers so if you have 0.5 and 0.75 it will return 0.75 giving you a 75% boostthefoof wrote:LOL it returns the percentage of the amount casting speed will mod somebody (capped at 50%)
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: New LUA AI Functions
Not to derail the AI thread
but it would be nice if complex stuff like that were broken down into local vars that made more sense. Me looking at it, I have no idea what I'm looking at - though I am pretty good with math 
And... // comments! Jab, what are you teaching your apprentice?
And finally (again) I must ask, Rules! When at all possible, consider using Rules if you can imagine yourself as an Admin wanting to tweak an offset/modifier without having to recompile the code.
Other than that, the mind-numbingly complex return looks good!
And... // comments! Jab, what are you teaching your apprentice?
And finally (again) I must ask, Rules! When at all possible, consider using Rules if you can imagine yourself as an Admin wanting to tweak an offset/modifier without having to recompile the code.
Other than that, the mind-numbingly complex return looks good!
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: New LUA AI Functions
Looks like the other one needs to be fixed too.
Code: Select all
Spells.cpp: In member function ‘void Spell::ModifyCastTime(Entity*)’:
Spells.cpp:444: error: no matching function for call to ‘min(float, double)’-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: New LUA AI Functions
About to do a commit of my instance code, I can add the fix in there unless some one beats me to it
EDIT: Fix is on Dev SVN
EDIT: Fix is on Dev SVN
Who is online
Users browsing this forum: No registered users and 0 guests