One day, Doc went coding...
Discuss Upcoming Releases, Coding New Cards, Etc.
PLEASE DO NOT REPORT BUGS HERE!
PLEASE DO NOT REPORT BUGS HERE!
Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins
Re: One day, Doc went coding...
by jatill » 04 Jul 2010, 15:10
Use CardEditorLimited, it's in there. Knowing when the error is reserved information for me just comes from experience. I spent hours scratching my head with Blinding Angel before I figured out that was my problem.DrLambda wrote:Where do i get the proper reserved information for this? The Blinding Angel code is there, but Blinding Angel isn't in the current version as far as i can see. Also, how can i find out if the problem is the reserved information?
Yeah, that's the sad part about making complete sets. At least you gained the experienceDrLambda wrote:Also it's interesting to note how i actually spent like 4-5 hours now on a card that probably noone will play (Well, it's better than Archangel though.)
Apps by jatill: http://www.slightlymagic.net/wiki/Other_Apps_by_jatill
Re: One day, Doc went coding...
by DrLambda » 04 Jul 2010, 21:06
Hey, Safe Passage actually was quite easy to do.
I'm back at the Angelic Arbiter but i still run into problems every few minutes. I changed the reserved information. Now, stopping the attack works... but increasing the cost actually won't. It's demotivating, especially because i know the code worked yesterday. I'm close to conceding to this card.
Let me show you the code i got there.
Angelic Arbiter (Code actually there, doesn't work)
Vengeful Archon (I didn't try to do it until now)
I'm back at the Angelic Arbiter but i still run into problems every few minutes. I changed the reserved information. Now, stopping the attack works... but increasing the cost actually won't. It's demotivating, especially because i know the code worked yesterday. I'm close to conceding to this card.
Let me show you the code i got there.
- Code: Select all
int card_angelic_arbiter(int player, int card, event_t event)
{
card_instance_t *instance = get_card_instance(player, card);
//RESETTING AT THE UPKEEP
if( current_turn == player && upkeep_trigger(player, card, event) )
{
instance->info_slot = 0x05;
}
//INCREASING THE COST IF OPPONENT ATTACKED THIS TURN
else if( event == EVENT_MODIFY_COST_GLOBAL && affected_card_controller == 1-player )
{
card_instance_t *instance2 = get_card_instance( affected_card_controller, affected_card);
int type = cards_data[ instance2->internal_card_id ].type;
if( ! ( type & TYPE_LAND ) && instance->info_slot == 0x06)
{
COST_COLORLESS+=49;
}
}
//CHECK IF OPPONENT IS ATTACKING
else if( event == EVENT_DECLARE_ATTACKERS && current_turn == 1-player)
{
instance->info_slot = 0x06;
}
//CHECK IF OPPONENT IS CASTING A SPELL
else if(trigger_condition == TRIGGER_SPELL_CAST && player == affected_card_controller && player ==
reason_for_trigger_controller && player != trigger_cause_controller && card == affected_card )
{
card_instance_t *instance3 = get_card_instance(trigger_cause_controller, trigger_cause);
if( ! ( cards_data[ instance3->internal_card_id].type & TYPE_LAND ) )
{
if(event == EVENT_TRIGGER)
{
event_result |= RESOLVE_TRIGGER_MANDATORY;
}
else if(event == EVENT_RESOLVE_TRIGGER)
{
instance->info_slot = 0x07;
}
}
}
//MAKING IT IMPOSSIBLE TO ATTACK IF SPELL WAS PLAYED THIS TURN
else if( event == EVENT_ATTACK_LEGALITY && player != current_turn && instance->info_slot == 0x07 )
{
event_result = 1;
}
return 0;
}
Angelic Arbiter (Code actually there, doesn't work)
Vengeful Archon (I didn't try to do it until now)
- DrLambda
- Posts: 49
- Joined: 09 Jul 2008, 00:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: One day, Doc went coding...
by jatill » 04 Jul 2010, 21:31
Any reason you're using weird hex number (ex: 0x07) instead of just 7?
So prepare to pull some hair out... the cost increase part of the card is also linked to the reserved information. So to get both halves of this card working, you need a combination of reserved informations.
Blinding Angel:
000004FF0F100003000000
Stonybrook Banneret:
000040FF01010002000000
I would try "or"ing them together and see if it works:
000044FF0F111003000000
Another tip: when you use upkeep_trigger, the game will show this card doing work during the upkeep, which is annoying and requires a click by the user. Just do phase = upkeep to avoid the click.
Vengeful Arrchon should hopefully be straightforward based safe passage.
So prepare to pull some hair out... the cost increase part of the card is also linked to the reserved information. So to get both halves of this card working, you need a combination of reserved informations.
Blinding Angel:
000004FF0F100003000000
Stonybrook Banneret:
000040FF01010002000000
I would try "or"ing them together and see if it works:
000044FF0F111003000000
Another tip: when you use upkeep_trigger, the game will show this card doing work during the upkeep, which is annoying and requires a click by the user. Just do phase = upkeep to avoid the click.
Vengeful Arrchon should hopefully be straightforward based safe passage.
Apps by jatill: http://www.slightlymagic.net/wiki/Other_Apps_by_jatill
Re: One day, Doc went coding...
by DrLambda » 04 Jul 2010, 21:55
It works! Yay!
I actually thought about "or"ing them, but because i have no idea of reserved information, i thought it would actually break something.
I used the hex numbers because i broke something while coding this card and couldn't find the error, so this was one of the things i tried and forgot to change it back
Thanks a lot again. You're really a big help at getting started at this.
I actually thought about "or"ing them, but because i have no idea of reserved information, i thought it would actually break something.
I used the hex numbers because i broke something while coding this card and couldn't find the error, so this was one of the things i tried and forgot to change it back
Thanks a lot again. You're really a big help at getting started at this.
- DrLambda
- Posts: 49
- Joined: 09 Jul 2008, 00:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: One day, Doc went coding...
by jatill » 06 Jul 2010, 12:16
Thanks, I do my best Looks like the entire spoiler is out now. Would you like to go through it and pick some card that look too difficult / time consuming, and I'll code those?DrLambda wrote:Thanks a lot again. You're really a big help at getting started at this.
Looking at the list, I think the following cards are impossible, and/or can only be approximated:
Approximations:
Stormtide Leviathan
Captivating Vampire
Rise from the Grave
Combust
Incite
Gaea's Revenge
Sacred Wolf
Palace Guard
Alluring Siren
Frost Titan
Ice Cage
Impossible:
Redirect
Leyline of Punishment
Autumn's Veil
Leyline of Sanctity
Leyline of Anticipation
I am currently working on:
Conundrum Sphinx
Ice Cage
Phantom Beast
Stormtide Leviathan
Apps by jatill: http://www.slightlymagic.net/wiki/Other_Apps_by_jatill
Re: One day, Doc went coding...
by aww1979 » 06 Jul 2010, 23:46
For Palace Guard, is it possible to tweak Avatar of Hope, since we already have that one, and palace guard is actually simpler? :p
Re: One day, Doc went coding...
by DrLambda » 07 Jul 2010, 08:44
I think the problem is that we don't have the code for the Avatar, and simply calling the function would include the cost-reducing effect. But what do i know?
I'll do the white cards first. I guess they shouldn't be too hard once i find out why Vengeful Archon prevents the damage just fine but doesn't shoot back. Also, while i believe you that the white Leyline is impossible, i'll still try
Harder cards (just by looking at the list, may be easy though):
Mass Polymorph
Necrotic Plague
Phylactery Lich
Reassembling Skeleton (Yeah, it probably wasn't a good idea to try this as my 3rd card ever I still have no idea how to take control of the rules engine card to activate abilities out of a graveyard (triggers work fine))
Wild Evocation
Obstinate Baloth (you already completed it, right?)
I guess thats it.
I still have a question about the distribution. To get it into your (jatill's) release, should i send you the .exe/.csv/.dat or the .c files or both? What else do you need to put it into My2000?
*Edit: Just checked, i'm working on the following cards in white.
Celestial Purge
Infantry Veteran
Inspired Charge
Leyline of Sanctity (?)
Palace Guard
Roc Egg
Silence
Vengeful Archon
I'll do the white cards first. I guess they shouldn't be too hard once i find out why Vengeful Archon prevents the damage just fine but doesn't shoot back. Also, while i believe you that the white Leyline is impossible, i'll still try
Harder cards (just by looking at the list, may be easy though):
Mass Polymorph
Necrotic Plague
Phylactery Lich
Reassembling Skeleton (Yeah, it probably wasn't a good idea to try this as my 3rd card ever I still have no idea how to take control of the rules engine card to activate abilities out of a graveyard (triggers work fine))
Wild Evocation
Obstinate Baloth (you already completed it, right?)
I guess thats it.
I still have a question about the distribution. To get it into your (jatill's) release, should i send you the .exe/.csv/.dat or the .c files or both? What else do you need to put it into My2000?
*Edit: Just checked, i'm working on the following cards in white.
Celestial Purge
Infantry Veteran
Inspired Charge
Leyline of Sanctity (?)
Palace Guard
Roc Egg
Silence
Vengeful Archon
- DrLambda
- Posts: 49
- Joined: 09 Jul 2008, 00:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: One day, Doc went coding...
by jatill » 07 Jul 2010, 12:03
Put the cards into you regular version, replacing whatever is convenient (even good cards). Then use deply.bat to make the zip file.
When we're both done, I'll accept the chore of merging everything together.
Good call on Palace Guard. You can just use the same code pointer, but do not cc[2] to 1. Voila, done.
Re Leyline, I had an idea. I can't make you an illegal target, but I can fizzle any spells that target you, I think. I haven't tested yet, but I'm going to try it later today for Gaea's Revenge.
Edit: Gaea's Revenge works about as expected, so that's good. I coded a few more cards:
Reassembling Skeleton
Awakener Druid
Necrotic Plague
Mass Polymorph
Wild Evocation
Obstinate Baloth
Phylactery Lich
If you want to peek at the code, here it is: http://www.mediafire.com/file/mzydlm24lmy/20100707.zip
Some code for the skeleton appears in game_startup.c. Don't accidentally clobber your files, though
When we're both done, I'll accept the chore of merging everything together.
Good call on Palace Guard. You can just use the same code pointer, but do not cc[2] to 1. Voila, done.
Re Leyline, I had an idea. I can't make you an illegal target, but I can fizzle any spells that target you, I think. I haven't tested yet, but I'm going to try it later today for Gaea's Revenge.
Edit: Gaea's Revenge works about as expected, so that's good. I coded a few more cards:
Reassembling Skeleton
Awakener Druid
Necrotic Plague
Mass Polymorph
Wild Evocation
Obstinate Baloth
Phylactery Lich
If you want to peek at the code, here it is: http://www.mediafire.com/file/mzydlm24lmy/20100707.zip
Some code for the skeleton appears in game_startup.c. Don't accidentally clobber your files, though
Apps by jatill: http://www.slightlymagic.net/wiki/Other_Apps_by_jatill
Re: One day, Doc went coding...
by DrLambda » 07 Jul 2010, 22:37
White cards should now be complete (Without Leyline).
I'll now do the black cards. There aren't that many left:
Requiring code (Even if trivial)
Blood Tithe
Bloodthrone Vampire
Captivating Vampire
Child of Night
Deathmark
Demon of Death's Gate
Doom Blade
Howling Banshee
Liliana's Caress
Nightwing Shade
Quag Sickness
Rise from the Grave
Rotting Legion
Stabbing Pain
Change to CSV and .EXE only
Barony Vampire
Bog Raiders
Nether Horror
I'll now do the black cards. There aren't that many left:
Requiring code (Even if trivial)
Blood Tithe
Bloodthrone Vampire
Captivating Vampire
Child of Night
Deathmark
Demon of Death's Gate
Doom Blade
Howling Banshee
Liliana's Caress
Nightwing Shade
Quag Sickness
Rise from the Grave
Rotting Legion
Stabbing Pain
Change to CSV and .EXE only
Barony Vampire
Bog Raiders
Nether Horror
- DrLambda
- Posts: 49
- Joined: 09 Jul 2008, 00:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: One day, Doc went coding...
by jatill » 08 Jul 2010, 12:09
Child of Night doesn't require coding (Knights of Meadowgrain). Disentomb requires a csv change too.
By my count, here are the cards already in manalink. 71 in all, not a bad count. Probably about half of the remaining cards either require no code of fewer than 10 lines.
Ajani Goldmane
Baneslayer Angel
Day of Judgment
Elite Vanguard
Holy Strength
Honor of the Pure
Pacifism
Serra Angel
White Knight
Wild Griffin
Assassinate
Black Knight
Corrupt
Diabolic Tutor
Duress
Gravedigger
Haunting Echoes
Leyline of the Void
Liliana Vess
Mind Rot
Nantuko Shade
Relentless Rats
Royal Assassin
Sign in Blood
Unholy Strength
Azure Drake
Cancel
Clone
Jace Beleren
Mana Leak
Merfolk Sovereign
Negate
Tome Scour
Traumatize
Unsummon
Chandra Nalaar
Demolish
Fireball
Goblin Balloon Brigade
Goblin Chieftan
Goblin Tunneler
Lava Axe
Ligntning Bolt
Prodigal Pyromancer
Pyroclasm
Acidic Slime
Birds of Paradise
Elvish Archdruid
Fog
Garruk Wildspeaker
Giant Growth
Giant Spider
Llanowar Elves
Naturalize
Spined Wurm
Angel's Feather
Demon's Horn
Dragon's Claw
Juggernaut
Kraken's Eye
Ornithopter
Platinum Angel
Triskelion
Voltaic Key
Wurm's Tooth
Dragonskull Summit
Drowned Catacombs
Glacial Fortress
Rootbound Crag
Sunpetal Grove
Terramorphic Expanse
By my count, here are the cards already in manalink. 71 in all, not a bad count. Probably about half of the remaining cards either require no code of fewer than 10 lines.
Ajani Goldmane
Baneslayer Angel
Day of Judgment
Elite Vanguard
Holy Strength
Honor of the Pure
Pacifism
Serra Angel
White Knight
Wild Griffin
Assassinate
Black Knight
Corrupt
Diabolic Tutor
Duress
Gravedigger
Haunting Echoes
Leyline of the Void
Liliana Vess
Mind Rot
Nantuko Shade
Relentless Rats
Royal Assassin
Sign in Blood
Unholy Strength
Azure Drake
Cancel
Clone
Jace Beleren
Mana Leak
Merfolk Sovereign
Negate
Tome Scour
Traumatize
Unsummon
Chandra Nalaar
Demolish
Fireball
Goblin Balloon Brigade
Goblin Chieftan
Goblin Tunneler
Lava Axe
Ligntning Bolt
Prodigal Pyromancer
Pyroclasm
Acidic Slime
Birds of Paradise
Elvish Archdruid
Fog
Garruk Wildspeaker
Giant Growth
Giant Spider
Llanowar Elves
Naturalize
Spined Wurm
Angel's Feather
Demon's Horn
Dragon's Claw
Juggernaut
Kraken's Eye
Ornithopter
Platinum Angel
Triskelion
Voltaic Key
Wurm's Tooth
Dragonskull Summit
Drowned Catacombs
Glacial Fortress
Rootbound Crag
Sunpetal Grove
Terramorphic Expanse
Apps by jatill: http://www.slightlymagic.net/wiki/Other_Apps_by_jatill
25 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 25 guests