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 [2]

Author Topic: Don't Link Scripts To Other Scripts...  (Read 3361 times)

« Reply #15 on: February 02, 2011, 01:23:27 AM »
Ok, so I have managed to save my weapons into inventory.  However, putting them back into the game seems to be a bit trickier... for starters I cannot get iStringVal to return any sort of number.  In my case,the variable keeps it's default value, whatever it might be.  Here is some truncated code for the sake of brevity...
Code: [Select]
          if ( gameLoaded ==1) {
iGlobalStringGet(sniperPicked,2);
iGlobalStringGet(m4Picked,3);
iGlobalStringGet(shotgunPicked,4);
iGlobalStringGet(glockPicked,5);
iGlobalStringGet(magPicked,6);
iGlobalStringGet(uziPicked,7);

sniperPicked1-iStringVal(sniperPicked);
m4Picked1-iStringVal(m4Picked);
shotgunPicked1-iStringVal(shotgunPicked);
glockPicked1-iStringVal(glockPicked);
magPicked1-iStringVal(magPicked);
uziPicked1-iStringVal(uziPicked);


for (int chosenWeapon = m4Picked1; chosenWeapon < numWeapons; chosenWeapon++) {
 

                 VAL_1 = chosenWeapon;
                 weaponsCatched[chosenWeapon] =true;
                  VAL_2 = 1;
                  gameLoaded = 0;
                  OUT_331=gameLoaded;
                 break;}  }//no more weapons at the time
I can confirm that I am  getting the correct data with iGlobalStringGet, as it prints out properly with a text print object...
There is something in the string to int conversion that I am not seeing, but I have been pounding my brains for a couple of hours trying to figure it out ???

Edit-It doesn't matter where I put the conversion block either.... I have tried in the initialisation section, outside of it... just about everywhere with no results.

jestermon

« Reply #16 on: February 02, 2011, 01:35:39 AM »
Did you mean it to be
sniperPicked1 - iStringVal(sniperPicked);

should it not rather be . . .

to assign a value
sniperPicked1 = iStringVal(sniperPicked);

or to decrease the value
sniperPicked1 -= iStringVal(sniperPicked);

or to increase the value
sniperPicked1 += iStringVal(sniperPicked);

Your keyboard must be faulty :D
« Last Edit: February 02, 2011, 01:39:45 AM by jestermon »
« Reply #17 on: February 02, 2011, 09:54:12 AM »
Whoops. That is embarrasing. However I sincerely thought it was minus, as shown it your example usage of istringval a few posts up. Ah well:-)  thanks again for the quick help jes:-D

jestermon

« Reply #18 on: February 02, 2011, 08:02:40 PM »
Whoops. That is embarrasing. However I sincerely thought it was minus, as shown it your example usage of istringval a few posts up. Ah well:-)  thanks again for the quick help jes:-D

Ah, my bad then, that was a typo. Sorry to lead you on a wild goose chase with that -.
But then we can chalk this down to an experience that will make the = stick forever .. lol

Edit: Fixed the example
« Last Edit: February 02, 2011, 08:07:50 PM by jestermon »
« Reply #19 on: February 03, 2011, 09:36:16 AM »
No worries  ;D.  I always appreciate the help.
« Reply #20 on: June 09, 2012, 03:04:15 PM »
When you say "don't link script to other script" do you don't link script to another AT ALL or is it only if you want the VAL_XXX?
What if i wanted to link the script to another script so i can use the iObjectStop to stop the other linked script. would this still cause lag?
New 3DFoundry:3DFoundry.tk
« Reply #21 on: June 09, 2012, 04:06:54 PM »
i try to never link scripts... when RAD runs it makes all the internal linkages it needs based on the linkages in the editor... i think this is why this causes the lag that i've encountered  (i had a lot of scripts linked)... 

sometimes i can see where linking a script to another may be necessary...

the best thing to do is to try it and see...  i don't think that you will have the same problems i had though...

--Mike

« Reply #22 on: June 09, 2012, 06:06:31 PM »
Oh, ok thanks for the info!
New 3DFoundry:3DFoundry.tk
Pages: 1 [2]