Quantcast

Jump to content

» «
Photo

.sco scripting

43 replies to this topic
stef538
  • stef538

    It's just me, going 88 MPH.

  • Members
  • Joined: 06 Oct 2012
  • Netherlands

#1

Posted 22 July 2014 - 11:21 AM Edited by stef538, 22 July 2014 - 11:40 AM.

Hey guys,

 

So i tried some .sco scripting in 1.0.4.0 with the empty script from shadow-link.
His script works perfectly, but whenever i try to edit the startup.c using Skorpro's tutorial and then GTA 4 just stops working.. this is the code i used :

#include <natives.h>
#include <common.h>
#include <strings.h>
#include <types.h>
#include <consts.h>

#define MAINSCRIPT "main"
#define PLY_X 2783.87
#define PLY_Y 426.42
#define PLY_Z 5.82
#define PLY_A 45.0

void main(void)
{
	// create player
	Player plind;
	CREATE_PLAYER(0, PLY_X, PLY_Y, PLY_Z, &plind);
	LOAD_SCENE(PLY_X, PLY_Y, PLY_Z);
	SET_CHAR_COORDINATES(GetPlayerPed(), PLY_X, PLY_Y, PLY_Z);
	SET_CHAR_HEADING(GetPlayerPed(), PLY_A);
    // load main script
	REQUEST_SCRIPT(MAINSCRIPT);
	while (!HAS_SCRIPT_LOADED(MAINSCRIPT)) WAIT(0);
	uint script = START_NEW_SCRIPT(MAINSCRIPT, 1024);
	MARK_SCRIPT_AS_NO_LONGER_NEEDED(MAINSCRIPT);
	// return to the loading process
	return;
}

and yes i have the main.sco in the .img.

 

and even when i try this :

#include <natives.h>
#include <common.h>
#include <strings.h>
#include <types.h>
#include <consts.h>

//#define MAINSCRIPT "main"
#define PLY_X 2783.87
#define PLY_Y 426.42
#define PLY_Z 5.82
#define PLY_A 45.0

void main(void)
{
	// create player
	Player plind;
	CREATE_PLAYER(0, PLY_X, PLY_Y, PLY_Z, &plind);
	LOAD_SCENE(PLY_X, PLY_Y, PLY_Z);
	SET_CHAR_COORDINATES(GetPlayerPed(), PLY_X, PLY_Y, PLY_Z);
	SET_CHAR_HEADING(GetPlayerPed(), PLY_A);
    // load main script
	//REQUEST_SCRIPT(MAINSCRIPT);
	//while (!HAS_SCRIPT_LOADED(MAINSCRIPT)) WAIT(0);
	//uint script = START_NEW_SCRIPT(MAINSCRIPT, 1024);
	////MARK_SCRIPT_AS_NO_LONGER_NEEDED(MAINSCRIPT);
	// return to the loading process
	return;
}

It doesn't work..  Does anyone know what to do ?


LetsPlayOrDy
  • LetsPlayOrDy

    Lets mod or die!

  • Members
  • Joined: 24 Aug 2013
  • United-States

#2

Posted 22 July 2014 - 11:29 AM

I got the same error too. I don't know how to fix it :/

stef538
  • stef538

    It's just me, going 88 MPH.

  • Members
  • Joined: 06 Oct 2012
  • Netherlands

#3

Posted 22 July 2014 - 11:41 AM

I hope someone can :/


One Man Standing
  • One Man Standing

    Keep up motherf*cker!

  • Members
  • Joined: 22 Jul 2014
  • Lithuania

#4

Posted 22 July 2014 - 01:29 PM Edited by One Man Standing, 22 July 2014 - 01:29 PM.

Maybe you should look for some help on the comments of the youtube tutorial comments


PingPang
  • PingPang

    Better known as Frank.s (PingPang = drunk mistake)

  • Feroci
  • Joined: 15 Apr 2008
  • None

#5

Posted 22 July 2014 - 05:42 PM Edited by Frank.s, 22 July 2014 - 05:45 PM.

When you used Scocl to export the .sco, it exports in a way that patch 7 reads it correctly but patch 4 won't.

Use scotoolbox by flitskikker to convert all sco's that you make using scocl from patch 7 format (the default) to patch 4 format. (Or modify scocl to output .sco files that patch 4 can read, i think ThreeSocks or  jdmAlex did something like this, google search for their public sco source code, it's not impossible to find.) :^:


NOLABaby8732
  • NOLABaby8732

    Player Hater

  • Members
  • Joined: 06 Feb 2012

#6

Posted 22 July 2014 - 06:59 PM

Hey guys,

 

So i tried some .sco scripting in 1.0.4.0 with the empty script from shadow-link.
His script works perfectly, but whenever i try to edit the startup.c using Skorpro's tutorial and then GTA 4 just stops working.. this is the code i used :

#include <natives.h>
#include <common.h>
#include <strings.h>
#include <types.h>
#include <consts.h>

#define MAINSCRIPT "main"
#define PLY_X 2783.87
#define PLY_Y 426.42
#define PLY_Z 5.82
#define PLY_A 45.0

void main(void)
{
	// create player
	Player plind;
	CREATE_PLAYER(0, PLY_X, PLY_Y, PLY_Z, &plind);
	LOAD_SCENE(PLY_X, PLY_Y, PLY_Z);
	SET_CHAR_COORDINATES(GetPlayerPed(), PLY_X, PLY_Y, PLY_Z);
	SET_CHAR_HEADING(GetPlayerPed(), PLY_A);
    // load main script
	REQUEST_SCRIPT(MAINSCRIPT);
	while (!HAS_SCRIPT_LOADED(MAINSCRIPT)) WAIT(0);
	uint script = START_NEW_SCRIPT(MAINSCRIPT, 1024);
	MARK_SCRIPT_AS_NO_LONGER_NEEDED(MAINSCRIPT);
	// return to the loading process
	return;
}

and yes i have the main.sco in the .img.

 

and even when i try this :

#include <natives.h>
#include <common.h>
#include <strings.h>
#include <types.h>
#include <consts.h>

//#define MAINSCRIPT "main"
#define PLY_X 2783.87
#define PLY_Y 426.42
#define PLY_Z 5.82
#define PLY_A 45.0

void main(void)
{
	// create player
	Player plind;
	CREATE_PLAYER(0, PLY_X, PLY_Y, PLY_Z, &plind);
	LOAD_SCENE(PLY_X, PLY_Y, PLY_Z);
	SET_CHAR_COORDINATES(GetPlayerPed(), PLY_X, PLY_Y, PLY_Z);
	SET_CHAR_HEADING(GetPlayerPed(), PLY_A);
    // load main script
	//REQUEST_SCRIPT(MAINSCRIPT);
	//while (!HAS_SCRIPT_LOADED(MAINSCRIPT)) WAIT(0);
	//uint script = START_NEW_SCRIPT(MAINSCRIPT, 1024);
	////MARK_SCRIPT_AS_NO_LONGER_NEEDED(MAINSCRIPT);
	// return to the loading process
	return;
}

It doesn't work..  Does anyone know what to do ?

Send me your skype and I can give you the scocl files to compile for patch 1.0.4 if you need


TemporaryAccount7
  • TemporaryAccount7

    Needs help

  • BUSTED!
  • Joined: 22 Jul 2014
  • None

#7

Posted 22 July 2014 - 09:05 PM

When you used Scocl to export the .sco, it exports in a way that patch 7 reads it correctly but patch 4 won't.

Use scotoolbox by flitskikker to convert all sco's that you make using scocl from patch 7 format (the default) to patch 4 format. (Or modify scocl to output .sco files that patch 4 can read, i think ThreeSocks or  jdmAlex did something like this, google search for their public sco source code, it's not impossible to find.) :^:

yeah i see that working. i always use SCO Tool Box because patch 7 drops FPS and it crashes more often maybe and sometimes the FPS becomes 25-30 then suddenly become 2-5fps then comes back to 10-15fps Rockstar is kidding me. i almost use Scocl more than Net.Scripthook because SCOCL gives freedom. also i the only and the biggest problem with Net.Scripthook that Phone checks only work for WINXP. if it was working it was going to be the best!


Noox
  • Noox

    changeScriptAbility(&myScriptAbility, "improve");

  • Members
  • Joined: 20 Jun 2014
  • None

#8

Posted 22 July 2014 - 09:23 PM

Not trying to go off topic but why does temporaryaccount sound like maro? In the GTA V thread he said he likes C++ more because of freedom.

Anyway SCO reminds me of low level languages for some reasons and it's not because of C/C++

  • InfamousSabre likes this

TemporaryAccount7
  • TemporaryAccount7

    Needs help

  • BUSTED!
  • Joined: 22 Jul 2014
  • None

#9

Posted 22 July 2014 - 09:37 PM Edited by TemporaryAccount7, 22 July 2014 - 09:38 PM.

who is maro and what are you talking about and why are you trying to lock this topic?


LetsPlayOrDy
  • LetsPlayOrDy

    Lets mod or die!

  • Members
  • Joined: 24 Aug 2013
  • United-States

#10

Posted 22 July 2014 - 10:32 PM

@Noox
Nah he doesn't sound like Maro.
@TemporaryAccount7
Maro Hannover (aka Maro) is some new guy on here that went off topic a lot and was annoying. He got banned lol

TemporaryAccount7
  • TemporaryAccount7

    Needs help

  • BUSTED!
  • Joined: 22 Jul 2014
  • None

#11

Posted 22 July 2014 - 11:13 PM

Yeah because Maro had improved and became an anti-annoying person(i am a good actor right?) see guys i miss you very much so please respect my wishes i am trying to save myself in this forums so i don't want to be rude and you are better than me so i can't say (Stay in the topic) but we have to do it guys for ......?????

 

NOTE: This Post is on the Off-topic limit and didn't reached it so please don't post a reply here. Send me a PM(I can't find the button of PM even)

  • byteMe420 likes this

LetsPlayOrDy
  • LetsPlayOrDy

    Lets mod or die!

  • Members
  • Joined: 24 Aug 2013
  • United-States

#12

Posted 23 July 2014 - 12:26 AM

Off topic:
@TemporaryAccount7
I knew it! :p
On topic:
I get this same problem, but on 1.0.7.0. Is it the same way to fix it?

Noox
  • Noox

    changeScriptAbility(&myScriptAbility, "improve");

  • Members
  • Joined: 20 Jun 2014
  • None

#13

Posted 23 July 2014 - 06:38 AM

Yeah because Maro had improved and became an anti-annoying person(i am a good actor right?) see guys i miss you very much so please respect my wishes i am trying to save myself in this forums so i don't want to be rude and you are better than me so i can't say (Stay in the topic) but we have to do it guys for ......?????

 

NOTE: This Post is on the Off-topic limit and didn't reached it so please don't post a reply here. Send me a PM(I can't find the button of PM even)

63e20219f2ae44f88bc46cba23fa09fe.png

 

Back on topic.

  • AgentWD40 and InfamousSabre like this

leftas
  • leftas

    I like turtles

  • Members
  • Joined: 13 Jun 2013
  • Lithuania

#14

Posted 23 July 2014 - 07:13 AM Edited by leftas, 23 July 2014 - 07:19 AM.

Maybe you should look for some help on the comments of the youtube tutorial comments

What the actual f*ck, again you like f*cking these Indian/not Indian guy. U f*cking retarded or what, why you writing in different colors ? I find this very annoying. Also There is not much youtubers coding, especially in SCO language. So why you don't come back to your installers, maybe just create installers topic (I am always little too rude, when I got nervous from guys like you,Indians(not including all Indians, just those who are lazy)) ?

I think problem is that you are commenting loading mainscript which like I think injecting code in mainscript. This is just speculations I am not sure, because I am not coding in SCO, I don't how it works.
P.S. I am not sure if I saw all code, because in mobile code not showing correctly and I am out for a week.

Best Regards,
Paul.

NOLABaby8732
  • NOLABaby8732

    Player Hater

  • Members
  • Joined: 06 Feb 2012

#15

Posted 23 July 2014 - 03:28 PM Edited by NOLABaby8732, 23 July 2014 - 03:41 PM.

 

When you used Scocl to export the .sco, it exports in a way that patch 7 reads it correctly but patch 4 won't.

Use scotoolbox by flitskikker to convert all sco's that you make using scocl from patch 7 format (the default) to patch 4 format. (Or modify scocl to output .sco files that patch 4 can read, i think ThreeSocks or  jdmAlex did something like this, google search for their public sco source code, it's not impossible to find.) :^:

yeah i see that working. i always use SCO Tool Box because patch 7 drops FPS and it crashes more often maybe and sometimes the FPS becomes 25-30 then suddenly become 2-5fps then comes back to 10-15fps Rockstar is kidding me. i almost use Scocl more than Net.Scripthook because SCOCL gives freedom. also i the only and the biggest problem with Net.Scripthook that Phone checks only work for WINXP. if it was working it was going to be the best!

 

1.) My FPS only drops to 30 on patch seven... note that is when im recording or when everything is popping in(I also play at 1080p)

2.) the scripthooks give more freedom.. only reason i SCO mod is because it blends in with regular game files.

 

 

 

Maybe you should look for some help on the comments of the youtube tutorial comments

What the actual f*ck, again you like f*cking these Indian/not Indian guy. U f*cking retarded or what, why you writing in different colors ? I find this very annoying. Also There is not much youtubers coding, especially in SCO language. So why you don't come back to your installers, maybe just create installers topic (I am always little too rude, when I got nervous from guys like you,Indians(not including all Indians, just those who are lazy)) ?

I think problem is that you are commenting loading mainscript which like I think injecting code in mainscript. This is just speculations I am not sure, because I am not coding in SCO, I don't how it works.
P.S. I am not sure if I saw all code, because in mobile code not showing correctly and I am out for a week.

Best Regards,
Paul.

 

If his script is instant crashing he is probably compiling it wrong. The main script has nothing to do with it. You can open up script.img and delete every script put in your own startup.sco and a blank puzzle.sco and the game will still run fine.

 

By compiling it wrong its most likely what everyone has said. It compiled for v1.0.7 when your running v1.0.4

 

EDIT: SCOCL to compile for 1.0.4 ... use scocl_old.exe to compile


Noox
  • Noox

    changeScriptAbility(&myScriptAbility, "improve");

  • Members
  • Joined: 20 Jun 2014
  • None

#16

Posted 23 July 2014 - 03:45 PM

 

 

When you used Scocl to export the .sco, it exports in a way that patch 7 reads it correctly but patch 4 won't.

Use scotoolbox by flitskikker to convert all sco's that you make using scocl from patch 7 format (the default) to patch 4 format. (Or modify scocl to output .sco files that patch 4 can read, i think ThreeSocks or  jdmAlex did something like this, google search for their public sco source code, it's not impossible to find.) :^:

yeah i see that working. i always use SCO Tool Box because patch 7 drops FPS and it crashes more often maybe and sometimes the FPS becomes 25-30 then suddenly become 2-5fps then comes back to 10-15fps Rockstar is kidding me. i almost use Scocl more than Net.Scripthook because SCOCL gives freedom. also i the only and the biggest problem with Net.Scripthook that Phone checks only work for WINXP. if it was working it was going to be the best!

 

1.) My FPS only drops to 30 on patch seven... note that is when im recording or when everything is popping in(I also play at 1080p)

2.) the scripthooks give more freedom.. only reason i SCO mod is because it blends in with regular game files.

He doesn't even know what a variable is you shouldn't even bother to tell him those things.

Anyway, he has been banned for the third time in one month...


leftas
  • leftas

    I like turtles

  • Members
  • Joined: 13 Jun 2013
  • Lithuania

#17

Posted 23 July 2014 - 03:47 PM

Yea, sorry I don't know how SCO works, so I just can speculate :)

Best Regards,
Paul.

stef538
  • stef538

    It's just me, going 88 MPH.

  • Members
  • Joined: 06 Oct 2012
  • Netherlands

#18

Posted 24 July 2014 - 07:21 AM Edited by stef538, 24 July 2014 - 07:21 AM.

yeah got it all working thanks guys! Only one question though, how to start a new void ? i mean i have this :

void main(void)
{
  story();
}

and

void story(void)
{
  //blablasomecode
}

but it always give ma an error on 'story();'


Noox
  • Noox

    changeScriptAbility(&myScriptAbility, "improve");

  • Members
  • Joined: 20 Jun 2014
  • None

#19

Posted 24 July 2014 - 07:24 AM

Did you try without void?


stef538
  • stef538

    It's just me, going 88 MPH.

  • Members
  • Joined: 06 Oct 2012
  • Netherlands

#20

Posted 24 July 2014 - 07:39 AM

you mean something like

 

(void) story

{

}

or

 

story (void)

{

}


Noox
  • Noox

    changeScriptAbility(&myScriptAbility, "improve");

  • Members
  • Joined: 20 Jun 2014
  • None

#21

Posted 24 July 2014 - 07:46 AM

just use void story() and see if it works. (when you declare the function not when you call it)


stef538
  • stef538

    It's just me, going 88 MPH.

  • Members
  • Joined: 06 Oct 2012
  • Netherlands

#22

Posted 24 July 2014 - 07:49 AM

then the sco compiler says :
 

parser varargs functions are not allowed => compiler: <llvm> unrecognized call etc etc,

Noox
  • Noox

    changeScriptAbility(&myScriptAbility, "improve");

  • Members
  • Joined: 20 Jun 2014
  • None

#23

Posted 24 July 2014 - 07:52 AM

uhm I don't know then :|


Alexander Blade
  • Alexander Blade

    Come As You Are

  • Members
  • Joined: 05 Nov 2006
  • None
  • Major Contribution Award [Mods]

#24

Posted 24 July 2014 - 08:10 AM

story must be declated before main


stef538
  • stef538

    It's just me, going 88 MPH.

  • Members
  • Joined: 06 Oct 2012
  • Netherlands

#25

Posted 24 July 2014 - 09:24 AM Edited by stef538, 24 July 2014 - 10:27 AM.

that worked :) thanks!!!

 

EDIT

 

I tried to define a car on the top on the script, then i added a car using that value, but then i try to let it do things in another sub and then it says it doesn't exist ?

 

EDIT 

 

NVM Fixed.


stef538
  • stef538

    It's just me, going 88 MPH.

  • Members
  • Joined: 06 Oct 2012
  • Netherlands

#26

Posted 24 July 2014 - 11:17 AM

also, don't know if someone noticed it but 

TASK_CAR_DRIVE_TO_COORD

isn't working.. and i tried to search the internet but nothing helpfull came up..


LetsPlayOrDy
  • LetsPlayOrDy

    Lets mod or die!

  • Members
  • Joined: 24 Aug 2013
  • United-States

#27

Posted 24 July 2014 - 12:29 PM

also, don't know if someone noticed it but 

TASK_CAR_DRIVE_TO_COORD
isn't working.. and i tried to search the internet but nothing helpfull came up..
Did you create a driver for the car?

stef538
  • stef538

    It's just me, going 88 MPH.

  • Members
  • Joined: 06 Oct 2012
  • Netherlands

#28

Posted 24 July 2014 - 01:03 PM

yeah i did.


leftas
  • leftas

    I like turtles

  • Members
  • Joined: 13 Jun 2013
  • Lithuania

#29

Posted 24 July 2014 - 01:16 PM

What parameters you wrote there ?

Best Regards,
Paul.

stef538
  • stef538

    It's just me, going 88 MPH.

  • Members
  • Joined: 06 Oct 2012
  • Netherlands

#30

Posted 24 July 2014 - 01:19 PM

Vehicle v_spawn;
uint model;
uint ped_model;
Ped ped;
float housex = -38.94, housey = 597.51, housez = 14.58;


GET_CAR_MODEL(v_spawn, &model);
GET_DRIVER_OF_CAR(v_spawn, &ped);
TASK_CAR_DRIVE_TO_COORD(ped, v_spawn, housex, housey, housez, 60.0f, 10, model, 2, 5.0f, -1);

something like this.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users