IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Post mod/code requests in the Mod Requests topic

Post mod releases in the Mod Showroom

Read the Modding Rules BEFORE posting!

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


Pages: (9) « First ... 5 6 [7] 8 9   ( Go to first unread post ) Reply to this topicStart new topicStart Poll

 [GTA IV|EFLC|REL] Scocl

 High level *.sco script compiler
 
jdmalex2  
Posted: Tuesday, Mar 6 2012, 19:13
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Feb 25, 2012

XXXXX



QUOTE (terreur69 @ Tuesday, Mar 6 2012, 19:02)
yes but why in this function,
QUOTE
(IS_GAME_KEYBOARD_KEY_PRESSED(56)) && (IS_GAME_KEYBOARD_KEY_PRESSED(45)) )  // press left ALT + X


the 56= left ALT and 45= X that the number on the site are not the same .
and if i put 76 it does not work yet """VK_F7 76 F7 key""" ?

for f7 it s 65

76 is KEY_NUMLOCK_5

its all in the file const.h that compiles with the code.. look:

CODE
#define KEY_Q 16
#define KEY_W 17
#define KEY_E 18
#define KEY_R 19
#define KEY_T 20
#define KEY_Y 21
#define KEY_U 22
#define KEY_I 23
#define KEY_O 34
#define KEY_P 25
#define KEY_A 30
#define KEY_S 31
#define KEY_D 32
#define KEY_F 33
#define KEY_G 34
#define KEY_H 35
#define KEY_J 36
#define KEY_K 37
#define KEY_L 38
#define KEY_Z 44
#define KEY_X 45
#define KEY_C 46
#define KEY_V 47
#define KEY_B 48
#define KEY_N 49
#define KEY_M 50
#define KEY_0 11
#define KEY_1 2
#define KEY_2 3
#define KEY_3 4
#define KEY_4 5
#define KEY_5 6
#define KEY_6 7
#define KEY_7 8
#define KEY_8 9
#define KEY_9 10
#define KEY_ENTER 28
#define KEY_ESC 1
#define KEY_BACKSPACE 14
#define KEY_MINUS 12
#define KEY_EQUAL 13
#define KEY_TAB 15
#define KEY_CAPS_LOCK 58
#define KEY_SHIFT 42
#define KEY_CTRL 29
#define KEY_ALT 56
#define KEY_SPACE 57
#define KEY_SQUARE_BRACKET_RIGHT 27
#define KEY_SQUARE_BRACKET_LEFT 26
#define KEY_SEMI_COLON 39
#define KEY_COMMA 51
#define KEY_PERIOD 52
#define KEY_F1 59
#define KEY_F2 60
#define KEY_F3 61
#define KEY_F4 62
#define KEY_F5 63
#define KEY_F6 64
#define KEY_F7 65
#define KEY_F8 66
#define KEY_F9 67
#define KEY_F10 68
#define KEY_F11 87
#define KEY_F12 88
#define KEY_SCROLL_LOCK 70
#define KEY_NUMLOCK 69
#define KEY_ASTERISK 55
#define KEY_NUMLOCK_1 79
#define KEY_NUMLOCK_2 80
#define KEY_NUMLOCK_3 81
#define KEY_NUMLOCK_4 75
#define KEY_NUMLOCK_5 76
#define KEY_NUMLOCK_6 77
#define KEY_NUMLOCK_7 71
#define KEY_NUMLOCK_8 72
#define KEY_NUMLOCK_9 73
#define KEY_NUMLOCK_PLUS 78
#define KEY_NUMLOCK_MINUS 74
#define KEY_NUMLOCK_0 82
PM
  Top
 

 
terreur69  
Posted: Tuesday, Mar 6 2012, 19:19
Quote Post


C2C - Down The Road
Group Icon
Group: Members
Joined: Dec 27, 2010

fr.gif

XXXXX



ok thank but why the web site> here it puts the f7 = 76 ?

This post has been edited by terreur69 on Tuesday, Mar 6 2012, 19:23
Users WebsitePMMSN
  Top
 

 
jdmalex2  
Posted: Tuesday, Mar 6 2012, 19:35
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Feb 25, 2012

XXXXX



QUOTE (terreur69 @ Tuesday, Mar 6 2012, 19:19)
ok thank but why the web site> here it puts the f7 = 76 ?

Im not sure why
PM
  Top
 

 
terreur69  
Posted: Tuesday, Mar 6 2012, 19:42
Quote Post


C2C - Down The Road
Group Icon
Group: Members
Joined: Dec 27, 2010

fr.gif

XXXXX



QUOTE (jdmalex2 @ Tuesday, Mar 6 2012, 21:35)
QUOTE (terreur69 @ Tuesday, Mar 6 2012, 19:19)
ok thank  but why the web site>  here it puts the f7 = 76  ?

Im not sure why

ok in all this, thank you very much wink.gif
Users WebsitePMMSN
  Top
 

 
N-field  
Posted: Thursday, Mar 8 2012, 14:52
Quote Post


Crackhead
Group Icon
Group: Members
Joined: Sep 11, 2011

XXXXX



about this CLEO IV thing, say I were to... use cleo mods only made in gtasa and decompiling the script wouldnt work, would those scripts work in GTA4 as well? Or am I expecting too much from the CLEO library? (My guess as to wat CLEO scripts are is a universal modding language for gta series and the underlying CLEO library translates those instructions for each gta version... or is that wrong? I keep wondering why the Japanese modders made touhou spellcards using CLEO instead of an easier to use .NET scripthook... maybe something to do with low-level functions and complete control and whatnot.... )
PM
  Top
 

 
Skorpro  
Posted: Thursday, Mar 8 2012, 22:31
Quote Post


GTAholiker
Group Icon
Group: Members
Joined: Jul 19, 2009

eu.gif

XXXXX



QUOTE (jdmalex2 @ Tuesday, Mar 6 2012, 19:35)
QUOTE (terreur69 @ Tuesday, Mar 6 2012, 19:19)
ok thank  but why the web site>  here it puts the f7 = 76  ?

Im not sure why

Hi,

the "Virtual Key Codes" (F7 = 118 DEC or 0x76 HEX) are for C++, Delphi and other programming languages only!

Example:
CODE

int key = 118;
if ((GetAsyncKeyState(key) & 1) != 0)   // F7


But with SCOCL I've used this:
CODE

if  (IS_GAME_KEYBOARD_KEY_PRESSED(65))   // F7


I found this out (German keyboard!):
CODE

Example (.SCO):
---------------

if (IS_GAME_KEYBOARD_KEY_PRESSED(31)) // Num 31 = Key 'S'
{
PRINT_STRING_WITH_LITERAL_STRING_NOW("string", "Key = S", 2000, 1);
}


PS:
---
You can use "IS_GAME_KEYBOARD_KEY_JUST_PRESSED" too.



Num  =  Key
-----------
1    =  ESC
2    =  1
3    =  2
4    =  3
5    =  4
6    =  5
7    =  6
8    =  7
9    =  8
10   =  9
11   =  0
12   =  German Keyboard ß
13   =  German Keyboard `
14   =  Backspace
15   =  Tab
16   =  q
17   =  w
18   =  e
19   =  r
20   =  t
21   =  German Keyboard z
22   =  u
23   =  i
24   =  o
25   =  p
26   =  German Keyboard ü
27   =  German Keyboard +
28   =  Return
29   =  CTRL left
30   =  a
31   =  s
32   =  d
33   =  f
34   =  g
35   =  h
36   =  j
37   =  k
38   =  l
39   =  German Keyboard ö
40   =  German Keyboard ä
41   =  German Keyboard ^
42   =  Shift left
43   =  ???
44   =  German Keyboard y
45   =  x
46   =  c
47   =  v
48   =  b
49   =  n
50   =  m
51   =  ,
52   =  .
53   =  -
54   =  Shift right
55   =  Num *
56   =  Alt left
57   =  Space
58   =  Caps Lock (Shift)
59   =  F1
60   =  F2
61   =  F3
62   =  F4
63   =  F5
64   =  F6
65   =  F7
66   =  F8
67   =  F9
68   =  F10
69   =  Num Num
70   =  German Keyboard Rollen
71   =  Num 7
72   =  Num 8
73   =  Num 9
74   =  Num -
75   =  Num 4
76   =  Num 5
77   =  Num 6
78   =  Num +
79   =  Num 1
80   =  Num 2
81   =  Num 3
82   =  Num 0
83   =  Num ,
84   =  ???
85   =  ???
86   =  German Keyboard <
87   =  F11
88   =  F12

It's like jdmalex2 key list smile.gif


Users WebsitePM
  Top
 

 
Frank.s  
Posted: Friday, Apr 6 2012, 21:22
Quote Post


IV Scripter, Modeler.
Group Icon
Group: Members
Joined: Apr 15, 2008

en.gif

Member Award




I'm doing some scripting for the IVSA total conversion and i've hit a problem.

All code under under the highlighted "Mission1Trigger();" near the bottom of the picture doesn't run until the code inside the Mission1Trigger(); function finishes running (which is the break below the white arrow).
How would i make the Mission1Trigger(); function run and make code under the highlighted "Mission1Trigger();" text near the bottom of the picture keep running at the same time?

I'm new to high-level coding with no previous c programming experience (only previous programming experience is III+VC+SA scm scripting). I know how to do some basic stuff in IV's high-level, ie the code i've written in the picture. I know what a "while(true) loop" is, what "break" does, how to load GTAIV models and check them, check player location, create cars, peds and things like that. However i know much more scm coding knowledge (i'm able to create missions in scm but when it comes to sco i don't even know how to make multiple functions run at once. tounge.gif

Any help with the problem would be appreciated. icon14.gif

Btw i originally posted this problem here in the IVSA topic.
user posted image
PM
  Top
 

 
Skorpro  
Posted: Sunday, Apr 8 2012, 11:19
Quote Post


GTAholiker
Group Icon
Group: Members
Joined: Jul 19, 2009

eu.gif

XXXXX



QUOTE

All code under under the highlighted "Mission1Trigger();" near the bottom of the picture doesn't run until the code inside the Mission1Trigger(); function finishes running (which is the break below the white arrow).
How would i make the Mission1Trigger(); function run and make code under the highlighted "Mission1Trigger();" text near the bottom of the picture keep running at the same time?


Hi Frank.s!

My English isn't good, so I hope I have understood you correctly wink.gif

You want to run a loop in background?!?... Here is an example:

CODE


boolean repeat_var = 1; // global

.........blabla.........

void Mission1Trigger(void)
{

.........blabla.........

break;
repeat_var = 0; // Stop "Mission1Trigger"
}

void main(void)
{

.........blabla.........

if (repeat_var == 1)
{
 Mission1Trigger();
}
else if (repeat_var == 0)
{
 PRINT_STRING_WITH_LITERAL_STRING_NOW("string", "End of Mission1Trigger!", 2000, 1);
}

.........blabla.........

}



PS: This works in C++, but in SCOCL too? I have no idea so just try it. Good luck smile.gif


This post has been edited by Skorpro on Sunday, Apr 8 2012, 11:25
Users WebsitePM
  Top
 

 
d-e-v  
Posted: Monday, Apr 23 2012, 21:43
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jan 21, 2012

XXXXX



Are these steps for creating a webpage possible?

1. Register address
2. Set HTML Code
3. Load Adress

I found natives for loading, but not for registering the address so I can reach it ingame. Does anyone how I can realize it?
PM
  Top
 

 
terreur69  
Posted: Monday, Jun 4 2012, 16:38
Quote Post


C2C - Down The Road
Group Icon
Group: Members
Joined: Dec 27, 2010

fr.gif

XXXXX



hi, i want to know how to put more value on #define

i have this :

CODE
#define ZOMB_MODEL MODEL_M_Y_GRUS_LO_01

possible to add more value :

CODE
#define ZOMB_MODEL MODEL_M_Y_GRUS_LO_01            or           MODEL_M_Y_GMAF_LO_01         or         MODEL_M_Y_GBIK_HI_01

to load several models at once? .
thank.
Users WebsitePMMSN
  Top
 

 
DK22Pac  
Posted: Friday, Jun 8 2012, 12:32
Quote Post


Assembly!
Group Icon
Group: Members
Joined: Apr 12, 2009

un.gif

XXXXX



CODE
#define MYMODEL1 1
#define MYMODEL2 2

Or you want to make random models? Then, you must do it in your code.
Users WebsitePM
  Top
 

 
gtafrodo  
Posted: Sunday, Jun 10 2012, 10:44
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jun 10, 2012

XXXXX



How can I clean dirty natives? some have data-types or parameters of 'scriptany'

Also is there a native header file with clean network natives?

If not how can I figure these out myself?

Also is there a way to get the games scripts in c for scocl??
Thanks

This post has been edited by gtafrodo on Sunday, Jun 10 2012, 14:21
PM
  Top
 

 
gtafrodo  
Posted: Friday, Jun 15 2012, 14:50
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jun 10, 2012

XXXXX



I having trouble printing an integer to the screen

int time_in_ragdoll = 100000;

DISPLAY_TEXT_WITH_NUMBER(0.5000, 0.2520, "TEN_PIN_04", time_in_ragdoll);

DISPLAY_TEXT_WITH_NUMBER(0.5000, 0.2520, "NUMBER", time_in_ragdoll);


Both of those lines crash the game(freeze)
Any help?
PM
  Top
 

 
Deluxe8900  
Posted: Friday, Jun 15 2012, 15:50
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jun 14, 2012

XXXXX



QUOTE (gtafrodo @ Sunday, Jun 10 2012, 10:44)
How can I clean dirty natives? some have data-types or parameters of 'scriptany'

Also is there a native header file with clean network natives?

If not how can I figure these out myself?

Also is there a way to get the games scripts in c for scocl??
Thanks

What? Every native which has been release will work for multiplayer, they're is a few multiplayer specific ones, but they are nothing.

And not they're is not, scocl can not read high level C code for some reason, maybe cause it's stripped down C-like language so that it can call natives but I dont know, ill ask alex to come in the thread and help you smile.gif
PM
  Top
 

 
gtafrodo  
Posted: Friday, Jun 15 2012, 16:31
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jun 10, 2012

XXXXX



QUOTE (Deluxe8900 @ Friday, Jun 15 2012, 15:50)
QUOTE (gtafrodo @ Sunday, Jun 10 2012, 10:44)
How can I clean dirty natives? some have data-types or parameters of 'scriptany'

Also is there a native header file with clean network natives?

If not how can I figure these out myself?

Also is there a way to get the games scripts in c for scocl??
Thanks

What? Every native which has been release will work for multiplayer, they're is a few multiplayer specific ones, but they are nothing.

And not they're is not, scocl can not read high level C code for some reason, maybe cause it's stripped down C-like language so that it can call natives but I dont know, ill ask alex to come in the thread and help you smile.gif

Thanks for the reply
Sorry, I understand now. That the opcode does not contain enough info to determine data types in source.

My problem now is just displaying an integer on screen.
Strings are fine.
But when I try display an integer with

int time_in_ragdoll = 100000;

DISPLAY_TEXT_WITH_NUMBER(0.5000, 0.2520, "NUMBER", time_in_ragdoll);
it is no longer freezing
it just doesnt display. Is there methods I should call before this will display?

EDIT:
Ugh, I figured it out. Thanks

Any tutorials on how to use the Natural Motion Messages?

I made a script to issue any event number to my player. Its quite funny. Assuming differant poses and flailing about. But the other commands clearly need other messages etc. So I cant grab things for example

This post has been edited by gtafrodo on Friday, Jun 15 2012, 20:48
PM
  Top
 

 
Deluxe8900  
Posted: Friday, Jun 15 2012, 21:56
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jun 14, 2012

XXXXX



QUOTE (gtafrodo @ Friday, Jun 15 2012, 16:31)
QUOTE (Deluxe8900 @ Friday, Jun 15 2012, 15:50)
QUOTE (gtafrodo @ Sunday, Jun 10 2012, 10:44)
How can I clean dirty natives? some have data-types or parameters of 'scriptany'

Also is there a native header file with clean network natives?

If not how can I figure these out myself?

Also is there a way to get the games scripts in c for scocl??
Thanks

What? Every native which has been release will work for multiplayer, they're is a few multiplayer specific ones, but they are nothing.

And not they're is not, scocl can not read high level C code for some reason, maybe cause it's stripped down C-like language so that it can call natives but I dont know, ill ask alex to come in the thread and help you smile.gif

Thanks for the reply
Sorry, I understand now. That the opcode does not contain enough info to determine data types in source.

My problem now is just displaying an integer on screen.
Strings are fine.
But when I try display an integer with

int time_in_ragdoll = 100000;

DISPLAY_TEXT_WITH_NUMBER(0.5000, 0.2520, "NUMBER", time_in_ragdoll);
it is no longer freezing
it just doesnt display. Is there methods I should call before this will display?

EDIT:
Ugh, I figured it out. Thanks

Any tutorials on how to use the Natural Motion Messages?

I made a script to issue any event number to my player. Its quite funny. Assuming differant poses and flailing about. But the other commands clearly need other messages etc. So I cant grab things for example

when i have time i might make a big thread on how to script with this, and add scripting like you are doing to help people smile.gif
PM
  Top
 

 
Skorpro  
Posted: Saturday, Jun 16 2012, 05:32
Quote Post


GTAholiker
Group Icon
Group: Members
Joined: Jul 19, 2009

eu.gif

XXXXX



Hi,

an example for DISPLAY_TEXT_WITH_NUMBER smile.gif
Small Speedo:
CODE

//GLOBAL
Car veh_speed;
float fSpeed;
int iSpeed;
bool rep_speed = 0;

.........
.........
.........

void SkorproTextAndInt(float x1, float y1, int red1, int green1, int blue1, int num, float x2, float y2, int red2, int green2, int blue2)
{
// TEXT
SET_TEXT_FONT(1); // TEXTFONT_LED
SET_TEXT_BACKGROUND(0);
SET_TEXT_SCALE(0.22, 0.27);
SET_TEXT_COLOUR(red1, green1, blue1, 255);
SET_TEXT_RIGHT_JUSTIFY(0);
SET_TEXT_DROPSHADOW(0, 255, 255, 255, 255);
DISPLAY_TEXT_WITH_LITERAL_STRING(x1, y1, "STRING", "Speed : ");

// NUM
SET_TEXT_FONT(1); // TEXTFONT_LED
SET_TEXT_BACKGROUND(0);
SET_TEXT_SCALE(0.22, 0.27);
SET_TEXT_COLOUR(red2, green2, blue2, 255);
SET_TEXT_RIGHT_JUSTIFY(0);
SET_TEXT_DROPSHADOW(0, 255, 255, 255, 255);
DISPLAY_TEXT_WITH_NUMBER(x2, y2, "NUMBER", num);
}

.........
.........
.........

void main(void)
{

.........
.........
.........

while (TRUE)
{
 // Speedo
 if (IS_CHAR_IN_ANY_CAR(GetPlayerPed())) { rep_speed = 1; }
 else { rep_speed = 0; }

 if (rep_speed == 1) // LOOP start
 {
  if (!IS_CHAR_IN_ANY_CAR(GetPlayerPed()))
  {
   rep_speed = 0; // LOOP end
  }
  GET_CAR_CHAR_IS_USING(GetPlayerPed(), &veh_speed);
  GET_CAR_SPEED(veh_speed, &fSpeed);
  fSpeed = fSpeed * 3.61; // MaxSpeed (Default: 3.61)!
  iSpeed = (int) fSpeed; // float to int
  SkorproTextAndInt(0.01, 0.97, 0, 255, 0, iSpeed, 0.07, 0.97, 255, 0, 0);
 }
   
 // PAUSE
 WAIT(0);
}
}


For full script visit this topic!

Users WebsitePM
  Top
 

 
gtafrodo  
Posted: Saturday, Jun 16 2012, 12:10
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jun 10, 2012

XXXXX



thanks guys biggrin.gif

I have my grab mod working and text displaying on screen. (On PS3)

Anyone understand the 4 grab points?

CODE
   
SET_NM_MESSAGE_VEC3( 165, -1.000000, 1.0000000, 0.5000000 );
SET_NM_MESSAGE_VEC3( 166, -1.000000, 0.0000000, 0.5000000 );
SET_NM_MESSAGE_VEC3( 167, 0.0000000, 1.000000, 0.5000000 );
SET_NM_MESSAGE_VEC3( 168, 0.0000000, 0.000000, 0.5000000 );


I have constants here, but I'm sure I should be calculating offsets from player to corner/side of the nearest vehicle.

PM
  Top
 

 
westsidebud  
Posted: Saturday, Jun 23 2012, 18:09
Quote Post


Descanter The Insalubrious
Group Icon
Group: Members
Joined: Jun 11, 2005

cd.gif

XXXXX



can i ask what algo is used for native hashs ?
its impossible to get a text string from a hash right ?
so im assuming you used other methods to figure out
what the text titles would be..

im comparing gtaiv.exe script related code (104 vs 107) in OllyDBG

Years ago i wrote an IDA script for the program Steam (posted in cs.rin.ru forum)
to get the sets of virtual table functions including the func names and what order they are in.
I was thinking about the idea for GTA but unless my script got the params too
it would be sorta useless anyway lol

This is not something i have used *yet (playing with your script hook sdk now)
But good job and thanks for sharing your work with us all smile.gif
PM
  Top
 

 
Limiter  
Posted: Thursday, Jun 28 2012, 07:54
Quote Post


GTA Modder
Group Icon
Group: Members
Joined: Dec 3, 2010

cd.gif

XXXXX



Hi, I want to know is it possible to alter the pool game such that Niko can play by himself as well. I want to use this as a base to learn sco.
PM
  Top
 

 

0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)

0 Members:

Pages: (9) « First ... 5 6 [7] 8 9 

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG