FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CODE: Expansion limitations on arenas

 
Post new topic   Reply to topic    Drop Shock Forum Index -> Open Source
View previous topic :: View next topic  
Author Message
khaibar
Advanced


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Wed Dec 19, 2012 2:13 am    Post subject: CODE: Expansion limitations on arenas Reply with quote

Each mod/unit/building is tagged with it's expansion but i don't know the exact way to access that so i tried with this

files:
deploy_arena.php
process_deploy_arena.php
process_deploy.php


deploy_arena.php on line 138, add a new table division in last row {may need to change width}
Code:
<td class='unittext' width='200' valign='top'>
   &nbsp;&nbsp;&nbsp;&nbsp;<span class='helptextb'>Construx Sets</span><br>
   <input type=checkbox onfocus='this.blur();' id='allowD' name='allowD' class='checkB' checked> <label for='allowD'>Allow Default</label><br>
   <input type=checkbox onfocus='this.blur();' id='allowBT' name='allowBT' class='checkB' checked> <label for='allowBT'>Allow Battle Tactics</label><br>
   <input type=checkbox onfocus='this.blur();' id='allowXP' name='allowXP' class='checkB' checked> <label for='allowXP'>Allow X-Project</label><br>
   <input type=checkbox onfocus='this.blur();' id='allowSW' name='allowSW' class='checkB' checked> <label for='allowSW'>Allow Shadow Wars</label><br>
   <input type=checkbox onfocus='this.blur();' id='allowCD' name='allowCD' class='checkB' checked> <label for='allowCD'>Allow Combat Drop</label><br>
</td>


process_deploy_arena.php on line 91
Code:
if ($_POST["allowD"] != "on") { $pText .= "\$pOpt['allowD'] = 'N';\n"; $pDesc .= "<span class='alerttext'>Default not allowed</span><br>"; } else { $pText .= "\$pOpt['allowD'] = 'Y';\n"; }
if ($_POST["allowBT"] != "on") { $pText .= "\$pOpt['allowBT'] = 'N';\n"; $pDesc .= "<span class='alerttext'>Battle Tactics not allowed</span><br>"; } else { $pText .= "\$pOpt['allowBT'] = 'Y';\n"; }
if ($_POST["allowXP"] != "on") { $pText .= "\$pOpt['allowXP'] = 'N';\n"; $pDesc .= "<span class='alerttext'>X-Project not allowed</span><br>"; } else { $pText .= "\$pOpt['allowXP'] = 'Y';\n"; }
if ($_POST["allowSW"] != "on") { $pText .= "\$pOpt['allowSW'] = 'N';\n"; $pDesc .= "<span class='alerttext'>Shadow Wars not allowed</span><br>"; } else { $pText .= "\$pOpt['allowSW'] = 'Y';\n"; }
if ($_POST["allowCD"] != "on") { $pText .= "\$pOpt['allowCD'] = 'N';\n"; $pDesc .= "<span class='alerttext'>Combat Drop not allowed</span><br>"; } else { $pText .= "\$pOpt['allowCD'] = 'Y';\n"; }


process_deploy.php

on line 627

Code:
if ( ($pOpt['allowD'] == 'N') AND ($allunits["UNITS"]["UNIT"][($unit["i_type_id"])]['EXPANSION']['VALUE'] == "Default") ) { $can_drop = "unitIll"; }
if ( ($pOpt['allowBT'] == 'N') AND ($allunits["UNITS"]["UNIT"][($unit["i_type_id"])]['EXPANSION']['VALUE'] == "Battle Tactics") ) { $can_drop = "unitIll"; }
if ( ($pOpt['allowXP'] == 'N') AND ($allunits["UNITS"]["UNIT"][($unit["i_type_id"])]['EXPANSION']['VALUE'] == "X-Project") ) { $can_drop = "unitIll"; }
if ( ($pOpt['allowSW'] == 'N') AND ($allunits["UNITS"]["UNIT"][($unit["i_type_id"])]['EXPANSION']['VALUE'] == "Shadow Wars") ) { $can_drop = "unitIll"; }
if ( ($pOpt['allowCD'] == 'N') AND ($allunits["UNITS"]["UNIT"][($unit["i_type_id"])]['EXPANSION']['VALUE'] == "Combat Drop") ) { $can_drop = "unitIll"; }


on line 788
Code:
if ( ($pOpt['allowD'] == 'N') AND ($allmods["MODS"]["MODS"][($mod["i_type_id"])]['EXPANSION']['VALUE'] == "Default") ) { $can_drop = "modIll"; }
if ( ($pOpt['allowBT'] == 'N') AND ($allmods["MODS"]["MODS"][($mod["i_type_id"])]['EXPANSION']['VALUE'] == "Battle Tactics") ) { $can_drop = "modIll"; }
if ( ($pOpt['allowXP'] == 'N') AND ($allmods["MODS"]["MODS"][($mod["i_type_id"])]['EXPANSION']['VALUE'] == "X-Project") ) { $can_drop = "modIll"; }
if ( ($pOpt['allowSW'] == 'N') AND ($allmods["MODS"]["MODS"][($mod["i_type_id"])]['EXPANSION']['VALUE'] == "Shadow Wars") ) { $can_drop = "modIll"; }
if ( ($pOpt['allowCD'] == 'N') AND ($allmods["MODS"]["MODS"][($mod["i_type_id"])]['EXPANSION']['VALUE'] == "Combat Drop") ) { $can_drop = "modIll"; }


on line 1909
Code:
if ( ($pOpt['allowD'] == 'N') AND ($allbuildings["BUILDINGS"]["BUILDINGS"][(substr($building, (1 + strpos($building, '@')) ))]['EXPANSION']['VALUE'] == "Default") ) { $can_drop = "bldIll"; }
if ( ($pOpt['allowBT'] == 'N') AND ($allbuildings["BUILDINGS"]["BUILDINGS"][(substr($building, (1 + strpos($building, '@')) ))]['EXPANSION']['VALUE'] == "Battle Tactics") ) { $can_drop = "bldIll"; }
if ( ($pOpt['allowXP'] == 'N') AND ($allbuildings["BUILDINGS"]["BUILDINGS"][(substr($building, (1 + strpos($building, '@')) ))]['EXPANSION']['VALUE'] == "X-Project") ) { $can_drop = "bldIll"; }
if ( ($pOpt['allowSW'] == 'N') AND ($allbuildings["BUILDINGS"]["BUILDINGS"][(substr($building, (1 + strpos($building, '@')) ))]['EXPANSION']['VALUE'] == "Shadow Wars") ) { $can_drop = "bldIll"; }
if ( ($pOpt['allowCD'] == 'N') AND ($allbuildings["BUILDINGS"]["BUILDINGS"][(substr($building, (1 + strpos($building, '@')) ))]['EXPANSION']['VALUE'] == "Combat Drop") ) { $can_drop = "bldIll"; }


note some lines may not be exact since adding something pushes everything down, but all of above are in the test for arena limits when it comes to complexity. $can_drop values may need to be changed and I am not sure if that's how to access the expansion variable but i guess it should be.

ticket link: https://sourceforge.net/p/dropshock/tickets/33/
Back to top
View user's profile Send private message
snorok14
Advanced


Joined: 22 Aug 2008
Posts: 870
Location: Leave me alone, your mom and I are busy.

PostPosted: Wed Dec 19, 2012 11:25 am    Post subject: Reply with quote

Love it.
_________________
_D'z Nutz
Back to top
View user's profile Send private message
maXDooom
Advanced


Joined: 07 Dec 2011
Posts: 757
Location: in perverted places

PostPosted: Wed Dec 19, 2012 2:43 pm    Post subject: Reply with quote

didnt read the code but looks good
_________________
Walterohdim wrote:

I would be so mad I would Tomo Rage, and probably lose my mod ship and council seat.

Walterohdim
Back to top
View user's profile Send private message
Vanoi
Site Admin


Joined: 25 Aug 2005
Posts: 1403
Location: Avoiding You (The Void)

PostPosted: Wed Dec 19, 2012 4:42 pm    Post subject: Reply with quote

Wouldn't it make more sense to just implement a system to filter certain mods/units and allow the player to sort out Construx Sets themselves...?

It'd be alot easier to code aswell...
_________________
The person who will go to great lengths to fight boredom...
Back to top
View user's profile Send private message Send e-mail MSN Messenger
corclaork
Council Member


Joined: 26 Aug 2008
Posts: 518
Location: The Mohawk Wasteland

PostPosted: Wed Dec 19, 2012 5:50 pm    Post subject: Reply with quote

thank you khai...

van the point it to make arenas easy to setup while also making it capable of being very specific. a little extra effort on the coding end can make the other end smoother and more efficient. hopfully both your idea and the expansion limitations will be options within arenas.

cor
_________________
"hit or be hit"

in game name : corclark
Back to top
View user's profile Send private message
Vanoi
Site Admin


Joined: 25 Aug 2005
Posts: 1403
Location: Avoiding You (The Void)

PostPosted: Wed Dec 19, 2012 6:18 pm    Post subject: Reply with quote

Corclaork, this is just basicly the same thing except it oversimplifies what could be a very flexible function
_________________
The person who will go to great lengths to fight boredom...
Back to top
View user's profile Send private message Send e-mail MSN Messenger
corclaork
Council Member


Joined: 26 Aug 2008
Posts: 518
Location: The Mohawk Wasteland

PostPosted: Wed Dec 19, 2012 7:22 pm    Post subject: Reply with quote

Vanoi wrote:
Corclaork, this is just basicly the same thing except it oversimplifies what could be a very flexible function


look im not saying your idea is bad.. infact its very good but for players who have been gone forever de selecting every single unit some they dont even know anytihng about would be a turn off for an arena. deselecting 42 units just to remove default expansion units would be tedious for most ppl. thats not even including mods. in my opinion expansion pack limitations is the better option.

cor
_________________
"hit or be hit"

in game name : corclark
Back to top
View user's profile Send private message
Dark Leth
Council Member


Joined: 05 Jul 2005
Posts: 1498

PostPosted: Wed Dec 19, 2012 10:08 pm    Post subject: Reply with quote

Why not just have a checklist for every mod/unit under an advanced option - and then within that list, one can select/deselect certain expansions (which would just trigger the checklist for those specific unit/mods)? Would give the depth Vanoi is suggesting without requiring more than a few clicks for expansion specific alterations.
Back to top
View user's profile Send private message
khaibar
Advanced


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Thu Dec 20, 2012 1:32 am    Post subject: Reply with quote

adding a checklist for every unit/mod/building and doing a select/deselect expansion option is possible but would require a lot of checks (equal to the number of mods,units and buildings in game) not to mention that when u start an arena... where would all those fit? a rework of that interface would be needed (design wise)
Back to top
View user's profile Send private message
Vanoi
Site Admin


Joined: 25 Aug 2005
Posts: 1403
Location: Avoiding You (The Void)

PostPosted: Thu Dec 20, 2012 8:39 am    Post subject: Reply with quote

Ahh Yes, you're using checkboxes... I was thinking textboxes Razz
_________________
The person who will go to great lengths to fight boredom...
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Dark Leth
Council Member


Joined: 05 Jul 2005
Posts: 1498

PostPosted: Thu Dec 20, 2012 9:10 am    Post subject: Reply with quote

khaibar wrote:
adding a checklist for every unit/mod/building and doing a select/deselect expansion option is possible but would require a lot of checks (equal to the number of mods,units and buildings in game) not to mention that when u start an arena... where would all those fit? a rework of that interface would be needed (design wise)


I think it makes more sense from a UI standpoint to do a redesign of an advanced deployment options and get the feature set right from day one.

Regarding the number, using some simple AJAX it is pretty easy to make those various lists collapsible as well - just like our unit views in storage.
Back to top
View user's profile Send private message
sirstephen
Hopeless Romantic


Joined: 01 Jun 2008
Posts: 181

PostPosted: Thu Dec 20, 2012 10:44 am    Post subject: Reply with quote

I agree with Leth, the more options the better, and having a quickselect for expansion set would also be fantastic.
Back to top
View user's profile Send private message AIM Address
khaibar
Advanced


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Tue Dec 25, 2012 3:32 am    Post subject: Reply with quote

I pushed the code as it is (only expansion)

Perhaps a way to merge both ideas is to add a textbox (like van said) that includes ids of banned units from arena?

until me/van does that can u please approve the expansion limitation because personally i think it's more than enough Cool

me/van will still do the banned units idea
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Drop Shock Forum Index -> Open Source All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group