PDA

View Full Version : D20 Modern,Blood and Space (Ship NPC ) ext



Samarex
June 23rd, 2016, 02:55
Good Morning All,
Im a trying to delve into the world of lua programing. As of now I am pulling out what little hair I have left for 2 days trying to figure out why I am getting a error.

The Ext will ADD a forth NPC type (Ship) to the bottom of the NPC Sheet and give you the information for a Ship. (Blood and Space). I have that working the button is there and it opens a Ship Sheet (currently just a copy of Vehicle Sheet, but will change once the foundation is set. The problem is now no matter what type of npc I pick if I go the the Actions Tab and try to add a Spell List I get the following error
Script Error: [string "campaign/scripts/spell_class.lua"]:105: attempt to call field 'getValue' (a nil value)
(Code from File. Bold is line 105)

function toggleDetail()
if minisheet then
return;
end

local status = (activatedetail.getValue() == 1);

frame_levels.setVisible(status);
updateControl("availablelevel", status);
updateControl("availablelevel0", status);
updateControl("availablelevel1", status);
updateControl("availablelevel2", status);
updateControl("availablelevel3", status);
updateControl("availablelevel4", status);
updateControl("availablelevel5", status);
updateControl("availablelevel6", status);
updateControl("availablelevel7", status);
updateControl("availablelevel8", status);
updateControl("availablelevel9", status);

frame_stat.setVisible(status);
ability_label.setVisible(status);
updateControl("dcstat", status);

frame_dc.setVisible(status);
dc_label.setVisible(status);
updateControl("dcstatmod", status);
updateControl("dcmisc", status);
updateControl("dctotal", status);

frame_sp.setVisible(status);
spmain_label.setVisible(status);
updateControl("sp", status);

frame_cc.setVisible(status);
label_cc.setVisible(status);
updateControl("ccmisc", status);
end


Script Error: [string "campaign/scripts/npc.lua"]:95: attempt to call field 'setValue' (a nil value)
(Code from File. Bold is line 95)

function addSpellClass()
local w = spellclasslist.createWindow();
if w then
w.activatedetail.setValue(1);
w.label.setFocus();
DB.setValue(getDatabaseNode(), "spellmode", "string", "standard");
end
end


And from that point on if I Try and click the little magnify-glass button the spell_class error continues.

Follow is the few changes I made to files
Changes Made
(Record_npc.xml)


<subwindow_record name="main_vehicle">
<class>npc_combat_vehicle</class>
</subwindow_record>
<!-- Added-->
<subwindow_record name="main_ship">
<class>npc_combat_ship</class>
</subwindow_record>


<scrollbar_record>
<target>main_vehicle</target>
</scrollbar_record>
<!-- Added-->
<scrollbar_record>
<target>main_ship</target>
</scrollbar_record>
<!-- Added-->
<windowclass name="npc_combat_ship">
<margins control="0,0,0,2" />
<script file="campaign/scripts/npc_main.lua" />
<sheetdata>
<!-- This includes a copy of the whole npc_combat_vehicle windowclass (planned on changing after foundation was complete-->
</sheetdata>
</windowclass>

(template_campaign.xml)
<!-- In <template name="radio_record_npctype">, Edited parameters Adding the type "Ship" and width so it fit better on the sheet -->


<parameters>
<optionwidth>85</optionwidth>
<labelsres>npc_label_typecreature|npc_label_typetrap|npc_labe l_typevehicle|npc_label_typeship</labelsres>
<values>Creature|Trap|Vehicle|Ship</values>
</parameters>


(npc.lua)

function TypeChanged() <!--Added sType == "Ship"-->
local sType = DB.getValue(getDatabaseNode(), "npctype", "");
if sType == "Trap"
then tabs.setTab(1, "main_trap", "tab_main");
elseif sType == "Vehicle" or sType == "Ship"
then tabs.setTab(1, "main_vehicle", "tab_main");
else
tabs.setTab(1, "main_creature", "tab_main");
end
end
function StateChanged() <!-- Added main_ship subwindow-->
if header.subwindow then
header.subwindow.update();
end
if main_trap.subwindow then
main_trap.subwindow.update();
end
if main_vehicle.subwindow then
main_vehicle.subwindow.update();
end
if main_ship.subwindow then
main_ship.subwindow.update();
end
if main_creature.subwindow then
main_creature.subwindow.update();
end
local bReadOnly = WindowManager.getReadOnlyState(getDatabaseNode());

npctype.setReadOnly(bReadOnly);
text.setReadOnly(bReadOnly);

if bReadOnly then
tabs.setTab(2, "spellclasslist_mini", "tab_spells");
else
tabs.setTab(2, "spellclasslist", "tab_spells");
end
end

(npc_main.lua)


function update() <!--Added sType =="Ship"
local bReadOnly = WindowManager.getReadOnlyState(getDatabaseNode());

local bPFMode = DataCommon.isPFRPG();
local sType = DB.getValue(getDatabaseNode(), "npctype", "");

-- Update labels based on system being played and NPC type
if babgrp_label then
if sType == "Vehicle" or sType == "Ship" then
babgrp_label.setValue(Interface.getString("npc_label_cm"));
if bPFMode then
updateControl("babgrp", bReadOnly);
else
updateControl("babgrp", bReadOnly, true);
end
else
if bPFMode then
babgrp_label.setValue(Interface.getString("npc_label_babcm"));
else
babgrp_label.setValue(Interface.getString("npc_label_babgrp"));
end
end
end


Any Help would be greatfull.
Thank You
Samarex
I also attached the ext files

Samarex
June 23rd, 2016, 03:06
To Add... I didn't make any Spell related changes and the only thing I can see for spells is in the NPC.LUA at the end of the

function StateChanged()
if header.subwindow then
header.subwindow.update();
end
if main_trap.subwindow then
main_trap.subwindow.update();
end
if main_vehicle.subwindow then
main_vehicle.subwindow.update();
end
if main_ship.subwindow then
main_ship.subwindow.update();
end
if main_creature.subwindow then
main_creature.subwindow.update();
end
local bReadOnly = WindowManager.getReadOnlyState(getDatabaseNode());

npctype.setReadOnly(bReadOnly);
text.setReadOnly(bReadOnly);

if bReadOnly then
tabs.setTab(2, "spellclasslist_mini", "tab_spells");
else
tabs.setTab(2, "spellclasslist", "tab_spells");
end
end

But I didnt Change any of that. And I don't get the error without my ext active....

(Forgot to put in the String35E.xml info but added the label strings in there too....Minor)

Samarex
June 23rd, 2016, 03:19
While reading my post I realized that I had made a change in my code after seeing a better way to write it else ware. But that change should have only been in one section I have fixed it and the ship shows up right again but Still have my error problems

In the npc.lua it should now read as

function TypeChanged()
local sType = DB.getValue(getDatabaseNode(), "npctype", "");

if sType == "Trap"
then tabs.setTab(1, "main_trap", "tab_main");

elseif sType == "Vehicle"
then tabs.setTab(1, "main_vehicle", "tab_main");
elseif sType == "Ship"
then tabs.setTab(1, "main_ship", "tab_main");

else
tabs.setTab(1, "main_creature", "tab_main");
end
end

Samarex
June 23rd, 2016, 11:46
The npc.xml Error line 95 is fixed. Was loading a script in the base.xml file. Noted them out and the error went away. but still can't figure out the line 105 error for the spell list.

Samarex
June 23rd, 2016, 12:55
Ok Got a Update.
So what I need help with is what is the proper way of Starting a Ext. (how should the extension.xml be written?
I did a Test
Made a copy of the d20 Modern ruleset
Renamed the Original to old so I would not use it.
replaced the files in the ruleset with the files from my ext.

Ran it and all worked well without any error. So conclusion is there is a problem with the way I am loading the Ext.

damned
June 23rd, 2016, 15:05
An extension has the following format

unpacked
\Extensionname
extension.xml
one or more files and folders

packed
a zip file renamed to .ext containing the files and folders from above but NOT the root folder itself

extension.xml will be very much like base.xml from a ruleset in that it doesnt do a lot itself - it most tells the program about all the other files it needs to load

Samarex
June 24th, 2016, 00:23
An extension has the following format

unpacked
\Extensionname
extension.xml
one or more files and folders

packed
a zip file renamed to .ext containing the files and folders from above but NOT the root folder itself

extension.xml will be very much like base.xml from a ruleset in that it doesnt do a lot itself - it most tells the program about all the other files it needs to load

Got that part. Question is when it comes to scripts (mainly ones that you change from the original ruleset) how are they delt with in a ext. Are they required to be listed in the ext, or is it mainly XML files listed. With the above issue it seems to be something related to how the ext is being loaded. If I take all the files I changed and put them in a copy of the original ruleset (replacing the files) everything works with no errors. So something is not loading correct.

damned
June 24th, 2016, 00:46
Got that part. Question is when it comes to scripts (mainly ones that you change from the original ruleset) how are they delt with in a ext. Are they required to be listed in the ext, or is it mainly XML files listed. With the above issue it seems to be something related to how the ext is being loaded. If I take all the files I changed and put them in a copy of the original ruleset (replacing the files) everything works with no errors. So something is not loading correct.

If you dont list them in the extension then how will they get used?
Have a look at some of the Dice rolling scripts like Mutant Year Zero and you will see how the LUA scripts are included.

Samarex
June 24th, 2016, 03:07
If you dont list them in the extension then how will they get used?
Have a look at some of the Dice rolling scripts like Mutant Year Zero and you will see how the LUA scripts are included.

I dont believe that scripts have to actually be listed in the extension.xml., If you want to run a script as the ext is loading then yes. Here is why I think this.

First my extension.xml



<?xml version="1.0" encoding="iso-8859-1"?>

<root version="2.0" release="1" logo="extlogo.png">
<properties>
<name>D20 Ship NPC</name>
<version>1</version>

<author>Russ Campbell</author>
<description>Provides Provides Blood n Space (Ship NPC)</description>
<ruleset>d20 Modern</ruleset>
</properties>


<base>
<icon name="iBNS_Ship" file="logo.png" />
<script name="Startscript" file="scripts/startscript.lua" /><!--chat "ext-info" -->

<!--Campaign Files-->
<includefile source="campaign/record_npc.xml" />
<includefile source="campaign/template_campaign.xml" />
<includefile source="strings/strings_35e.xml" />
</base>

</root>

In my ext the npc.lua has (this is where it goes when you select the npc type at the bottom of the NPC Sheet


function TypeChanged()
local sType = DB.getValue(getDatabaseNode(), "npctype", "");

if sType == "Trap"
then tabs.setTab(1, "main_trap", "tab_main");

elseif sType == "Vehicle"
then tabs.setTab(1, "main_vehicle", "tab_main");
elseif sType == "Ship"
then tabs.setTab(1, "main_ship", "tab_main");

else
tabs.setTab(1, "main_creature", "tab_main");
end
end

The original npc.lua is missing the ship reference


function TypeChanged()
local sType = DB.getValue(getDatabaseNode(), "npctype", "");

if sType == "Trap" then
tabs.setTab(1, "main_trap", "tab_main");
elseif sType == "Vehicle" then
tabs.setTab(1, "main_vehicle", "tab_main");
else
tabs.setTab(1, "main_creature", "tab_main");
end
end

So with that said.
I removed the npc.lua from my ext package and loaded the ruleset with ext on.
The Ship button showed up on the NPC Sheet but I could not select it.
Then I just put my npc.lua file back in the ext's dir and ran the ruleset again this time I was able to select the ship and it changed to the ship page.

So the Ext's lua is loading and it is reading from it.
Correct?

For give me I have some (a little) coding experience but far from a expert. I have the basic idea how this all works but it takes time to figure out how FG coded all there stuff to know what to call and all that stuff. But I am Trying to LEARN the best I can....

If I have the scripts in the extension.xml I get error on loading.
Script Error: [string "campaign/scripts/npc_main.lua"]:19: attempt to call global 'getDatabaseNode' (a nil value)




Thanks
Russ aka Samarex

Samarex
June 24th, 2016, 04:06
Well I can't figure it out. Just gonna wait for the Mongoose Traveller Ruleset to release and run Traveller..........

No since in doing anything for D20 Modern or Furture, since its not 5E or Pathfinder there is not alot of support.


oh well.....

damned
June 24th, 2016, 04:22
Hi Samarex requests for coding support will often take some time to get answered. Only a tiny minority of users do get i under the hood and understanding someone elses coding does take some effort!

I do believe that you will need to somehow call the script within your extension if you have updated it in your extension. I dont believe that just having it there will load it.
I would get you to post your extension as is but I dont have the d20 ruleset so I cant test it anyway...

I tried 3x to write a new ruleset. The first two times were completely abortive. The third time only took about a year and lots of hair pulling and lots of leaning on other people here. People will help you if and when they can but coding does take time for them to get into your headspace.

Load up the extension here anyway in case someone with d20 and with the time and with the ability may be able to help you!

Trenloe
June 24th, 2016, 04:26
I do believe that you will need to somehow call the script within your extension if you have updated it in your extension. I dont believe that just having it there will load it.
Correct, you need to have the <script> entry for your custom/modified .lua script file in your extension otherwise it will not be used. Even if this is in XML that hasn't been modified from the base ruleset.

Samarex
June 24th, 2016, 05:29
Correct, you need to have the <script> entry for your custom/modified .lua script file in your extension otherwise it will not be used. Even if this is in XML that hasn't been modified from the base ruleset.

Neither of the Scripts were custom scripts , Both of the are from the D20 Modern ruleset. All I did was add a couple of lines to create than goto a ship screen. So the script call lines are all ready in the default code. That was not the primary issue I was having. I am getting a error from the spell_class.lua in the rule set. I did nothing to this section but it is popping up.
The main reason I switch the point to the extension loading process. Is because, if I take the files I modified and replace the rule set files with my modified files, and run the ruleset without a ext, everything works fine with now errors. My ship sheet is there and all is fine.
So my conclusion was that there was nothing wrong with the changes I made to the XML's or lua files, My conclusion was that there is something wrong with the way it is all getting loaded.

damned
June 24th, 2016, 06:55
Your assumption is correct. The error is happening because one of your files is expecting the additional lines of code in the script but the original script is running and not your extension script.
This is because you have no reference to the Extension version of the script in your extension.
How/where is the LUA file called in the Ruleset? You will likely have to add this in to the Extension also.

Does that make sense? Sometimes i dont explain things very well!

Samarex
June 24th, 2016, 11:41
Your assumption is correct. The error is happening because one of your files is expecting the additional lines of code in the script but the original script is running and not your extension script.
This is because you have no reference to the Extension version of the script in your extension.
How/where is the LUA file called in the Ruleset? You will likely have to add this in to the Extension also.

Does that make sense? Sometimes i dont explain things very well!

Actually no it does not make since. I can physically see that my script is running. As there are indications on the screen that come from my lua

Please correct me if I am wrong, When a script reference is placed in the extension.xml. That script is not just loaded in memory it is Executed.
So with <script name="npc" file="campaign/scripts/npc.lua" /> placed in the extension.xml, the script runs. Now as long as there is no
function onInit() in the file its ok, but if that function exists then that function executes.
example from npc.lua

function onInit()
TypeChanged();
updateAbility();
onLockChanged();

local node = getDatabaseNode();
for _,v in pairs(DataCommon.abilities) do
DB.addHandler(DB.getPath(node, v), "onUpdate", updateAbility);
end
DB.addHandler(DB.getPath(node, "locked"), "onUpdate", onLockChanged);
end
so the first one

function TypeChanged()
local sType = DB.getValue(getDatabaseNode(), "npctype", "");

if sType == "Trap"
then tabs.setTab(1, "main_trap", "tab_main");

elseif sType == "Vehicle"
then tabs.setTab(1, "main_vehicle", "tab_main");
elseif sType == "Ship"
then tabs.setTab(1, "main_ship", "tab_main");

else
tabs.setTab(1, "main_creature", "tab_main");
end
end
needs to get a value from the DB as to the type of NPC.

Now when you first start your campaign you have NO npc's how can you get a typenpc if there is nothing to get.

If I put that script in my extension.xml (I have listened to both of you and have done what was said but it generates other errors)
one is specific to that line --Script Error: [string "campaign/scripts/npc.lua"]:33: attempt to call global 'getDatabaseNode' (a nil value) the "npctype" is line 33. And even if you have npc's in your database this is when FG is starting how would it know what npc to go look at, so that script should only be called from inside a xml so that your system is in the proper possition to get the infromation needed.

Samarex
June 24th, 2016, 12:01
Correct, you need to have the <script> entry for your custom/modified .lua script file in your extension otherwise it will not be used. Even if this is in XML that hasn't been modified from the base ruleset.

To validate what I am saying that they don't need to be in there look at the DOEbase ext
There are 8 lua files in the ext, only 3 of which are called out in the loading file.

damned
June 24th, 2016, 12:11
They dont have to be in extension.xml but you do have to call them or reference them specifically within the extension. Either the extension.xml or another file directly or indirectly linked from extension.xml has to define this script.

To continue your example
lsControlHideOnEmpty.lua is not defined in extension.xml
extension.xml defines/includes xDOEBaseFiles.xml which defines/includes xDOEBaseTemplates.xml which includes lsControlHideOnEmpty.lua

Something similar occurs for all of the lua scripts in this extension.

Samarex
June 24th, 2016, 13:13
They dont have to be in extension.xml but you do have to call them or reference them specifically within the extension. Either the extension.xml or another file directly or indirectly linked from extension.xml has to define this script.

To continue your example
lsControlHideOnEmpty.lua is not defined in extension.xml
extension.xml defines/includes xDOEBaseFiles.xml which defines/includes xDOEBaseTemplates.xml which includes lsControlHideOnEmpty.lua

Something similar occurs for all of the lua scripts in this extension.

Yes so both my lua's are referenced in the npc.xml file

Samarex
June 24th, 2016, 13:21
@damned
the ext is loaded as a attachment if you want to look at it...use the one in post #3

I tried to make a video to show. All was good until the converter made it a 12meg file......lol

damned
June 24th, 2016, 13:59
Hi Samarex - looking at your script wont help me - I dont have the ruleset to test it on.
You are going to have to start adding some Debug.console commands to your scripts and try and find out why you are getting Nil values returned.

I usually litter my code with Debug commands to try and help me visualise what is going on.

Example

function action(draginfo)
local nodeWin = window.getDatabaseNode();
if nodeWin then
local sMyName = nodeWin.getChild(".name").getValue()
local sSkill1 = self.getValue();
local sSkill2 = self.getName();
local nTotal1 = getValue();
Debug.console("nTotal1:" .. nTotal1 .. "!");
local nPenalty = window.penalty.getValue();
Debug.console("nPenalty:" .. nPenalty .. "!");
local nTotal = nTotal1 - nPenalty;
Debug.console("nTotal:" .. nTotal .. "!");
local sDesc = sMyName .. ": [ABILITY] " .. sSkill2 .. " check [TARGET " .. nTotal .. "]";
Debug.console("sDesc:" .. sDesc );

local rRoll = { sType = "ability", sDesc = sDesc, aDice = {"d100","d10"}, nMod = 0 };
ActionsManager.performAction(draginfo, rActor, rRoll);

end
return true;
end

Samarex
June 24th, 2016, 14:04
Hi Samarex - looking at your script wont help me - I dont have the ruleset to test it on.
You are going to have to start adding some Debug.console commands to your scripts and try and find out why you are getting Nil values returned.

I usually litter my code with Debug commands to try and help me visualise what is going on.

Example

function action(draginfo)
local nodeWin = window.getDatabaseNode();
if nodeWin then
local sMyName = nodeWin.getChild(".name").getValue()
local sSkill1 = self.getValue();
local sSkill2 = self.getName();
local nTotal1 = getValue();
Debug.console("nTotal1:" .. nTotal1 .. "!");
local nPenalty = window.penalty.getValue();
Debug.console("nPenalty:" .. nPenalty .. "!");
local nTotal = nTotal1 - nPenalty;
Debug.console("nTotal:" .. nTotal .. "!");
local sDesc = sMyName .. ": [ABILITY] " .. sSkill2 .. " check [TARGET " .. nTotal .. "]";
Debug.console("sDesc:" .. sDesc );

local rRoll = { sType = "ability", sDesc = sDesc, aDice = {"d100","d10"}, nMod = 0 };
ActionsManager.performAction(draginfo, rActor, rRoll);

end
return true;
end


Thanks I will try that been trying to see how to do that .....knew how in a couple other scripting formats but not this one
As far as the rule set. Sorry I thought it was one that came with FG...forgot I bought it.....

Trenloe
June 24th, 2016, 14:21
Are you still getting the error shown in post #15? If so, when does this occur? When loading the ruleset or when opening a NPC?

If the error occurs when loading the ruleset (with the extension enabled) then there is some code that is executing this LUA script file during loading (which would cause the error). The LUA script file should only execute when the "npc" windowclass is created as that is where the <script> section is defined.

Do you still have some old extension code in your <FG app data>\extensions directory that might be executing the LUA during ruleset/extension loading? FG will use extension code in a directory within <FG app data>\extensions instead of the .ext file if the directory exists.

Samarex
June 24th, 2016, 14:43
No that was fixed when I removed the <script> from my extension.xml (I was being told it needed to be there).
The Errors I have now are the first 2 in the first post. They appear when I open the NPC sheet and try and add a spell Class (I get both) after that I get the "105" error when ever I click on the little magnfyglass Icon or if I open a npc sheet that already has the spell box added....

Also I am just using the File system at this point not loading a actual .ext file. (learned that awhile ago with doing mod files.....
(And yes I have tried putting it into .ext format and removing the file dir to see if that made a diff.... same thing)

I think it is something in the way the ext loads, something is getting overwritten and lost.
Reason.
If I take the 5 files I edited and put them in the ruleset replacing the original EVERYTHING works fine no errors at all....

The easy answer would be to just make a second ruleset and modify files need and go with that. But then if the ruleset is updated I don't get the updates for the second one. So I really want to try and make it an Ext. (plus others could use it also)

Moon Wizard
June 24th, 2016, 14:53
Script tags listed directly in the XML are treated as global scripts, and have no inherent context. They are executed when the ruleset is loaded, and then any onInit function is called.

Script tags within a windowclass definition are executed within the context of a windowinstance object. They are executed after a window is opened, and then the onInit function is called.

Script tags within a control definition (from a windowclass and/or template) are executed within the context of the windowcontrol object. They are executed after the control is instantiated within a windowinstance, and then the onInit function is called.

In the example code I saw several posts back, your script was defined in the extension.xml file which gives it a global context (i.e. Not attached to any object). So, when you are attempting to call getDatabaseNode, it falls saying that function does not exist, which it does not in a global context. Your NPC script needs to be defined within a windowclass definition either by merging with the existing one (and thus overriding any existing script) or replacing the windowclass entirely.

Hope that helps,
JPG

Samarex
June 24th, 2016, 15:10
Thank you for that clarification on how it works. there was alot of confusion going on. Those errors are gone, the scripts are being called from in the proper areas as the original rule-set does. The main problem now is the first two errors in post 1 and post 23 explains when they happen.
Sorry was writing the last post when you answered.

Samarex
June 24th, 2016, 15:20
Ok I am sorry if things got took the wrong way. (Which is why I was getting frustrated) I was taking when Trenloe and Damned said that it needed to be in the extension as it needed to be in the extension.XML. That was my misunderstanding and Again Sorry.....

Trenloe
June 24th, 2016, 16:00
Both of the errors in post #1 are indicating that the control activatedetail isn't accessible/present. Check that the spell_class <windowclass> definition has this control present and enabled.

Samarex
June 27th, 2016, 13:37
Both of the errors in post #1 are indicating that the control activatedetail isn't accessible/present. Check that the spell_class <windowclass> definition has this control present and enabled.

having a hard time finding out why. But I will one day.....

On a Second note: @Trenloe I was looking at other rule sets and ran across Star Wars EotE What you guys did with the Ships for the Character sheet and NPC is basically what I am trying to achieve. How hard would it be to do something like that as Extension for d20 Modern using the Blood and Space Ship Sheet in the D20 Starship Adventure Toolkit book?

Trenloe
June 28th, 2016, 00:45
On a Second note: @Trenloe I was looking at other rule sets and ran across Star Wars EotE What you guys did with the Ships for the Character sheet and NPC is basically what I am trying to achieve. How hard would it be to do something like that as Extension for d20 Modern using the Blood and Space Ship Sheet in the D20 Starship Adventure Toolkit book?
Depends what you mean by "hard". It'll certainly be possible. If it's just adding the new tab it should be fairly straightforward. Most of the work will come from cross tab data population or additional integration into the ruleset/Combat Tracker. e.g. for Star Wars: EotE the Ship data can be displayed in the combat tracker under the PC/NPC entry, this took quite a lot of coding (and testing) to get this working.

Samarex
June 28th, 2016, 01:13
Depends what you mean by "hard". It'll certainly be possible.
Well "Hard" and "Possible" are adjusted not only in a general sense but also by the knowledge of programming by the person involved.

In my Case that would be "Very" and Yes Possible but a very long time"
I'm trying to learn this but its gonna take awhile.....