|
 |
|
|
|
|
|
GTA Modification Forums
Creating Objects Title says it all
 |
|
 |
| |
Deji  |
Posted: Thursday, Apr 12 2012, 08:45
|
Coding like a Rockstar!

Group: Members
Joined: Dec 24, 2007


|
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
The_Sorrow  |
Posted: Thursday, Apr 12 2012, 10:26
|
Heaven, I'm in heaven(8)

Group: Members
Joined: May 31, 2010


|
It's pretty simple, although I myself haven't done this before with trees and such, I'm going with common sense.
Firstly, Collect the ID of the model you want to spawn since I'm assuming there isn't a model name for 'tree' in sanny builder, A little research will find you your ID
To load the model (Using the ID you collected) use this code:
| CODE | 0247: load_model #WBDYG2
|
Replace #WBDYG2 with your model ID number
Now, You need to collect the coords (Coordinates) of CJ with an offset, The offset it used to collect coordinates infront, behind and to the side of him.
Use this code to collect the coords:
| CODE | 04C4: store_coords_to $1 $2 $3 from_actor $PLAYER_ACTOR with_offset 1.0 3.0 1.0
|
$1 $2 and $3 are global variables, Although everybody advises not to use them I have always used them and had no problems
$PLAYER_ACTOR - Self explanatory really, This is CJ
1.0 3.0 1.0 - These are the offset coords, X, Y and Z
Using the 'Create' opcode below you can spawn your object using the coords you collected:
| CODE | 0107: $Myobject = create_object #AD_FLATDOOR at $1 $2 $3
|
Replace #AD_FLATDOOR with your model number and your code should now spawn your object infront of CJ
The full code? Oh yes:
| CODE | 0247: load_model #WBDYG2 04C4: store_coords_to $1 $2 $3 from_actor $PLAYER_ACTOR with_offset 1.0 3.0 1.0 0107: $Myobject = create_object #AD_FLATDOOR at $1 $2 $3 |
Hope this helped and good luck, Obviously the code I gave you isn't fully completed, Research and use common sense, you'll be a coding pro in no time!
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
The_Sorrow  |
Posted: Thursday, Apr 12 2012, 10:32
|
Heaven, I'm in heaven(8)

Group: Members
Joined: May 31, 2010


|
| QUOTE (Deji @ Thursday, Apr 12 2012, 10:31) | | QUOTE (The_Sorrow @ Thursday, Apr 12 2012, 10:26) | | CODE | 04C4: store_coords_to $1 $2 $3 from_actor $PLAYER_ACTOR with_offset 1.0 3.0 1.0
|
$1 $2 and $3 are global variables, Although everybody advises not to use them I have always used them and had no problems |
If someone tells you not to jump off a cliff into the sea because there are sharks at the bottom, will you still jump in just because they weren't there to tear you apart the first time? | Nah, but this is coding related, whats the worst that can happen?
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Deji  |
Posted: Thursday, Apr 12 2012, 10:39
|
Coding like a Rockstar!

Group: Members
Joined: Dec 24, 2007


|
| QUOTE (The_Sorrow @ Thursday, Apr 12 2012, 10:32) | | QUOTE (Deji @ Thursday, Apr 12 2012, 10:31) | | QUOTE (The_Sorrow @ Thursday, Apr 12 2012, 10:26) | | CODE | 04C4: store_coords_to $1 $2 $3 from_actor $PLAYER_ACTOR with_offset 1.0 3.0 1.0
|
$1 $2 and $3 are global variables, Although everybody advises not to use them I have always used them and had no problems |
If someone tells you not to jump off a cliff into the sea because there are sharks at the bottom, will you still jump in just because they weren't there to tear you apart the first time? |
Nah, but this is coding related, whats the worst that can happen? |
Crashes (for which there are many types), bugs, conflicts, computer explosions and inoperability. I always check CLEO scripts I download for crappiness like bad use of global variables. If the mod is bad, I don't use it. So there's another scenario, people get sick of using scripts that cause bugs and crashes. You could loose the interest of impatient users and as a developer, you should always assume the end-user is dumb and ill-tempered. And sure, you have the freedom to jump into the sea of sharks, I just beg you not to encourage others to do the same.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
The_Sorrow  |
Posted: Thursday, Apr 12 2012, 10:50
|
Heaven, I'm in heaven(8)

Group: Members
Joined: May 31, 2010


|
| QUOTE (Deji @ Thursday, Apr 12 2012, 10:39) | | QUOTE (The_Sorrow @ Thursday, Apr 12 2012, 10:32) | | QUOTE (Deji @ Thursday, Apr 12 2012, 10:31) | | QUOTE (The_Sorrow @ Thursday, Apr 12 2012, 10:26) | | CODE | 04C4: store_coords_to $1 $2 $3 from_actor $PLAYER_ACTOR with_offset 1.0 3.0 1.0
|
$1 $2 and $3 are global variables, Although everybody advises not to use them I have always used them and had no problems |
If someone tells you not to jump off a cliff into the sea because there are sharks at the bottom, will you still jump in just because they weren't there to tear you apart the first time? |
Nah, but this is coding related, whats the worst that can happen? |
Crashes (for which there are many types), bugs, conflicts, computer explosions and inoperability.
I always check CLEO scripts I download for crappiness like bad use of global variables. If the mod is bad, I don't use it. So there's another scenario, people get sick of using scripts that cause bugs and crashes. You could loose the interest of impatient users and as a developer, you should always assume the end-user is dumb and ill-tempered.
And sure, you have the freedom to jump into the sea of sharks, I just beg you not to encourage others to do the same. | Do sharks interest you?
OT: Scroll up for the solution to your problem!
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
ZAZ  |
Posted: Thursday, Apr 12 2012, 12:28
|
Kernlochbohrer

Group: Members
Joined: Jan 10, 2005



|
| QUOTE (The_Sorrow @ Thursday, Apr 12 2012, 10:50) | | QUOTE (Deji @ Thursday, Apr 12 2012, 10:39) | | QUOTE (The_Sorrow @ Thursday, Apr 12 2012, 10:32) | | QUOTE (Deji @ Thursday, Apr 12 2012, 10:31) | | QUOTE (The_Sorrow @ Thursday, Apr 12 2012, 10:26) | | CODE | 04C4: store_coords_to $1 $2 $3 from_actor $PLAYER_ACTOR with_offset 1.0 3.0 1.0
|
$1 $2 and $3 are global variables, Although everybody advises not to use them I have always used them and had no problems |
If someone tells you not to jump off a cliff into the sea because there are sharks at the bottom, will you still jump in just because they weren't there to tear you apart the first time? |
Nah, but this is coding related, whats the worst that can happen? |
Crashes (for which there are many types), bugs, conflicts, computer explosions and inoperability.
I always check CLEO scripts I download for crappiness like bad use of global variables. If the mod is bad, I don't use it. So there's another scenario, people get sick of using scripts that cause bugs and crashes. You could loose the interest of impatient users and as a developer, you should always assume the end-user is dumb and ill-tempered.
And sure, you have the freedom to jump into the sea of sharks, I just beg you not to encourage others to do the same. |
Do sharks interest you?
OT: Scroll up for the solution to your problem! |
I cofirm to Deji agian and again. I often could experienced that gloabals of cleo corrupt globals of main. As i converted the carmod externscript as cleo which have a lot of globals i got heavy bugs and sometimes crashes So i converted all globals in locals and got a fine working script this script is now a part of my Pimp My Car modJust a few globals in cleoscripts seems to don't have an effect unless while running a mission at same times which use a global I also sceptical about the globals of Sanny Builder 3\data\sa\CustomVariables.ini I tested one of these globals in a cleo mission to display a status bar I went into ammunation while status bar was on and got a failure in the meue text So please don't teach, use globals For cleo we have extra opcodes 0AB3: and 0AB4: The expression var together with a number, <var><space><number> is builing the Special Global Cleo Variable or | CODE | 0006: 13@ = 10 // integer values 0AB3: var 0 = 13@ |
and to get then stored value into your script needs to submit into a local: | CODE | 0AB4: 13@ = var 44 if 0039: 13@ == 1 // integer values 004D: jump_if_false @nextlabel |
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
BnB  |
Posted: Thursday, Apr 12 2012, 16:02
|
sh*t Happens

Group: Members
Joined: Jun 28, 2010



|
| QUOTE (MichaelKnight1 @ Thursday, Apr 12 2012, 11:36) | | QUOTE (rhedge004 @ Thursday, Apr 12 2012, 06:39) | Hey guys can i ask how to create objects or spawn objects in front of CJ.. For example i want to spawn a box or tree in front of CJ whats the code?? Im new at coding so please help me.. |
Not feasible, we will help you now and then after that ?? . you must Studying the application of The educational .
| QUOTE | how to create objects or spawn objects in front of CJ |
From your words mean to put Object in front of CJ ok so .
| CODE | 04C4: store_coords_to 3@ 4@ 5@ from_actor $PLAYER_ACTOR with_offset 2.0 2.0 0.0
|
These coordinates is not with SA Place Manager . . . You can use 3ds Max or Zmodeler . ok Then Create Object At 3@ - 4@ - 5@
| CODE | 0107: 6@ = create_object #AD_FLATDOOR at 3@ 4@ 5@
|
warning ; not using Global variables in cleo scripts, it can cause bugs or crashes! | I must say this post was no helpful at all, in fact it will confuse the OP. So, please stay out of this topic.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|
|
|
|