Results 1 to 10 of 11
-
01-06-2011, 06:53 AM #1
- Join Date
- Apr 2008
- Location
- Where the moon cuts the wind.
- Posts
- 259
- Downloads
- 4
- Uploads
- 0
Action System - Database additions - Table/column list
To work, the action system requires set of tables to hold how they are to be handled. You can't hard code this, because in my system actions can be created by the DM's or players and used in other campaigns & games.
Read Part 2 in this thread for explanation of the fields
TABLE: actionTable
id
name
//These 3 are links to other tables
CostPlanID
TargetTypeID
FlatCostID
//These 2 are how we determine max targets available to whoever does action
Target#Ratio
Target#Determiner
//Required logic flow entry
RequiresAtLocation
//These 4 might not be needed
RequiresHoldingType
RequiresHoldingLevel
RequiresProvinceType
RequiresProvinceLevel
// These 2 need to be a cross link, but i'm too tired as more than one class can cast priest spells or do other actions
RequiredClass
RequiredClassLevel
TABLE: CostPlan
id
name
TABLE: TargetType
id
value
TABLE: Target#Determiner
id
value
TABLE: Ratio
id
quotient
divisorLast edited by Mirviriam; 01-06-2011 at 08:07 AM.
Legacy of Kings: Member
-
01-06-2011, 06:55 AM #2
- Join Date
- Apr 2008
- Location
- Where the moon cuts the wind.
- Posts
- 259
- Downloads
- 4
- Uploads
- 0
Part 2
This is an example of some filled in values in the fields:
CostName
id value
1 flat
2 ratio
3 initialWithRatio
4 perTargetPerDistance
TargetType
id value
1 domain
2 province
3 holding
4 person
5 unit
6 ship //(technically they can be marked as unit too so this might be redundant)
Target#Determiner
id value
1 single
2 characterlvl
3 holdinglvl
4 provincelvl
5 classlvl
6 characterage
7 skillLvl
8 linkedLvl //(source links & trade routes)
ratioTable
id quotient divisor
1 20 1
2 19 2
3 18 3
... ... ...
21 1 1
22 1 2 // We skip 0 : anything as pointless
23 1 3
... ... ...
33 1 20 // at this point we put in the non sequenced fractions
34 5 3
35 3 2
36 4 3Last edited by Mirviriam; 01-06-2011 at 07:25 AM.
Legacy of Kings: Member
-
01-06-2011, 06:55 AM #3
- Join Date
- Apr 2008
- Location
- Where the moon cuts the wind.
- Posts
- 259
- Downloads
- 4
- Uploads
- 0
Part 3 - Page summary
I lost summary in a misclick...grr, not going to go into details when it's obvious the purpose in next section
Page one lists actions & the person to do the actions in drop down
Page two shows all the targets
Page three allows rp bidding to increase successLast edited by Mirviriam; 01-06-2011 at 08:06 AM.
Legacy of Kings: Member
-
01-06-2011, 07:07 AM #4
- Join Date
- Apr 2008
- Location
- Where the moon cuts the wind.
- Posts
- 259
- Downloads
- 4
- Uploads
- 0
Page 4 - Flow chart
Ok, so I had envisioned using table to show the flow chart ... instead I'm going to just use keywords "goto: some label" like we're programing in basic. I'll actually hold off on that one till you guys confirm you've done basic too. I'll just write semi-pseudo code out.
Create a webpage: 1stPage.display.php
Query1: ActionList's name & id table
Query2: domain table for domain_id(already held in session var) joining with character table's char_name & char_id (which in my db holds all liutenants and regents)
Show user an html select drop down menu listing ActionList's Name
Show user an html select drop down menu listing all characters
Submit button is hit, calling 1stPage.commit.php
Check first select actually was set
Check second select actually was set
Query4: All of table ActionList joining CostPlan, TargetType, Target#Determiner, Ratio
Query5 on Target#Determiner query proper table (select statement, ignore details)
Check second var (character) is right class for action
Check is variable T#Determiner_ID greater than 1? (assume yes for now)
Compute: Target#Determiner along with Query5 max number of targets the guy running action can affect
Check Query4's result for RequiredAtLoc
if no set flag to query6 all targets(based on targetType from query4) in which domain has a holding, ownership of the province or a regent/lieutenant present.
if yes set flag to query6 all targets in province where the regent/lieutenant doing the action is located.
Query6: based on flag load list of all targets in to a multiselect form and display it to users
Submit button is hit, calling 2ndPage.display.php
Display all the targets available in multiselect
Submit button is hit, calling 3rdPage.display.php
Display each target's name, domain they belong too & a drop down menu counting upto 100 (use a constant so it's easy to enlarge) so the players can bid regency to increase their chances.
Submit button is hit, calling 3rdPage.commit.php
Check that player can afford the action + bidding of all the extra rp
If yes, create entry in the current domain (listed in session var already) table for pending actions.Last edited by Mirviriam; 01-06-2011 at 08:04 AM.
Legacy of Kings: Member
-
01-06-2011, 08:12 AM #5
- Join Date
- Apr 2008
- Location
- Where the moon cuts the wind.
- Posts
- 259
- Downloads
- 4
- Uploads
- 0
Part 5 - Interupter
To make this work in another person's database, we're going to need to have a cross link table listing the id number & the stringname of the table to run the queries against.
Possibly the user/pass/sql server if you don't use standard inherited password file as done in the wrox & o'reily books.
With that in place, this action system can hold entries for 2nd, 3rd & 4th addition with minimal fuss.
I know I used 2nd/3rd edition names for certain things, but without my visual aids, it's way too hard to explain this in perfectly generic terms.
Plus I'm really tired & spent past hour clarifying my notes.Legacy of Kings: Member
-
01-06-2011, 08:16 AM #6
- Join Date
- Apr 2008
- Location
- Where the moon cuts the wind.
- Posts
- 259
- Downloads
- 4
- Uploads
- 0
Caveat
I have another month or two of work on megameknet project, but I can turn out the code for this one relatively easily.
Legacy of Kings: Member
-
01-06-2011, 11:03 AM #7
the rp bidding is handle live or per time the user is logged (i am looking at something that can be use live or really small delay)
In your actions, can your regent make an action in a province in which they have no presence ?
PS i just read what you wrote, i will need to read it a few times to make sure I understand it fully. It seems a good idea, have you tried the speed of a process like that (curious). I will write back it's too early for me now !
-
01-06-2011, 11:12 AM #8
That's why i use vector maps, it is easy to know what you cross from point a to b and shadow world is just math (and problems).
But you are right with player and imagination it can go really far ...
-
01-07-2011, 10:42 AM #9
- Join Date
- Apr 2008
- Location
- Where the moon cuts the wind.
- Posts
- 259
- Downloads
- 4
- Uploads
- 0
Vicente,
Would you copy your replies & put them in a different topic in the Legacy of Kings forum? Then please delete them from this thread?
This topic is not to debate theory. It is only to change the specifics of a piece of pseudo code.
I welcome all of your input, just not where it will clutter up the technical nature of what we are doing in this specific thread. One of my main concerns is being flexible & I share your worries of making every single player of birthright happy.Legacy of Kings: Member
-
01-07-2011, 10:46 AM #10
- Join Date
- Apr 2008
- Location
- Where the moon cuts the wind.
- Posts
- 259
- Downloads
- 4
- Uploads
- 0
Dyark, I had to put the page calls in so it made sense.
As I envision it - this will be a set of functions that can be held in an object. The object will reference the sql database for it's parameters. What I am saying is that you can use it in a game where the turns only last a minute, a month, a year if you wanted. The part where it says, "commit action" could be live, happens as you want it or it could be stored in a table named Pending_Actions & happened when ever the DM decides.Legacy of Kings: Member
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Database problems
By Arjan in forum Birthright.net Official AnnouncementsReplies: 10Last Post: 05-19-2009, 02:02 PM -
Unique Additions to Your Birthright Campaign
By MatanThunder in forum The Royal LibraryReplies: 17Last Post: 09-25-2007, 03:16 PM -
Database errors?
By Salamander in forum Birthright.net supportReplies: 4Last Post: 12-29-2002, 03:00 AM
Bookmarks