Part 1.
Question:
a. Is it possible to create arrays at runtime that are named Incrementally?
b. Can I create groups at runtime? Do they need to be allready created in the editor. If yes then question 1.a. applies here as well.
Example:
***Within a script I want to create an array.
There is a variable called groupcount to start....
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">groupcount = 1[/QUOTE]
Can I name the array as such....
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">eg_+"[(groupcount)]& #34; (please ignore syntax error here)[/QUOTE]
so that the name of the array is eg_01
It is very important to have the two digit structure. I am assuming I can count # of digits in the groupcount variable ***and add zero to the array name so that it is correct and not eg_1 but eg_01.
After the array is created.....
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">groupcount+1[/QUOTE]
so the next array created will be eg_02 and so on up to whatever max groups are. Also another set of arrays would have arrayname_001 format so I figure I would add another layer to the same loop as above.
Part 2.
Question:
a.If group names and an array name are the same, how can I reference the array when the group hits a trigger?
I assume Im allowed to have groupnames and array names as the same with no problem.
b.If for some reason I cant. How can I read the group name and reference the array with the same number as the group.?
Example:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">groupname = eg_01[/QUOTE]
sets off trigger and passes a value into the correct array....
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">eg_01 (the array) select 0 = 2[/QUOTE]
and then that value updates another array....
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">mission_02 select 0 = 2 (but this could be something different)[/QUOTE]
then use that value to say create a gamelogic named <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">mission_02wp_01[/QUOTE]
but it could be anything here that is just an example.
The point is that the value of 2 is used in the gamelogics name by pasting it in from the array name.
c.Is it possible to pass the part of an arrays name as a value into another array with generic variables.
Example:
eg_01 is accessed and the value of 1 is passed into a variable of x. Then x is used to access the next array instead of the integer of 1.
Instead of:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if this select 0 = 1 then goto #function_01[/QUOTE]
its
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this select 0 = x (or should it be _x? not sure)
goto #function_"[x]" (sic syntax)[/QUOTE]
or
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this select 0 = x(or should it be _x? not sure)
mission_0+"[x]" select 2 = x+1 (so then the array of mission_02 (if x=2) is accessed at the third point on the array)[/QUOTE]
Any help with this would be a Godsend for me.
Please let me know if this is not clear enough.
Thanks!
HOME
Reply With Quote

