skip navigation
Game Plague Forums
Not a member? ( Register )
User Name: Password:
Scripts, how do they work?
Pages: [1] -
KingOfTheKeyboard
03/17/11 08:56 pm - Last edited 03/21/11 05:07 pm by KingOfTheKeyboardFilter

Graduate


Awards:

Group: Member
Posts: 156
I have a problem with one of my scripts, please examine the code carefully:
CODE:
The purpose of this script is to return the base stats and information of the particular pokemon when called upon (based on argument 0) by setting the local variables of the object that is calling the script. However, the script will not return anything. I have done a LOT of troubleshooting, and I am 100% certain that it is the script. The arguments are not being called properly, which I think is causing the problem. A hint to what may have gone wrong is when I delete the whole (var index;) and the (if index=1) part, it works. (This solution will obviously not work if I add more pokemon) Also, this is the code that calls the script (apparently none of my scripts are working properly if there are arguments): scr_pokemonstats(oppIndex) I would appreciate any help on this

------------
PARTY LIKE A Custom Emoticon 53Custom Emoticon 83
Iasper
03/18/11 03:14 pmFilter - Reply #1

Dual Master


Awards:

Group: Member
Posts: 1099
Not sure what caused it, but try this: remove the var index and index=argument0 and then change it to if argument0=1 It might work then.

------------
KingOfTheKeyboard
03/18/11 03:43 pmFilter - Reply #2

Group: Member
Thanks, Ill try as soon as I can access my computer
Dark Matter
03/18/11 04:22 pmFilter - Reply #3

Champion


Awards:

Group: Member
Posts: 4563
Do you actually mean return? Because if so, you've missed out the return bit...

------------
Want to know when a pokemon evolves or what moves it learns? Having trouble uncovering hidden items? Visit the Official Pokemon Twilight Guide! Got any questions about PT or the forums? Visit the FAQ!
Official Beta Tester for Pokemon Twilight Highest poster on the GFF Most active member on the GFF 66 (+2 special) out of 66 Pokemon Obtained on PTV5! Every single one of 'em! Image
KingOfTheKeyboard
03/18/11 11:22 pmFilter - Reply #4

Group: Member
No no, i dont mean the return fuction, I just expect the script to set the local variables accordingly, but nothing doing. Unfortunately I will not have time to work on it until sunday, but the only solution I can think of that is fool proof would be to run the script multiple times, returning each individual variable
Bouncy Ball
03/19/11 07:20 amFilter - Reply #5

Champion


Awards:

Group: Mod
Posts: 4057
It appears to work for me with the exact script copied into gamemaker.... it returns nothing but sets those variables (with those spellings) to that data. so to access it you use those variables. I see no reason why it wouldn't work....

------------
KingOfTheKeyboard
03/21/11 03:10 pmFilter - Reply #6

Group: Member
I seriously have no idea why it wont work... I must dodecatuple check this...
Bouncy Ball
03/22/11 12:48 amFilter - Reply #7

Group: Mod
are you sure that this is the exact code? can you post a stripped example or something?
KingOfTheKeyboard
03/22/11 02:20 amFilter - Reply #8

Group: Member
THIS ISSUE HAS BEEN RESOLVED, turns out there is a vital error that is outside of the code I have given you, it is fixed now
This user has donated to PycoGame Fortress
05/19/11 03:24 pmFilter - Reply #9

The Big Cheese


Awards:

Group: Admin
Posts: 425
Donor: This user has donated to Pyco$0.01
I would suggest using a switch statement. switch(argument0); { case 1: name = "omgimon"; baseatk = 200; basespatk = 200; etc = etc; break; case 2: name = "zomgimon"; baseatk = 250; basespatk = 250; etc = etc; break; }

------------
Image Image Image PT SERVER: OFFLINE
Dark Matter
05/19/11 03:47 pmFilter - Reply #10

Group: Member
Trust GF to bump a solved 2 month old topic...
Bouncy Ball
05/19/11 09:19 pmFilter - Reply #11

Group: Mod
Better than the half-dead Skell topic or the pt/pkmn spin-off one
KingOfTheKeyboard
05/19/11 09:24 pmFilter - Reply #12

Group: Member
Thank you bouncy for the compliment, my dead threads are still attractive
Dark Matter
05/20/11 06:22 amFilter - Reply #13

Group: Member
QUOTE: Bouncy Ball
Better than the half-dead Skell topic or the pt/pkmn spin-off one
Half dead...... It was less dead than this topic.
Pages: [1] -