Quantcast

Jump to content

» «
Photo

_DK's newOpcodes issue

11 replies to this topic
Danikov
  • Danikov

    The Fake Russian

  • Members
  • Joined: 27 Aug 2009
  • Israel

#1

Posted 27 December 2013 - 12:06 PM Edited by Danikov, 27 December 2013 - 12:06 PM.

As the title reads,I have an issue with _DK's newOpcodes,the thing is when I am trying to compile a script that uses one of the new opcodes,Sanny Builder displays an error window reading that the Opcode is unknown.

The NEW_SASCM.ini and SASCM.ini along with the New Opcodes and stdc file are placed in my game's directory.

Maybe I have placed the newOpcodes' files in the wrong places or I am just doing it wrong?

fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • None

#2

Posted 27 December 2013 - 12:46 PM

In order to make Sanny Builder aware of new opcodes, you need to put new SASCM.ini in "Sanny Builder\data\SA" directory.

Danikov
  • Danikov

    The Fake Russian

  • Members
  • Joined: 27 Aug 2009
  • Israel

#3

Posted 27 December 2013 - 01:13 PM Edited by Danikov, 27 December 2013 - 01:14 PM.

In order to make Sanny Builder aware of new opcodes, you need to put new SASCM.ini in "Sanny Builder\data\SA" directory.

 

Thank you very much,it now compiles.

 

But I am having an other issue with my script,it appears to be that my script is done incorrectly.

 

I don't know how to work with the new directives,I copied what _DK had posted in the newopcodes topic and altered it by adding a condition which would trigger the texture on the vehicle,the condition is: 

0119: is_car_dead veh 

The part of the script is from _DK's topic:

{$CLEO}
{$I stdc}
0D61: t = load_texture_from "textures\brick.bmp" with_mask NULL // IF and SET
{$I inloop}
   0AB1: call_scm_function @drawTexturedCircle params 13 pos_x 250.0 pos_y 250.0 radius 150.0 step 6.0 texture t priority PRIORITY_OVER_HUD color_RGBA 255 255 255 255 angle -45.0 invert_x false invert_y false
   0AB1: call_scm_function @drawTexturedQuad params 11 pos_x 450.0 pos_y 100.0 size 300.0 texture t priority PRIORITY_OVER_HUD color_RGBA 255 255 255 255 invert_x false invert_y false
   {$I forplayercar}
       0D62: set_car veh remap_texture t
       0D63: set_car veh color 1 RGB 255 255 255
       0407: store_coords_to a b c from_car veh with_offset -2.0 0.0 0.0
       0174: d = car veh z_angle
       0D50: draw_shadow_type TYPE_LIGHT position a b c width 2.5 height 2.5 rotation d distance 2.0 texture t intensity 1 RGB 150 150 150 shadow_data NULL
       0A97: s = car veh struct
       0D53: draw_corona_with_texture t color 255 255 255 150 on_entity s at 0.0 -3.0 1.0 size 1.0
   {$I for_end}
{$I end}
{$I drawtexturedcircle.scmf}
{$I drawtexturedquad.scmf}

Where do I need to put the if and the then directives along with the other directives in the script?


fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • None

#4

Posted 27 December 2013 - 01:21 PM Edited by fastman92, 27 December 2013 - 01:22 PM.

Where you need it
if .. then .. end construct executes a code only if condition is true.

Probably you should put it within{$I forplayercar} block.
There's where you have a vehicle loop.

Danikov
  • Danikov

    The Fake Russian

  • Members
  • Joined: 27 Aug 2009
  • Israel

#5

Posted 27 December 2013 - 01:42 PM Edited by Danikov, 27 December 2013 - 01:43 PM.

Thank you very much,the game is running with the script.

 

It appears to be that I am still doing something wrong,the texture I want to use isn't working,instead,I have a white circle and suqare on the screen which could mean I am doing something wrong with the textures?,the texture is in .bmp format.

And exploded cars only turn white because of opcode 0D63.

here's the code :

{$CLEO}
{$I stdc}
0D61: t = load_texture_from "test.bmp" with_mask NULL // IF and SET
{$I CLEO\inloop}
   0AB1: call_scm_function @drawTexturedCircle params 13 pos_x 250.0 pos_y 250.0 radius 150.0 step 6.0 texture t priority PRIORITY_OVER_HUD color_RGBA 255 255 255 255 angle -45.0 invert_x false invert_y false
   0AB1: call_scm_function @drawTexturedQuad params 11 pos_x 450.0 pos_y 100.0 size 300.0 texture t priority PRIORITY_OVER_HUD color_RGBA 255 255 255 255 invert_x false invert_y false
   {$I CLEO\forallcars}
       if
       0119: is_car_dead veh 
       then
       0D62: set_car veh remap_texture t
       0D63: set_car veh color 1 RGB 255 255 255
       0407: store_coords_to a b c from_car veh with_offset -2.0 0.0 0.0
       0174: d = car veh z_angle
       0D50: draw_shadow_type TYPE_LIGHT position a b c width 2.5 height 2.5 rotation d distance 2.0 texture t intensity 1 RGB 150 150 150 shadow_data NULL
       0A97: s = car veh struct
       0D53: draw_corona_with_texture t color 255 255 255 150 on_entity s at 0.0 -3.0 1.0 size 1.0
       end
   {$I CLEO\for_end}
{$I CLEO\end}
{$I CLEO\drawtexturedcircle.scmf}
{$I CLEO\drawtexturedquad.scmf}

fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • None

#6

Posted 27 December 2013 - 02:01 PM

I won't be able to help with new opcodes, i never used it.
If you don't figure it out yourself, then wait for DK22, an author of new opcodes plugin.

Danikov
  • Danikov

    The Fake Russian

  • Members
  • Joined: 27 Aug 2009
  • Israel

#7

Posted 29 December 2013 - 07:24 PM

I am now having problems with the opcode(Example taken from the New Opcodes.txt file):

0D0E: set_car 0@ component "bump_front_dummy" state STATE_DAM // IF and SET

When trying to compile,I get an error message reading : " Not enough actual parameters. Expected 3 params. "

It has car handle,component name and the state of that component,here's the list of the new opcodes explained in his blog post:

0D0E=3,set_car %1d% component %2s% state %3d% // IF and SET 
Sets component state. 
Param 1: car handle 
Param 2: component name 
Param 3: state, see Component states in stdc 

DK22Pac
  • DK22Pac

    Where I Know You From

  • Feroci
  • Joined: 12 Apr 2009
  • Ukraine

#8

Posted 30 December 2013 - 01:48 AM

You didn't include constants file, don't you see STATE_DAM is a constant?
{$I stdc}

Danikov
  • Danikov

    The Fake Russian

  • Members
  • Joined: 27 Aug 2009
  • Israel

#9

Posted 30 December 2013 - 05:44 PM Edited by Danikov, 30 December 2013 - 05:45 PM.

You didn't include constants file, don't you see STATE_DAM is a constant?

{$I stdc}

 

Oh,crap,how did I miss that,thanks!

 

also,I am having a problem with another opcode of yours,I am sort of trying to subtract floats stored from opcode 0D5F and floats stored from opcode 00AA in order to achieve offset values.

 

Here's the code :

    {$I CLEO\forallcars}
    {$I stdc}
    00AA: store_car veh position_to 22@ 23@ 24@
    0D5F: get_vehicle veh dummy_element DUMMY_EXHAUST position WORLD to 19@ 20@ 21@ invert_x false 
    0063: 19@ -= 22@
    0063: 20@ -= 23@
    0063: 21@ -= 24@

Whenever Opcode 0D5F is present in the script,the game crashes,what am I doing wrong this time?


DK22Pac
  • DK22Pac

    Where I Know You From

  • Feroci
  • Joined: 12 Apr 2009
  • Ukraine

#10

Posted 30 December 2013 - 07:27 PM

Try do delete SCMlog if it is installed. Plugins made with CLEO SDK have some problems with it...

Danikov
  • Danikov

    The Fake Russian

  • Members
  • Joined: 27 Aug 2009
  • Israel

#11

Posted 30 December 2013 - 07:41 PM

Try do delete SCMlog if it is installed. Plugins made with CLEO SDK have some problems with it...

 

 

Removed SCMLog folder which was in this path : Sanny Builder 3\Tools\CLEO 3\

 

Unfortunately,Game still crashing.


MasterHK
  • MasterHK

    کیان حامی‏

  • Members
  • Joined: 20 Mar 2013
  • Iran

#12

Posted 13 January 2014 - 03:45 PM

Remove SCMLog from game\cleo. : |





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users