|
|
|
|
Would you like to get all the new info from
PSX-Scene in your email each day?
Want to learn more about the team keeping you up to date with the latest scene news?
Read about them now! Check out our Developer bios, too! | ||
|
|
i would say the thread best suited for coding talk would be http://psx-scene.com/forums/f276/%5B...cripts-102230/, because this is a release thread and general help is for general stuff (e.g. how to install scripts)

Has anyone figured out how to properly use the native START_NEW_SCRIPT_WITH_ARGS, right now I can only get it to pass one argument yet there is a param in there that states how many parameters you are passing, but it just doesnt seem to work. I tried to create and array and mess with the param count parameter which failed, then try with a struct but it just doesnt load the script. I dont know if you may need more script flags active but there seems to be very little documentation on this
you can't pass a whole array as an argument because it will decay to a pointer which will point at just the first array item, i reckon you'd pass the multiple params in a string formatted in a particular way perhaps similar to what you get in a browsers address bar when you submit form data using the GET method, which is a=text&b=moretext the ampersand (&) seperates each item in that case
(i like bolding text lol)

I just noticed that the flags are different depending on how many arguments are passed. go_on_date.sco is started with 64 args, and when you open it in scotoolbox it says "40 00 00 00" next to script flags (40 is hex for 64). I don't quite understand how the script flag checkboxes are set up in the code editor as only # 7 is checked for that sco. spcellphoneendcall.sco is started with 29 args and shows "1D 00 00 00" on the main screen of toolbox, and when you open the editor the boxes for 1, 3, 4, and 5 are checked.
It looks like a struct is passed on everything with multiple args, but I could be wrong I get pretty confused looking through decompiled scripts. This is from brucie1.sco
Spoiler
PHP Code:void sub_935d(var0, var1, var2, var3, var4, var5)
{
auto var8, var9, var10, var11, var12, var13, var14, var15, var16, var17, var18, var19, var20, var21, var22, var23, var24, var25, var26, var27, var28, var29, var30, var31, var32, var33, var34, var35, var36, var37, var38, var39, var40, var41, var42, var43, var44;
var8.v8 = 5;
var38 = var8.v8;
if (!IS_THREAD_ACTIVE(G[738]))
{
var8.v3 = var0;
if (*(var1) > var38)
{
SCRIPT_ASSERT("TELL SIMON END CALL ARRAY SIZE NEEDS INCREASING");
return;
}
else
{
var37 = 0;
while (var37 <= (*(var1) - 1))
{
var8.v8[var37 * 4].v0 = (*var1)[var37 * 4].v0;
var8.v8[var37 * 4].v1 = (*var1)[var37 * 4].v1;
var8.v8[var37 * 4].v2 = (*var1)[var37 * 4].v2;
var8.v8[var37 * 4].v3 = (*var1)[var37 * 4].v3;
var37 = var37 + 1;
}
if (*(var1) < var38)
{
strcpy(&(var8.v8[*(var1) * 4]), 16, "END");
}
strcpy(&(var8.v4), 16, var2);
var8.v0 = var3;
var8.v1 = var4;
var8.v2 = var5;
REQUEST_SCRIPT("SPcellphoneEndCall");
while (!HAS_SCRIPT_LOADED("SPcellphoneEndCall"))
{
REQUEST_SCRIPT("SPcellphoneEndCall");
WAIT(0);
}
G[737] = 1;
G[738] = START_NEW_SCRIPT_WITH_ARGS("SPcellphoneEndCall", &var8, 29, 1024);
MARK_SCRIPT_AS_NO_LONGER_NEEDED("SPcellphoneEndCall");
}
}
else
{
SCRIPT_ASSERT("MAKE_END_OF_MISSION_CALL() has been called more than once, might be in a loop");
}
}
I'm not sure if you can get away with a hex editing, but the script flags appear to be unencrypted and at 0x10 in the sco.
Thanks for that find, i was looking in some sco's and all START_NEW_SCRIPT_WITH_ARGS natives had 1 for p3, looks like you knew where to look.
No need to worry about editing flags, i have created a little program that runs off a cmd line and lets me choose what flags i want and change the sco signature to 0x00000000 (you'd understand why thats important if your modding on pc, the issue isnt there on console) just after i compile. The problem is i dont know what the flags need to be, but that little find may suggest flags represent how many arguments should get passed into the script. Still gotta look into the spcellphone.sco and see if its flags are 0x1D000000 which would be 29 and also see how its local variables are stored
If you need the decompiled pack iv had on my medifire for awhile heres a link.
openiv decompiled
plss help me i dont know how i mus do it :S
| « Previous Thread | Next Thread » |
| Tags for this Thread |