3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: [1]

Author Topic: Script Limited  (Read 333 times)

« on: December 31, 2013, 09:08:32 AM »
Hi and Happy Christmas. :D

I attached some much object to script. in Object Handles I could only attached object until OBJ_1980. why?

« Last Edit: December 31, 2013, 09:12:55 AM by behdadsoft »
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0

possible way, if we found will make a way.
« Reply #1 on: January 11, 2014, 12:41:12 AM »
theres a limit to how much you can add, it mite be 3drad & or your memory free space causing a limit.

Cant say, but it's not unlimited...
« Reply #2 on: January 14, 2014, 12:04:17 PM »
This limited make my work is very hard.
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0

possible way, if we found will make a way.
« Reply #3 on: January 14, 2014, 12:43:10 PM »
i don't think that its any any limit in  RAD that is what's  making your work any harder B...
seriously... you gotta step back and look at what you're trying to do, and how you are trying to do it...


--Mike
« Reply #4 on: January 14, 2014, 03:04:12 PM »
There is a limit in 3D Rad indeed.
The problem is: once you have reached that limit you have to start your project all over again, because you cannot delete and replace objects anymore which shall be used in your script. I am not sure - I think it was 64 or 99 objects which could be added (not sure about the number - only a guess)
I worked on a project, made too many changes (added and deleted items to check out different sizes) and finally had to do it all over, because the script did not accept any more new items. Seems you ran into the same dilemma.


Using 3D Rad 7.22
« Reply #5 on: January 14, 2014, 04:30:51 PM »
both of you are absolutely correct... there is a limit...  but both of you seem to have failed to recognize the obvious...

split the logic into multiple scripts... use the global arrays to make required data available between scripts...

it's all a matter of planning before you start coding...


--Mike
« Reply #6 on: January 14, 2014, 10:48:33 PM »
Hi there is an alternative, if you are hiding, showing, start or stopping lots of objects use a Event on Timer then you only have one object to start in the script and this makes your script more manageable.

I have used this method in my Stream Boat Demo. Because I had run into FPS problems I separated the RB and switch them on and off depending which camera the player uses.

n_iron
« Reply #7 on: January 15, 2014, 07:44:38 AM »
both of you are absolutely correct... there is a limit...  but both of you seem to have failed to recognize the obvious...

split the logic into multiple scripts... use the global arrays to make required data available between scripts...

it's all a matter of planning before you start coding...


--Mike

No, I haven't  missed that ... the thing was: It was impossible to split the script! Because all objects had to be handled at once and had to interact - and converting values to global strings and back does not produce satisfying results ...
So ... there is a limit which is unnecessary (no idea what the guy who made 3DRad had in mind and why he did it) ... but its there ...
« Last Edit: January 15, 2014, 07:46:53 AM by Leonopteryx »
Using 3D Rad 7.22
« Reply #8 on: January 15, 2014, 12:50:14 PM »
the 3DRAD interpreter can handle several scripts of significant logic in the length of time you would consider "at once"...  and still have enough time left over to have a cup of coffee...  and you wouldn't even notice any slowdown that might occur...

a sixtieth of a second is an eternity for a microprocessor...

i understand what you are saying,  but it is based on misunderstanding of some fundamentals...

first of all... nothing happens at once in a computer... as fast as they are,  every instruction that is executed by the cpu takes a certain amount of time... and is happens in sequence... one behind the other...

even those that are not asynchronous take time...

but the time it takes is measured in fractions of millisecs... so even time intensive string based operations will happen incredibly fast...  and no matter how much time it'll take, they'll all be executed plenty fast for a human to "see" them happening at once...

also... it may take several cpu instructions to accomplish a single 3DRAD instruction... and this'll most likely include some sorta memory manipulation as well...

below is a short bit of code that might get you looking at things in a different light...

Code: [Select]
float  startHour,startMinute,startSec, startMillisec,  duration,startTime;
float  endHour,endMinute,endSec, endMillisec, endTime;
int    result,n;
bool   isDone=false;
string strVal;


void Main()
{
   if(iInitializing()){
      startHour=iSystemTime(4);
      startMinute=iSystemTime(5);
      startSec=iSystemTime(6);
      startMillisec=iSystemTime(7);
      startTime=startMinute*60000+startSec*1000+startMillisec;
   }
 
   if(!isDone){
     if(n<500){
       result=n+n;
       //iStringStr(strVal,n*2300/2,"%0.6f");  //  UNCOMMENT THIS LINE TO SEE THE EFFECT OF STRING INSTUCTIONS
       //iGlobalStringSet(strVal,n);    //  UNCOMMENT THIS LINE TO SEE THE EFFECT OF STRING INSTUCTIONS
       n++;
     } else {
        endHour=iSystemTime(4);
        endMinute=iSystemTime(5);
        endSec=iSystemTime(6);
        endMillisec=iSystemTime(7);
        endTime=endMinute*60000+endSec*1000+endMillisec;
        duration=endTime-startTime;
        OUT_0=duration;
        isDone=true;
     }
   }
}

connect a value print object and run it...  then add another script object and copy and paste the following code in it...  now run the project, just to see the effect the second script has on the time it takes to finish the test in the first script...

Code: [Select]
string fromOtherScript;
int    n;

void Main()
{
 
  iGlobalStringGet(fromOtherScript,n);
  if(n<100) n++;
}

clone the script ten times and see if there's any significant difference in the time it takes to finish the test in the first script...


now i know this is a simplified test, and it might not fully delve into the issue you raised above... but it might you see another option...


--Mike

« Last Edit: January 15, 2014, 02:04:37 PM by Mike Hense »
Pages: [1]