You are not logged in.

Applications: [GameMaster: OPEN] | [Volunteer Testers: OPEN]


This forum will be permanently shut down on Friday 13.07.2018
Please copy or save all important information from old forum before they will be deactivated
We have moved to new board. https://forum.runesofmagic.gameforge.com/Come join us.

1,361

Sunday, December 28th 2014, 3:05am

Could you give an example of how to see which player is currently playing (I.E.: local = UnitIsUnit(player) --Use this to determine which foodbuff/pots to use.)

i think what u looking for is something like:

Source code

1
if UnitName("player") == "some_mage_character" then function_to_define_mage_food() else ... end

1,362

Sunday, December 28th 2014, 3:41am

Could you give an example of how to see which player is currently playing (I.E.: local = UnitIsUnit(player) --Use this to determine which foodbuff/pots to use.)

i think what u looking for is something like:

Source code

1
if UnitName("player") == "some_mage_character" then function_to_define_mage_food() else ... end


Thanks achilleas1. I'll give that a shot and tweak it to fit My needs.
SirMasterBlue
Areafiftyone GL
Your roving muse reporter
K60/R60
Artemis

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

1,363

Sunday, December 28th 2014, 10:51am

Well as far as I know, there isn't a simple way to check for a player being online.

However, to check the online status of friends in your firnds list, you could do something like this (note that this should not be done as part of a DIYCE skill line as it could take too much time).

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function IsBuddyOnline(friendName)
  local friendCnt = GetFriendCount("Friend")   -- Get the number of names in the friends list

  -- Go through the list and see if the given name is online
  for idx = 1, friendCnt do
    local name, groupID, online, eachOther, unmodifiable, top, killMeCount, revengeCount, relationType, relationLv = GetFriendInfo("Friend", idx)

    if name == friendName then    -- The given name passed in must match exactly, including case
      return online
    end
  end

  return false
end
2013... The year from hell....

1,364

Sunday, December 28th 2014, 2:16pm

i believe he needs to modify his script to use the proper food depending on which character he plays.

so if he plays on his melee character to use patt food and matt food if plays on his mage one.

1,365

Sunday, December 28th 2014, 4:37pm

i believe he needs to modify his script to use the proper food depending on which character he plays.

so if he plays on his melee character to use patt food and matt food if plays on his mage one.


To a certain degree...yes. I also share this PC with others that use DIYCE and have the same class combo, but, are different levels. That's why I need to do a player check so I can have the right food for the right player.

I've eaten a lot of bacon trying to figure this one out. As of right now I have to continually modify the DIYCE before I or anyone else plays on this PC.

*We have 2 PCs and 2 laptops that are all shared to play this game.*
SirMasterBlue
Areafiftyone GL
Your roving muse reporter
K60/R60
Artemis

This post has been edited 1 times, last edit by "SirMasterBlue" (Dec 28th 2014, 4:46pm) with the following reason: Clification


Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

1,366

Monday, December 29th 2014, 1:24am

Yeah, if you want the name of your own character then yes achilleas1's answer is correct. I'll chalk up my mistake to insufficent coffee early in the morning when I answered that (yes, I'm making excuses. Shut Up!).
2013... The year from hell....

1,367

Monday, December 29th 2014, 1:29am

Yeah, if you want the name of your own character then yes achilleas1's answer is correct. I'll chalk up my mistake to insufficent coffee early in the morning when I answered that (yes, I'm making excuses. Shut Up!).


No worries. I know what life is like before coffee. Sadly, I also am here to report that CheckDisarmament breaks in a party. :-(
SirMasterBlue
Areafiftyone GL
Your roving muse reporter
K60/R60
Artemis

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

1,368

Monday, December 29th 2014, 4:01pm

Odd. I don't see why it should break while in a party, so something else in the condition must be off. Again, I just wrote that off the cuff as a demonstration of using a function name as a use clause. It is really meant for more complex constructions than just a few variable checks.
2013... The year from hell....

1,369

Monday, December 29th 2014, 4:54pm

RE: CheckDisarmament

When I am in a party it completely skips CheckDisarmament. Maybe I will just set up a "party" mode and see if that works.
SirMasterBlue
Areafiftyone GL
Your roving muse reporter
K60/R60
Artemis

Marvengus

Beginner

Posts: 14

Location: Netherlands

Occupation: Mathematician, Scientist

Mood: Smile

  • Send private message

1,370

Monday, January 5th 2015, 1:50pm

Hi,

About half a year ago, the FuzzyDiyce thread was very active, and I was moving from DIYCE to FD. But then I also decided to quit playing. Now, after a half year break, I returned to the game, and I see the FD thread has become quite silent. The DIYCE thread seems a more alive. Any update on whether FD is still being developed?
Marvengo R/S/K (90/90/65)
Marvengus M/D/Wd (85/80/68 )
Playing on Isilitir (EU)
Guild Traumfaenger

RoMage

rustyx is lame rogue

Posts: 2,694

Location: web

Occupation: DB Admin

Mood: Unsure

  • Send private message

1,371

Monday, January 5th 2015, 2:07pm

Well as far as I know, there isn't a simple way to check for a player being online.


If you wonder if friend is online... just use ZZInfoBar, can be set to show only online friends as drop down list when you point to friend icon... right click to invite any of names in group, left click to whisper a friend... very useful IMHO.

It has the same setup for guild list.

1,372

Monday, January 5th 2015, 3:10pm

Hi,

About half a year ago, the FuzzyDiyce thread was very active, and I was moving from DIYCE to FD. But then I also decided to quit playing. Now, after a half year break, I returned to the game, and I see the FD thread has become quite silent. The DIYCE thread seems a more alive. Any update on whether FD is still being developed?
@Mavengus: I know that FD has two or three threads running. You might be better served to ask over on those threads and maybe spark up a discussion. Welcome back.

Well as far as I know, there isn't a simple way to check for a player being online.


If you wonder if friend is online... just use ZZInfoBar, can be set to show only online friends as drop down list when you point to friend icon... right click to invite any of names in group, left click to whisper a friend... very useful IMHO.

It has the same setup for guild list.
@RoMage: I have ZZBar and all of it's components. The original post that sparked Peryl's comment was about trying to add a playercheck to the DIYCE for the people that play in My house. We share a couple of PCs and laptops and are all at different levels but have similar classes.
SirMasterBlue
Areafiftyone GL
Your roving muse reporter
K60/R60
Artemis

RoMage

rustyx is lame rogue

Posts: 2,694

Location: web

Occupation: DB Admin

Mood: Unsure

  • Send private message

1,373

Monday, January 5th 2015, 3:46pm

@RoMage: I have ZZBar and all of it's components. The original post that sparked Peryl's comment was about trying to add a playercheck to the DIYCE for the people that play in My house. We share a couple of PCs and laptops and are all at different levels but have similar classes.


Sorry for misunderstanding...

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

1,374

Monday, January 5th 2015, 11:31pm

Due to all kinds of things happening in 2013, I pretty much gave up on FD (see my original FD dev thread for details). Frafall decided to pickup the project and did a couple of tweaks to the code with a few additions I had still kicking around and released it. You can find this in the FuzzyDIYCE combat scripts thread. No GUI on the thing though, frafall instead just uses the FuzzyScript stuff directly. So a little closer to actual DIYCE, but still a fairly powerfull system (Okay, I biased).

I haven't seen anything from frafall in a while though, so I don't know if he's still even playing RoM, let alone working on FD.
2013... The year from hell....

1,375

Monday, January 26th 2015, 2:09am

Still Using dyice 2.xx, and encountered a problem with the Timer system :

Timers start counting down, even if you didn't actually cast the skill. They start as soon as the skill/action is "supposed" to be used, but the timer can start regardless of whether it is successfully activated.

This results in certain skills being skipped (for example, you want to refresh a bleed, but the timer starts before the skill is used, causing the bleed to not be applied properly). This easily observed by having a timer based skill at the top of your rotation, and hitting your Diyce macro while out of range of the target -- you're out of range, but the timer starts regardless, skipping the skill.

Anyone have any suggestions on how to implement the timers better to avoid this problem?

I thought about hitching the "start timer" part based on the combat log -- only start the timer if the skill inficted damage. Haven't got around to trying to implement this yet.

p.s going to build a f.dyice script and see if it avoids this problem.

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

1,376

Monday, January 26th 2015, 12:30pm

FD will have the same issue.

The main problem is that all the game functions used in DIYCE and FD that start an action/skill/spell/item/whatever have no return value and so there is no convenient way to tell if the event actually triggered or not. So the best compromise was to simply start the timer after the action/skill/what-have-you is triggered.

If you can find a way to detect if the action was actually triggered by the server, then a modification of the code would be in order.
2013... The year from hell....

1,377

Monday, January 26th 2015, 3:23pm

I registered the frame built in diyce to the combatmeter event, and am currently manually filtering out all non-diyce triggered damage skills (such as auto attack, bleeds, and briar repel) -- when it finds damage inflicted by the player that aren't these skills, it records it as "timer_lastaction. Then modified MyCombat as follows:

Source code

1
2
3
4
5
6
7
8
   elseif (Skill[x].ignoretimer or GetDIYCETimerValue(Skill[x].timer) == 0) and CD(Skill[x].name) then 
				--if talktome then Msg("- "..Skill[x].name) end
				CastSpellByName(Skill[x].name)   
			  --  Msg("using "..Skill[x].name)
				if Skill[x].name == timer_lastaction then
					StartDIYCETimer(Skill[x].timer)
				end
				return true


Prevents premature timer activation, but still had some odd results while testing last night. Going to test/modify some more later today when I have time.

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

1,378

Tuesday, January 27th 2015, 12:05am

Not bad, I'm wondering if it would be better to work it backwards though. That is,set the timer_lastaction in MyCombat then when the event triggers, start the timer there. May need to turn timer_lastaction into a list of skills to check however.
2013... The year from hell....

1,379

Tuesday, January 27th 2015, 2:57am

Took your suggestion and swapped where the timer updates happen, seems to work much better. Timers only start when the skills are actually fired.

Haven't seen it work improperly yet, but breaking it could require more rigourous testing xD.

Thanks for suggestion peryl

p.s. g_lastaction is declared in both diyce.lua and customfunctions, and seems to work as a global variable despite being "local". Can you explain how/why this works? Had to implement 2 global variables to fix the timers(lastaction and something else to get the timername from mycombat into the combatevent handler)but it feels messy, and might be unnecessary to use globals if they can work like g_lastaction.

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

1,380

Tuesday, January 27th 2015, 3:18am

You'll note that g_lastaction, though declared in DIYCE.lua, is not actually used within the code (at least not the base code from the zip on the first post). Which effectively means that only the one in customfunctions is actually used.

You could prove this to yourself by adding something that prints g_lastaction in MyCombat as well as in KillSequence. They won't have the same value.

Edit
You can kind of turn globals into locals by assigning a local to a global variable. This is actually an optimization trick.

For example, lets say you have a global called TheGlobal.

You can then assign a local variable with:

Source code

1
local TheGlobal = TheGlobal

Though this seems cryptic, it works because the right hand side of the assignment is evalusted before Lua even figures out where to store the result. Therefore, TheGobal on the right is refering to global variable space (since it doesn't exist yet as a local), then Lua creates and assigns the resulting value.

A clearer way to write the above is to write it like this

Source code

1
local TheGlobal = _G.TheGlobal


Note that this trick doesn't really work with direct values such as numbers and to some extent strings, so if this is what you want, make the global a table instead then assign in that table (even if only a single entry table). Works wonders with functions including Lua own functions.
2013... The year from hell....

This post has been edited 2 times, last edit by "Peryl" (Jan 27th 2015, 3:31am) with the following reason: Added info on "local" globals