Quantcast

Jump to content

» «
Photo

Pickups spawn during missions

3 replies to this topic
Thedissagreement
  • Thedissagreement

    my first and best year at modding!

  • Members
  • Joined: 01 Jun 2011
  • None

#1

Posted 11 June 2014 - 09:37 PM

Hi, this if a follow-up on my last topic.

 

 

{$VERSION 3.1.0027}
{$CLEO .cs}
 
//-------------MAIN---------------
thread "PARK" 
wait 1000 
0A95: enable_thread_saving 
014B: 1@ = init_parked_car_generator #NRG500 color -1 -1 1 alarm 0 door_lock 0 0 10000 at 2481.879 -1691.542 13.5142 angle 0.0 
014C: set_parked_car_generator 1@ cars_to_generate_to 101 
00d6: = if $PLAYER_CHAR , $ONMISSION
032B: $811 = create_weapon_pickup #MP5LNG group 15 ammo 30 at 2492.613 -1671.64 13.3359 
0A93: end_custom_thread 
 
This code is supposed to spawn an NRG in grove street and spawn an mp5 in grove street too but only if the player (CJ) is on a mission, however when i try to compile it gives me an error: 'Incorrect number of the conditions. Use number from 0 to 8 or from 21 to 28.' on line '032B:...' Please help!
Thanks in advance! ;)

Danikov
  • Danikov

    The Fake Russian

  • Members
  • Joined: 27 Aug 2009
  • Israel

#2

Posted 13 June 2014 - 09:50 AM


Hi, this if a follow-up on my last topic.
 
 
{$VERSION 3.1.0027}
{$CLEO .cs}
 
//-------------MAIN---------------
thread "PARK" 
wait 1000 
0A95: enable_thread_saving 
014B: 1@ = init_parked_car_generator #NRG500 color -1 -1 1 alarm 0 door_lock 0 0 10000 at 2481.879 -1691.542 13.5142 angle 0.0 
014C: set_parked_car_generator 1@ cars_to_generate_to 101 
00d6: = if $PLAYER_CHAR , $ONMISSION
032B: $811 = create_weapon_pickup #MP5LNG group 15 ammo 30 at 2492.613 -1671.64 13.3359 
0A93: end_custom_thread 
 
This code is supposed to spawn an NRG in grove street and spawn an mp5 in grove street too but only if the player (CJ) is on a mission, however when i try to compile it gives me an error: 'Incorrect number of the conditions. Use number from 0 to 8 or from 21 to 28.' on line '032B:...' Please help!
Thanks in advance! ;)


The compiler tells you where's the problem,its in the line which has the 032B opcode.
The first thing I want to say is that you better not use global variables ($x) for an opcode variable as that the $x variable may already be used in the main.scm and that would cause trouble,stick to local variables (@x).
Secondly, there's a range for the numbers of variables to use,I cannot remember what is the range of variable numbers,but I think its from 0 to around 30.

So basically,what you should do is to use a local variable such as @2 instead of the global variable $811.

Deji
  • Deji

    Coding like a Rockstar!

  • Feroci
  • Joined: 24 Dec 2007
  • None

#3

Posted 13 June 2014 - 05:21 PM

The first thing I want to say is that you better not use global variables ($x) for an opcode variable as that the $x variable may already be used in the main.scm


True in essence. But it doesn't matter what you call the variable, because without modifying SB the first global variable used in any CLEO script will be given the exact same var index.

Secondly, there's a range for the numbers of variables to use,I cannot remember what is the range of variable numbers,but I think its from 0 to around 30.


31@ is the last "general use" variable. 32@ and 33@ are timers. They can be used temporarily as general use but its value will be modified the next time 'WAIT 0' is encountered and is not recommended.


00d6: = if $PLAYER_CHAR , $ONMISSION


What the hell is that supposed to be?

OrionSR
  • OrionSR

    Chain Game Development Team

  • Feroci
  • Joined: 23 May 2007
  • None
  • Helpfulness Award [GTA & Modding]

#4

Posted 13 June 2014 - 07:40 PM

We've been making a little progress in the TC's Hidden Pickups topic. It might be best to keep the conversation in one spot.

 

I figured that strange code was either a format from a different compiler, or psudocode for: IF (and 00d6:) the player is defined AND on a mission, THEN... So if both conditions evaluate as true ( == 1) then execute the following code. Something more appropriate for Sanny was offered in the other topic.

 

BTW, the $811 code is simply copied directly from the opcode search, with the coordinates adjusted. I just changed that without comment. I figured we can argue about globals when he's trying to figure out how to flag the weapon as already spawned.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users