Quantcast

Jump to content

» «
Photo

The Modders Lounge

250 replies to this topic
SergeantSavidge
  • SergeantSavidge

    BUD3_6

  • Members
  • Joined: 29 Dec 2013
  • United-Kingdom

#241

Posted 04 March 2014 - 07:15 PM

Hi guys, I have something that you'll probably be able to answer. Okay, so I have this traffic CLEO4 script and what it does is make the vehicle AI similar to the police vehicles' AI (meaning that they don't stop from going 200km/h instantly) and it works great, but I would like to add something to it but I'm not entirely sure on how to approach it. I want to make the drivers not get impatient when waiting at a red light, so it adds realism. Can anybody point me in the right direction? It would be very much appreciated. Also, thanks for reading.

 

This is the current script btw:

Spoiler

  • Concavax likes this

Deji
  • Deji

    Coding like a Rockstar!

  • Members
  • Joined: 24 Dec 2007

#242

Posted 05 March 2014 - 07:26 PM

Hi guys, I have something that you'll probably be able to answer. Okay, so I have this traffic CLEO4 script and what it does is make the vehicle AI similar to the police vehicles' AI (meaning that they don't stop from going 200km/h instantly) and it works great, but I would like to add something to it but I'm not entirely sure on how to approach it. I want to make the drivers not get impatient when waiting at a red light, so it adds realism. Can anybody point me in the right direction? It would be very much appreciated. Also, thanks for reading.


From my experience, peds do not get impatient waiting at lights. They seem to get impatient waiting behind other vehicles though, which may or may not be waiting at lights. You could either target the entire impatient behaviour or do something a little more complex by checking if the vehicle is at lights or is waiting behind vehicle which is waiting at lights, and so on...

This opcode could help you not require at least one hack (I don't really "dig" CLEO-hosted memory hacks as much as I used to):
0987: get_car_blocking_car $1867 store_to $VALET_CAR
  • SergeantSavidge likes this

SergeantSavidge
  • SergeantSavidge

    BUD3_6

  • Members
  • Joined: 29 Dec 2013
  • United-Kingdom

#243

Posted 06 March 2014 - 08:34 PM

...This opcode could help you not require at least one hack (I don't really "dig" CLEO-hosted memory hacks as much as I used to):

0987: get_car_blocking_car $1867 store_to $VALET_CAR

Thanks a bunch, Deji, this'll work well I think. :)


_DK
  • _DK

    Beчнo пьяный.

  • Members
  • Joined: 12 Apr 2009
  • Ukraine

#244

Posted 08 March 2014 - 02:25 AM

Shader API now can work with depth buffer texture.
{$CLEO}
{$I stdc}
{$I shaderApi}

var
    0@: shader
end

if
    0@ = shader.Load("CLEO\shader.fx")
then
    while true
        wait 0
        0A8D: 1@ = read_memory 0xC1703C size 4 virtual_protect 0
        1@ += 0x80
        0A8D: 2@ = read_memory 1@ size 4 virtual_protect 0
        0@.SetFloat("nearZ", 2@)
        1@ += 4
        0A8D: 2@ = read_memory 1@ size 4 virtual_protect 0
        0@.SetFloat("farZ", 2@)
        0@.Draw("ShowScreen", SCREEN_BASE_X, SCREEN_BASE_Y, SCREEN_HALF_X, SCREEN_SIZE_Y)
        0@.Draw("ShowDepth", SCREEN_HALF_X, SCREEN_BASE_Y, SCREEN_SIZE_X, SCREEN_SIZE_Y)
    end
else
    0ACD: show_text_highpriority "Error compiling shader.fx" time 5000
    0A93: end_custom_thread
end
Added extra parameters SCREEN_HALF_X, SCREEN_HALF_Y
Shader simply displays screen color and linearized depth of pixel.
texture screen : SCREEN_TEX;
texture depth : DEPTH_TEX;

float farZ;
float nearZ;

sampler2D screenSampler = sampler_state
{
    Texture = <screen>;
};

sampler2D depthSampler = sampler_state
{
    Texture = <depth>;
};

float4 PS_screen(float2 tex: TEXCOORD0): COLOR
{
    return float4(tex2D(screenSampler, tex).rgb, 1);   
}

float4 PS_depth(float2 tex: TEXCOORD0): COLOR
{
    float z = (2.0 * nearZ) / (farZ + nearZ - tex2D(depthSampler, tex).r * (farZ - nearZ)); 
    return float4(z, z, z, 1);    
}

technique ShowScreen
{
    pass P0
    {
        PixelShader  = compile ps_2_0 PS_screen();
    }
}

technique ShowDepth
{
    pass P0
    {
        PixelShader  = compile ps_2_0 PS_depth();
    }
}
k8k0.th.png
  • Silent, LINK/2012, TJGM and 1 other like this

_DK
  • _DK

    Beчнo пьяный.

  • Members
  • Joined: 12 Apr 2009
  • Ukraine

#245

Posted 10 March 2014 - 01:10 AM Edited by _DK, 10 March 2014 - 01:29 AM.

Do you remember that thing?
When you remove weapon from ped, game gives him another one? Oh shi...

p2g1.th.png
Some addresses for weapon types btw (possibly were found before):
0x5E8C5F [byte] Weapon id for weapon which game gives for a new gang member in player group (default=22)
0x5E8C68 [byte] Same as above, must be patched too (default=22)
  • Concavax likes this

ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#246

Posted 4 weeks ago

Do you remember that thing?
When you remove weapon from ped, game gives him another one? Oh shi...

 
no, never noticed, will have look in the future
 
---------------------------------------------------------------------------
 
I got a wiered bug last weekend
all painjobs of all cars had ped textures instead the paintjob
anyone ever had the same?
i found out that it was caused by limit adjuster when i activated the [Static Limit] Vehicle Models=212
i did that because the tut for addcars said, we should use and increase this option
meanwhile i know, i don't need limit adjuster and don't need streammemfix or anything else to get addcars working

5yszqgeS.jpg idR8og61.jpg JWHzbWUA.jpg
5Hm9axJE.jpg lHtAwMJH.jpg iQwZC37A.jpg

nWo51289
  • nWo51289

    Outcast

  • Members
  • Joined: 26 Apr 2008

#247

Posted 4 weeks ago Edited by nWo51289, 4 weeks ago.

Urgh, that was one of the reasons why I hated adding vehicles, is it just a bug with SALA or adding vehicles in general?

___________________________________________________

I've suffered with this problem ever since I started modding SA. Yes streaming memory is the culprit but....was wondering if there is something like a txdpool in SA, or is it these below that has something to do with txds? (Below could very well be wrong, I am a Cleo noob!)

0A8C: write memory 0x05DA08E size 4 value 32000 virtual_protect 0 //ENV_MAP_MATERIAL_POOL Data Pool Size default=4096
0A8C: write memory 0x05DA0CA size 4 value 16000 virtual_protect 0 //ENV_MAP_ATOMIC_POOL Data Pool Size default=1024
0A8C: write memory 0x05DA106 size 4 value 32000 virtual_protect 0 //SPEC_MAP_MATERIAL_POOL Data Pool Size default=4096

bbf030315190884.jpg 975bfa315190892.jpg 1b2273315190923.jpg


_DK
  • _DK

    Beчнo пьяный.

  • Members
  • Joined: 12 Apr 2009
  • Ukraine

#248

Posted 4 weeks ago

Patching these addresses in CLEO won't give you any result. The game will create pools before scripts will be launched.

Jack...
  • Jack...

    Firearms and adrenaline!!!

  • Members
  • Joined: 06 Dec 2011
  • None

#249

Posted 3 weeks ago

Hi there  :beerhat:. What's going on with III and VC? There're not much coding talk about these games for the past 3 months. Is that mean they're dead? 
Btw what's this:
01D8: unknown_actor 0@ unknown_fire_at_target 4@
I couldn't find any info and when I tried it a few months ago, a strange things happened - non of them interesting.

Silent
  • Silent

    Moderating Cookie Monster

  • Members
  • Joined: 01 Feb 2010
  • Poland

#250

Posted 3 weeks ago

It's called SET_CHAR_OBJ_DESTROY_OBJECT. I guess it tells the character to shoot it?

Jack...
  • Jack...

    Firearms and adrenaline!!!

  • Members
  • Joined: 06 Dec 2011
  • None

#251

Posted 3 weeks ago

Thanks  :^:.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users