It is currently 26 Apr 2024, 23:29
   
Text Size

Upkeep time manager (in case someone needs it)

Moderator: CCGHQ Admins

Upkeep time manager (in case someone needs it)

Postby thefiremind » 07 Aug 2013, 09:55

This is how far I got for making an invisible token that gives players a time window during the upkeep only if they actually need to do something. I abandoned the project after finding that I couldn't code forecast (it makes the game freeze), but the starting point is good and I think it should work well for other upkeep things as well.

The ZIP includes the invisible token and a LOL file. Inside the LOL file there's a comment where you can find the code that needs to be added to the cards needing upkeep time. You also need to declare the card name with some optional entries. I left Pride of the Clouds inside as an example: activated means that the ability is an activated one (it will be most of the times, Braid of Fire is one of the few that doesn't need this); untapped means that the activated ability has a tap cost so you won't be asked if the card is tapped; mana is the mana cost of the ability so you won't be asked if you can't afford it (you can avoid using this entry if you plan to use manual mana).

If you find something wrong or need more information, answer this topic.

If you want to extend/enhance the idea by yourself, feel free to do that.

EDIT: Now supporting Pride of the Clouds, Braid of Fire, Magus of the Mirror, Mirror Universe.
Attachments
_UPKEEP_TIME_MANAGER_991800001.zip
(2.69 KiB) Downloaded 293 times
Last edited by thefiremind on 03 Oct 2013, 11:13, edited 2 times in total.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Re: Upkeep time manager (in case someone needs it)

Postby mr friendly guy » 11 Sep 2013, 12:45

This is a silly question, but since I am new to this, how do we use the files? I put the LOL and XML file into my folders and created a new WAD. Is that how its supposed to work? It doesn't seem work and I get this message on the script log.

[lua] [string "Content\Functions\UTM_UPKEEP_TIME_MANAGER.LOL"]:31: attempt to index global 'entry' (a nil value)
[lua] [string "Content\Functions\UTM_UPKEEP_TIME_MANAGER.LOL"]:31: attempt to index global 'entry' (a nil value)
[lua] [string "Content\Functions\UTM_UPKEEP_TIME_MANAGER.LOL"]:31: attempt to index global 'entry' (a nil value)
This is when I was testing mirror universe and magus of the mirror.
mr friendly guy
 
Posts: 85
Joined: 23 Aug 2013, 12:03
Has thanked: 2 times
Been thanked: 1 time

Re: Upkeep time manager (in case someone needs it)

Postby thefiremind » 11 Sep 2013, 14:05

You did nothing wrong, there was a problem in my function. It should be fixed now.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Re: Upkeep time manager (in case someone needs it)

Postby mr friendly guy » 11 Sep 2013, 15:34

Testing it. It works well but I notice a few things.

1.It no longer gives me the option of playing things during my upkeep if I use Leyline of Deity's extra turn function. Presumably this might interact with cards like Timewalk etc. Not only do I lose the option of playing it on that extra turn, it seems I lose the "play on upkeep" option altogether, until I restart DoTP 2014 and not just restart the match I am in.

This isn't going to be a problem since I don't play to play these cards in a blue deck, but might be interested to figure out what's going on.

2. Maybe the rules of Magic have changed since I last played it, but my understanding of it is that if my life is reduced to zero, I have until the end of phase to get it up, ie I don't lose automatically on reaching life zero, I lose if I have zero life at the end of the phase.

What I tried to do was use necropotence to draw my life down to zero, then use mirror universe or magus of the mirror to swap life with my opponent. Unfortunately I died on zero life even though the upkeep isn't finish (I assume this is because DoTP doesn't actually have provisions for an upkeep phase per se). So I can only do the swap life trick when I am on 1 life and attack with a creature to finish him off.

Otherwise this works well for what I have in mind. Thanks a million.
mr friendly guy
 
Posts: 85
Joined: 23 Aug 2013, 12:03
Has thanked: 2 times
Been thanked: 1 time

Re: Upkeep time manager (in case someone needs it)

Postby thefiremind » 11 Sep 2013, 16:13

mr friendly guy wrote:1.It no longer gives me the option of playing things during my upkeep if I use Leyline of Deity's extra turn function. Presumably this might interact with cards like Timewalk etc. Not only do I lose the option of playing it on that extra turn, it seems I lose the "play on upkeep" option altogether, until I restart DoTP 2014 and not just restart the match I am in.

This isn't going to be a problem since I don't play to play these cards in a blue deck, but might be interested to figure out what's going on.
This is strange, I'll try to understand why.

mr friendly guy wrote:2. Maybe the rules of Magic have changed since I last played it, but my understanding of it is that if my life is reduced to zero, I have until the end of phase to get it up, ie I don't lose automatically on reaching life zero, I lose if I have zero life at the end of the phase.
Now that you mention it, I remember the old Shandalar game working like that, but the rules have changed since then (not sure exactly when), and you lose as soon as state-based effects are checked (which makes more sense to me, since creatures with 0 toughness or lethal damage on them die the same way).
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Re: Upkeep time manager (in case someone needs it)

Postby mr friendly guy » 12 Sep 2013, 11:17

Edit - I am officially puzzled now. Sometimes the upkeep time manager gives me the option, sometimes it doesn't.

I tried to see if its because I do different things, and now it doesn't appear to be if I take an extra turn, or any of the other of leyline's abilities.

It just sometimes seem to lose this ability to keep time after a while, but I have no idea if its because I did something else and I just can't remember what I did.
Last edited by mr friendly guy on 12 Sep 2013, 12:08, edited 1 time in total.
mr friendly guy
 
Posts: 85
Joined: 23 Aug 2013, 12:03
Has thanked: 2 times
Been thanked: 1 time

Re: Upkeep time manager (in case someone needs it)

Postby thefiremind » 12 Sep 2013, 11:47

mr friendly guy wrote:It might not necessarily be when I use the extra turn mode.

I just notice it seemed to not work after I use demonic tutor. It could be because the ability to search for cards interfere with the upkeep ability.
This makes me think that Demonic Tutor isn't the cause, either... which cards do you use during your tests?
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Re: Upkeep time manager (in case someone needs it)

Postby mr friendly guy » 12 Sep 2013, 12:30

My test deck consists

This is the complete card listing for the deck:
2x - Black Knight (BLACK_KNIGHT_369530)
3x - Consume Spirit (CONSUME_SPIRIT_357762)
2x - Damnation (DAMNATION_888276893)
4x - Dark Ritual (DARK_RITUAL_972221510)
2x - Demonic Tutor (DEMONIC_TUTOR_628487)
3x - Divinity of Pride (DIVINITY_OF_PRIDE_199288737)
4x - Hymn to Tourach (HYMN_TO_TOURACH_628449)
4x - Hypnotic Specter (HYPNOTIC_SPECTER_345373)
2x - Magus of the Mirror (MAGUS_OF_THE_MIRROR_126278)
4x - Necropotence (NECROPOTENCE_628040)
2x - Nevinyrral’s Disk (NEVINYRRALS_DISK_888003803)
4x - Order of the Ebon Hand (ORDER_OF_THE_EBON_HAND_159193)

After playing around and deliberately trialling combinations, it seems to work when I tested each other interaction, eg taking extra turns, searching the library etc. I even tried clicking no when they ask me if I want the extra upkeep time, but it doesn't stop them asking for it the next time. I have no idea why sometimes it stopped working (hasn't so far since I deleted the deck and recreated it), and it was most probably recall bias which made me blame the extra turns or demonic tutors.

Edit - it seemed to have happened again when playing Zorislav. I am not sure its because he cloned my magus of the mirror, or because I had already used necropotence (does necro's cost of skipping the draw step interfere with the upkeep token?).
mr friendly guy
 
Posts: 85
Joined: 23 Aug 2013, 12:03
Has thanked: 2 times
Been thanked: 1 time


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 27 guests


Who is online

In total there are 27 users online :: 0 registered, 0 hidden and 27 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 27 guests

Login Form