Jump to content

[CLEO4]NewOpcodes by DK22Pac


Recommended Posts

NewOpcodes 2.0 TEST available here:

https://www.mediafire.com/?ck6nw8rb4y94704

Probably because they aren't yet re-made, and he doesn't want to release something unstable?

 

Though, great work! Can't unfortunately try it out though.

beside, the source is available so it's possible to build our own library... :D

I found a bug related to new plugin.dll inside NO

here's the log...

 

AllocateAdditional: allocating vehicle data for 110 vehicles
AllocateAdditional: allocating ped data for 140 peds
OnPedConstructor: ped 263125888, pedId - 0, pedCounter - 1
OnPedConstructor: no ped plugins registered
ReleaseAdditional: releasing vehicle data (0 vehicle plugins were registered)
ReleaseAdditional: releasing ped data (0 ped plugins were registered)

 

Mod installed : NO and IMFX Explosion update

CLEO Library used : CLEO 4.3.13

gta_sa.exe : 14 383 616 bytes Hoodlum crack

  • 1 month later...
I wanna read the notes of _switch_example that you added, but I can't understand what you wrote in there :(

could you help me out, translating these parts in the text file?


I can't use a translator, this is what I see in the _switch_example



// 0@ - Ïîòî÷íûé ID ïîãîäû
// 1@ - Ôëàã òåêñò-áîêñà. 1 - íóæíî ïîêàçàòü òåêñò áîêñ, 0 - íå íóæíî


// Êîíñòðóêöèÿ switch èñïîëüçóåòñÿ ïîçâîëÿåò âûáðàòü äåéñòâèå â çàâèñèìîñòè îò çíà÷åíèÿ ïåðåìåííîé.
//
// {$I switch(<ÏÅÐÅÌÅÍÍÀß>)} // Íà÷àëî êîíñòðóêöèè
//
// {$I case <ÇÍÀ×ÅÍÈÅ1>}
// // Êîä, êîòîðûé âûïîëíèòñÿ, åñëè ÏÅÐÅÌÅÍÍÀß ðàâíà ÇÍÀ×ÅÍÈÞ1.
// break - âûõîä èç êîíñòðóêöèè.
//
// {$I case <ÇÍÀ×ÅÍÈÅ2>}
// // Êîä, êîòîðûé âûïîëíèòñÿ, åñëè ÏÅÐÅÌÅÍÍÀß ðàâíà ÇÍÀ×ÅÍÈÞ2.
// break - âûõîä èç êîíñòðóêöèè.
//
// ...
//
// // Òàêæå â êîíñòðóêöèè ìîæíî èñïîëüçîâàòü ñïåöèàëüíûé ñëó÷àé, èìåíîâàííûé êàê default.
// {$I default}
// // Êîä, êîòîðûé âûïîëíèòñÿ, åñëè ïåðåìåííàÿ íå ðàâíà íè îäíîìó èç ÇÍÀ×ÅÍÈÉ.
//
// {$I switch_end} // Çàâåðøåíèå êîíñòðóêöèè



// Ôóíêöèÿ ñâåðÿåò, íàæàòà ëè êëàâèøà, è â ñëó÷àå íàæàòèÿ - æä¸ò, ïîêà êëàâèøà íå áóäåò îòïóùåíà.


// 0@ - ID êëàâèøè


// Ôóíêöèÿ îãðàíè÷èâàåò ÷èñëî â óêàçàííûõ ðàìêàõ.


// 0@ - ÷èñëî
// 1@ - íèæíÿÿ ãðàíèöà îãðàíè÷åíèÿ
// 2@ - âåðõíÿÿ ãðàíèöà îãðàíè÷åíèÿ


// Âîçâðàùàåìîå çíà÷åíèå: ÷èñëî â óêàçàííûõ ðàìêàõ


thanks.. :lol:

translated with google translator ;)

works like a normal switch;)

http://www.tutorialspoint.com/cprogramming/switch_statement_in_c.htm

 

 

 

{$ CLEO}{$ I switch}/ / 0 @ - ID Flow Forecast/ / 1 @ - Flag text-box. 1 - you need to show the text box, 0 - nowhile true    wait 0    if        0AB1: call_scm_func @ KeyJustPressed _vkey 1 219    then        @ 0 -        0AB1: call_scm_func @ Limit 3 0 0 @ _min _max 22 _ret 0 @        1 @ 1 =    else        if            0AB1: call_scm_func @ KeyJustPressed _vkey 1 221        then            0 @ + +            0AB1: call_scm_func @ Limit 3 0 0 @ _min _max 22 _ret 0 @            1 @ 1 =        end    end    if        1 @ == 1    then        @ 1 = 0        set_weather 0 @        01B7: release_weather        / / The switch statement is used allows you to select an action based on the value of the variable.        / /        / / {$ I switch (<VARIABLE>)} / / Start of construction        / /        / / {$ I case <value1>}        / / / / Code to execute if variable is ZNACHENIYU1.        / / Break - out of the structure.        / /        / / {$ I case <value2>}        / / / / Code to be executed if the variable is equal to value2.        / / Break - out of the structure.        / /        / / ...        / /        / / / / Also can be used in the construction of a special case, as the named default.        / / {$ I default}        / / / / Code to execute if the variable is not equal to any of the values.        / /        / / {$ I switch_end} / / End of construction        {$ I switch (0 @)}            {$ I case 0}                0ACA: show_text_box "0 - Los Santos - Extra Sunny"                break            {$ I case 1}                0ACA: show_text_box "1 - Los Santos - Sunny"                break            {$ I case 2}                0ACA: show_text_box "2 - Los Santos - Extra Sunny Smog"                break            {$ I case 3}                0ACA: show_text_box "3 - Los Santos - Sunny Smog"                break            {$ I case 4}                0ACA: show_text_box "4 - Los Santos - Cloudy"                break            {$ I case 5}                0ACA: show_text_box "5 - San Fierro - Sunny"                break            {$ I case 6}                0ACA: show_text_box "6 - San Fierro - Extra Sunny"                break            {$ I case 7}                0ACA: show_text_box "7 - San Fierro - Cloudy"                break            {$ I case 8}                0ACA: show_text_box "8 - San Fierro - Rainy"                break            {$ I case 9}                0ACA: show_text_box "9 - San Fierro - Foggy"                break            {$ I case 10}                0ACA: show_text_box "10 - Las Venturas - Sunny"                break            {$ I case 11}                0ACA: show_text_box "11 - Las Venturas - Extra Sunny"                break            {$ I case 12}                0ACA: show_text_box "12 - Las Venturas - Cloudy"                break            {$ I case 13}                0ACA: show_text_box "13 - Countryside - Extra Sunny"                break            {$ I case 14}                0ACA: show_text_box "14 - Countryside - Sunny"                break            {$ I case 15}                0ACA: show_text_box "15 - Countryside - Cloudy"                break            {$ I case 16}                0ACA: show_text_box "16 - Countryside - Rainy"                break            {$ I case 17}                0ACA: show_text_box "17 - Desert - Extra Sunny"                break            {$ I case 18}                0ACA: show_text_box "18 - Desert - Sunny"                break            {$ I case 19}                0ACA: show_text_box "19 - Desert - Sandstorm"                break            {$ I case 20}                0ACA: show_text_box "20 - Underwater"                break            {$ I case 21}                0ACA: show_text_box "21 - Extracolours 1"                break            {$ I case 22}                0ACA: show_text_box "22 - Extracolours 2"        {$ I switch_end}    endend/ / This function checks, whether the key is pressed, and if you press - waits until the key is released.: KeyJustPressed/ / 0 @ - ID keysif    0AB0: key_pressed 0 @then    while 0AB0: key_pressed 0 @        wait 0    end    0485: return_true    0AB2: ret 0end059A: return_false0AB2: ret 0/ / This function limits the number specified in the framework.: Limit/ / @ 0 - number/ / 1 @ - lower limit restrictions/ / @ 2 - the upper bound limit/ / Return value: The number specified in the framework ofif    802D: not 0 @> = 1 @then    0085: 0 @ = 2 @else    if        001D: 0 @> 2 @    then        0085 0 = 1 @ @    endend0AB2: ret 1 0 @
Edited by miclin

mm It seems that there are missing opcodes definitions in SASCM.ini

the last opcode definition is this one:

0D73=3,get_screen_width_to %2d% height_to %3d% type %1d%

and I want to use these opcodes:

0D74: 1@ = component 0@ parent_component0D75: 1@ = component 0@ num_objects0D76: 1@ = component 0@ object 00D77: object_atomic 0@ hide 10D78: 2@ = get_object 0@ atomic_flag 1@0D79: set_object %1d% atomic_flag %2d% state %3d%0D7A: 1@ = get_object 0@ num_materials // IF and SET0D7B: 1@ = get_object 0@ material 0 texture // IF and SET0D7C: 0@ = load_texture_dds_from "image.dds" // IF and SET0D7D: clean_loaded_texture 0@0D7E: draw_sprite_with_texture 0@ at_cornerA 100.0 100.0 cornerB 300.0 300.0 color 255 255 255 255 angle 0.00D7F: draw_gradient_sprite_with_texture 0@ at_cornerA 100.0 100.0 cornerB 300.0 300.0 colors 255 255 255 255  255 255 255 255  255 255 255 255  255 255 255 255 angle 0.0

but they don't exist in SASCM_new.ini

Whenever I try to compile the "Sunlight" script, I get an error that says "Couldn't load stdc". What does this mean? Here's the sunlight script btw

 

 

/*  NewOpcodes 2.0  Example script: SunLight  Creates a pointlight for game sun. Makes game dynamic objects pre-lighted with (d, e, f) color.*/{$CLEO}{$I stdc}var    d: array 3 of floatend{$I inloop}00BF: a = current_time_hours, b = current_time_minutes077E: get_active_interior_to bif and    b == 0    a > 6    0D57: get_sun_position_to a b cthen    0D55: get_sun_colors_core_to d e f glow_to d e f    for i = 0 to 2        0093: d[i] = integer d[i] to_float        0017: d[i] /= 2.0        0092: d[i] = float d[i] to_integer    end    0D52: draw_light_type LIGHT_DEFAULT position a b c direction 0 0 0 radius 6000.0 RGB d e f affect_entity NULLend{$I end}

 

 

 

EDIT: I know this is off-topic, but ImVehFt sometimes works and sometimes crashes for me. But once it crashes, even if I reinstall ImVehFt, the crash does not go away. If anyone knows what causes this could they PM me as I don't want to de-rail this topic. Thanks.

Edited by SergeantSavidge
  • 4 weeks later...

 

Whenever I try to compile the "Sunlight" script, I get an error that says "Couldn't load stdc". What does this mean? Here's the sunlight script btw

*

put the "stdc" file in the same place where you will save the script.

 

 

You're right.

Here's the correct version link

 

hey I have a question, the new opcode-textures, the dimension of the textures aren't proportional to the resolutions?
I mean, if I have resolution of 1920*1080 with something like;
0D7E: draw_sprite_with_texture 0@ at_cornerA 1030.0 0.0 cornerB 1930.0 1005.0 color 255 255 255 200 angle 0.0

it looks, nice.

but when changing resolution to 1280*720, texture dissapears.
or practically draw texture out of the display.
that means, that it is necesary to change those values of cornerA & cornerB for each resolution? :/

 

thanks ;)

0D73=3,get_screen_width_to %2d% height_to %3d% type %1d% Gets game sfx and radio volume. Param 1: value type to return, see Param types in stdc...........................[int Param types] Param 2: var to store screen width, or NULL if this value is not needed..........[var: int|float] Param 3: var to store screen height, or NULL if this value is not needed.........[var: int|float] 

This description is wrong!? Schouldn't it be "Gets the screen width and height".

 

And a idea for newOpcodes:

attach_object to current weapon %1d offset %2d %3d %4d
Edited by miclin
  • 7 months later...

Is it possible to attach corona to a vehicle part? For example chassis, or bonnet, or whatever it called?

 

I only found this:

 

0D54=18,draw_corona_with_extra_params_texture %1d% color %2d% %3d% %4d% %5d% on_entity %6d% at %7d% %8d% %9d% size %10d% far_clip %11d% near_clip %12d% flare %13d% enable_reflection %14d% check_obstacles %15d% flash_while_fading %16d% fade_speed %17d% only_from_below %18d% 
but this works for whole vehicle, and not for vehicle parts. (gives opcodes and crash)

 

edit: "Unknown directive sprite.Draw(6@, 100.0, 100.0, 600.0, 400.0, 255, 255, 255, 200, 0.0)." error when compiling txd.txt example. Tried to use manual opcode by "0D7E: draw_sprite_with_texture 6@ at_cornerA 100.0 100.0 cornerB 600.0 400.0 color 255 255 255 200 angle 0.0" but then I get "unknown opcode 0D7E" error message. Installed all files, checked three times already. Installed NO v2.1.

 

Is this require latest cleo or something?

Edited by nyolc8

It looks like you haven't changed classes.db and the class 'Sprite' is undefined.

 

Also, you can't attach corona to vehicle part with that opcode.

Just realized I need to add the file content to old files... I just copied them into the folder :D Thanks

 

Is there any solution to attach corona to vehicle part? The problem is that corona doesn't following the movement of the swinging chassis if I attach corona to vehicle struct. Or if there's a solution to disable swinging chassis on vehicles with cleo? :)

Edited by nyolc8
  • 1 month later...

Can someone show an example for 0D40?

I try to use it but I don't even understand where it draws the shape(no coordinate parameter at all...?) and such things.

 

This is what in the help file:

 

0D40=8,draw_2d_shape_type %3d% texture %4d% numVerts %2d% pVerts %1d% vertexAlpha %5d% srcBlend %6d% dstBlend %7d% priority %8d% 
Tried to fill it from stdc parameters for testing, but my game just crashes.
  • 9 months later...

 

lvjq.png

Finally released as test version smile.gif

 

If you downloaded the archive, all you wanted to see (documentation/examples) is already there.

 

Download v2.1 27.08.14

 

I'll update this post later.

Thx to all who will help me to test it. smile.gif

 

Hello Mr. dk22

I thank you because you've designed a opcode that's helped me build my game GTA

I could movable components machines by using your opcode

Only now I have a problem, please help me

I want to write code that can do object connected to car component, so that when that move part of the car, such as dump trailers, object move with that part of the car

This mod is very important for me, please help me

This e-mail me, please email me the answer

[email protected]

I want to be associated with you in the way of disigne my game to help me

I'm sorry because my English is not so good.

very very very Thanks

  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.