Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTA Online

      1. The Diamond Casino Heist
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Red Dead Online

      1. Frontier Pursuits
      2. Find Lobbies & Outlaws
      3. Help & Support
    3. Crews

      1. Events
    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA 6

    3. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    3. Gangs

    1. News

    2. Forum Support

    3. Site Suggestions

Demarest

Thirst For Blood development

Recommended Posts

Demarest

I'm pretty sure all my answers will be no, but I'm still amazed at how much more the SA engine can do. So I ask in case things have changed.

 

Is there a way to make CJ unbustable? Like never get arrested. I don't mean like set max wanted level 0; I still want to be pursued... and killed. Just not arrested.

 

Is there a way to prevent the marked for death flag? What I mean is that I've noticed that SA's physics engine is more realistic with player health. If you're standing next to an explosion, even if you have the health to withstand it, you die. I'd like to prevent that. I was hoping that maybe that's what the 5th, unknown immunity flag was, but no luck.

 

When using the opcode to capture random peds, peds that started life as a random driver and/or cops that spawned on foot because you were wanted are ineligible. Is there any way around it? I know how to grab a random car and get the driver's handle. That's not the kind of thing I mean. I mean if they get out because their car's on fire or part of road rage, I'd like them to be included.

 

Speaking of random cars, I had a routine at one point meant to capture random cars in the area. It was meant to be an array 13 deep. Problem was that the engine had no problem flagging the same car multiple times. I even included a subroutine to check to make sure it was NOT any of the vehicles already in the array and it still proceeded to flag the same vehicle more than once. Even though it was no longer random at all once I captured it. Any ideas?

 

Although I've made quite a fancy workaround that fits the theme, I'm still mystified by player's health. Player seems to start off with 100. And I know that 0A1F will extend the visual meter. But even after I use

0A1F:  24  431.0; up max health to 1000055E: set_player $PLAYER_CHAR max_health +=  300

...I still only seem to be able to get 176 as max health. Even when I set stat 105 to 0.

 

Well I'll get back to it. Thanks for your time in reading this. smile.gif

 

[EDIT]

Almost forgot. How does one go about getting the model number of a randomly captured ped? I seem to remember such a command. I don't REALLY have to do a is $ACTOR model 300+ times every occurance, do I?

Edited by Demarest

Share this post


Link to post
Share on other sites
PLPynton

i can not help a lot but here it is:

 

regarding to veh interceptions there are 4 ways:

0327=6,get_vehicle_within_rectangle_cornerA_at_2D_coord %1d% %2d% cornerB_at_2D_coord %3d% %4d% with_modelID %5d% handle_as %6d% ;out np create

053E=6,get_vehicle_within_rectangle_cornerA_at_2D_coord %1d% %2d% cornerB_at_2D_coord %3d% %4d% with_modelID %5d% handle_as %6d% ;out

073E=6,get_vehicle_within_sphere_with_center_at_3D_coord %1d% %2d% %3d% radius %4d% with_modelID %5t% handle_as %6d% ;in npc

09C0=7,get_vehicle_within_rectangle_cornerL_at_2D_coord %1d% %2d% cornerR_at_2D_coord %3d% %4d% height %5d% with_modelID %6h% handle_as %7d% ;out

remarks:

in - means that search area is investigated from inside (center)

out - investigation begins from outside (borders) or defined rectangle

create - whole vehicle is created for engine. there is a rule that intercepted inthis way veh cannot be intercepted again by this code. later it has to be marked an no longer needed after or else veh going to stay inmemory

npc- i do not remember but i can recall that letter "p" meas that police vehs are unable to be intercepted in this way.

 

your last question gets answered with this:

0665=2,get_char %1d% modelID_to %2d%

 

 

EDIT:

i have done somewhere in year 2005 a big mod for ps2. some of my achevements aren't even known here today, but what the hell.

one of the things in mod were skills that you could learn ingame (CJ). i.e. if you have had MEDICS lev4 you health was regenerating up to 255 at it is absolute maximum possibility thru the scripted methods. the readme is here if you are interested.

 

EDIT2:

health in game is divided into 2 parts.

part1- health bar 0 to 176 health points

part2- health memorized 177 to 255 health points. this part of your health will never be shown as bar (you can access it over 0226)

part1 can be set with 0A1F. this part can be refilled (regeneration) using 0223.

part2 can be set with 055E. this part can be refilled using as well 055E.

i know it is a bit confusing so here is example

 

 

0653: get_stat  24 (max health) store_to @11; float0013: @11 *=  1.75;; floating-point values 0A1F: set_stat  24 max_to @11 055E: set_player $PLAYER max_health_add  79;classB

 

such sets it to 255 as max health for any player.

if you want to regenerate

 

0223: set_char $SCPLAYER health_to  255 

 

and you will get only 176 of health points

further regeneration can be only done via

 

055E: set_player $PLAYER max_health_add  10 

 

what gives you 186 or

 

055E: set_player $PLAYER max_health_add  79

 

what gives you again 255

 

regarding player dies ect i have measured (for SCJ mod) that any single damage on player does not exceed 165 so setting health 255 gave me actually shield for such an event of sudden death without making CJ immortal.

Edited by PLPynton

Share this post


Link to post
Share on other sites
pdescobar

 

Although I've made quite a fancy workaround that fits the theme, I'm still mystified by player's health. Player seems to start off with 100. And I know that 0A1F will extend the visual meter. But even after I use
0A1F:  24  431.0; up max health to 1000055E: set_player $PLAYER_CHAR max_health +=  300

...I still only seem to be able to get 176 as max health. Even when I set stat 105 to 0.

Most of your questions are well beyond me, but I've been playing a lot with statistics so I'll take a shot at this one. The 100 starting actual health corresponds to the 569.0 starting max health, so I've always just assumed that it is basically a unit conversion where 1 health point = 5.69 max_health points. Since the max health stat is artificially capped at 1000.0 and 1000/569 is (approximately) 1.76, then your true health is consequently artificially capped at 176. I doubt the 5.69 multiplier can be changed with any ease as it's probably buried in the exe.

 

Zeroing stat 105 is equivalent to zeroing STAT_TIMELIMIT_MAX_HEALTH in ar_stats.dat. It will greatly increase how quickly exercise increases max health, but it doesn't affect the cap so max health will still stop at 1000.0 and therefore true health still stops at 176.

Share this post


Link to post
Share on other sites
Bigun

I can't really help with this, but

 

 

If you're standing next to an explosion, even if you have the health to withstand it, you die.

 

That's wrong. The only thing that instant-kills the player is either a kill_actor opcode or heli's rotor blades (not even sure on the last one in SA). You can easily be on top of an exploding car, or shoot your feet with a rocket launcher ( catspider.gif ) and survive.

Share this post


Link to post
Share on other sites
PLPynton

one is certain: player will die when vehicle that he drives explode. but i am absolutely sure there is an opcode to avoid that - i remember it because i did that with ps2.

and i agree that no explosion has power to exterminate player in 1 hit when health above 160

Share this post


Link to post
Share on other sites
Demarest

Wow. Good fast replys smile.gif

 

When I hit a roadblock with what seemed to be health disrepencies, I crafted an interesting work around that intentionally leaves the player's health low. I guess I mistook severe damage for instant kills.

 

@PD: Nice! See, when there's a mathematical explanation, it all makes sense. If you look at my sample code, you'll see the 431. I was able to gather the 569, but I didn't follow it through. Otherwise the seemingly odd number of 176 I kept running into wasn't so odd at all. Their system is though.

 

@Pynton: Thanks for the explanation of the healths. As for the vehicles, thanks for that too. I wish I could recall which one I was using that was somehow able to recapture cars. My purpose was to monitor destruction. Once I found out there's a stat that saves that, there was no need for me to bother with all that. Still great to know.

 

Found out the long and hard way that 03D9: save_done futzes the game in ways 83D9: NOT save_done will not. Not at all surprised as I seem to remember the same being true for is_fading in GTA3. Unflipable opcodes are odd ducks indeed.

 

Otherwise, development is coming along nicely. Was able to import audio (thanks to PD's help) and textures (thanks to Delfi) and so the mod will actually have an intro that is authentic to the "game" it was patterned after. Still have some bugs to work out and am continuing to upgrade features, so...

Share this post


Link to post
Share on other sites
pdescobar

 

health in game is divided into 2 parts.

part1- health bar 0 to 176 health points

part2- health memorized 177 to 255 health points. this part of your health will never be shown as bar (you can access it over 0226)

part1 can be set with 0A1F. this part can be refilled (regeneration) using 0223.

part2 can be set with 055E. this part can be refilled using as well 055E.

 

Interesting stuff there. I have a question, tough. Do you have to continually reset the part2 health? I ran some brief tests where I had a "cheat" thread which did the following on a certain keypress:

 

0653: [email protected] = stat 24if   [email protected] < 1000.0jf @pdCheaterSetHealth0A1F: 24 1000.0:pdCheaterSetHealth0223: set_actor $PLAYER_ACTOR health_to 255055E: set_player $PLAYER_CHAR max_health += 79

 

And I altered my stat-watcher to output the current health (from 0226) to the screen as well.

 

Invoking the cheat kicked health up to 255 as expected. However, whenever I was injured and ate some food, the part2 health would go away and the health would drop back to 176. That also happened on some (but not all) of the occasions I injured myself by jumping off buildings. So is that extra part2 health "volatile" and needs to be monitored and readded?

Share this post


Link to post
Share on other sites
PLPynton

i forget to mention that 055E interacts with 0223.

when you set 055E it is like virtually you are setting the healt to:

(01AF 24 current / 5.68) + 055E current setting

e.g. 055E set 10 gives you current max bar health + 10

0223 resets 055E to 0 regardless of value set here as it is locked for player to 01AF 24 current / 5.68

to get simple refill just use 055E in loop. to get smart refill use check if 0226 > 176 then 055E else 0223. i did that in this way to get fluent health regeneration.

Edited by PLPynton

Share this post


Link to post
Share on other sites
pdescobar

 

0223 resets 055E to 0 regardless of value set here as it is locked for player to 01AF 24 current / 5.68

Oof. That's unfortunate. While that's a good strategy if you are going to automatically regenerate health, I was thinking more in terms of simply inflating the maximum health once and playing normally. In that case, every time the player eats or saves, the health resets back below 177 and you would have to compensate for that. sad.gif

Share this post


Link to post
Share on other sites
PLPynton

yes, pity. if that is an idea for change on whole script you could always create small script to handle health. then inject food changed over a global. well but there are some things like we do not know what willhappen when you start to become hungry. it might reset the value as well.

Share this post


Link to post
Share on other sites
Demarest

Hey I got one. I've always wanted a "store camera XYZ to" opcode. Any such thing? There's quite a few times this knowledge would've helped me in this project alone.

 

[EDIT]

Also, I'm having a hard time figuring out how to differentiate whether or not CJ is jacking a car from the driver's side or the passenger's. It matters because to jack it from the driver's side, you're ready to roll in about 100 ms. Jack it form the passenger's and it takes closer to 1200. I've tried various move to driverseat, is passenger seat empty, etc. It would be espcially nice if I knew how to intercept that car in particular as well. I tried quite a few approaches and none seemed to draw a distinct line that in the passenger seat means that. The transition from passenger to driver's seat seems to be up in the air.

Edited by Demarest

Share this post


Link to post
Share on other sites
Bigun

Hmm, maybe you could try figuring out what animation(s) is used in the 'enter from passenger side' and use the is_actor performing_animation conditional..

 

And you can really "just" get the vehicle's rotations,angle etc calculate the right side/passenger side's coords and check if actor 'is_near'. tounge.gif Pynton should be able to do it, I saw he used rotations quite a lot. I don't really have many clues on them myself..

Share this post


Link to post
Share on other sites
Demarest
Ah, but you're assuming I know what car to talk about. If I could do that, you're right: the answer would be child's play. I guess what I'm saying is it would be great if there was a way to capture which car is currently the apple of his eye. I know back when VC was newest, I ID'ed an opcode that only seemed to return true when Tommy was in pursuit of jacking/entering a car. So it's not too deep a stretch to hope that there'd be a way to use such a conditional, and once you've determined he is in fact approaching a car, capture that car. If that were the case, I could whisk him into the driver's seat and the wait to accomodate it would be negligible. As it is, I've devised a workaround that doesn't too visually punish me for actually choosing the driver's side. If you check out the mod once it's released, you'll realize it's not even going to come up often if ever. I'm just thorough and particular. But then, you already knew that wink.gif

Share this post


Link to post
Share on other sites
PLPynton

i believe you should search the forum. the opcode for "get_camera_position" has been posted by me long time ago so i believe you will find it.

lookat my opcodes database there has been posted recently check if player is entering vehicle. it should help to estimate time. if you are looking for simple answer if player is closer to left or right doors use "get_modelID_dimensions" so you will know where the left and right door are in matrix.

Share this post


Link to post
Share on other sites
ceedj

 

Hey I got one. I've always wanted a "store camera XYZ to" opcode. Any such thing? There's quite a few times this knowledge would've helped me in this project alone.

I've actually been toying with this a bit if it helps. I haven't been able to find an opcode that lets you store a camera position, but I have a minor workaround: use 0054: get_player_coords, which lets you set an offset in the first three params - perfect for adjusting where the camera will wind up being. (NOTE: I haven't tried this with 00a0: get_actor_coords, since I usually use the player character as my cameraman.)

 

It's rather inelegant, but it's what I'm using to play around with my "motion control" setup that I'm working on. Hope it helps. smile.gif

Share this post


Link to post
Share on other sites
Demarest
i believe you should search the forum.

lol.gif

 

Hi, nice to meet you. I'm Demarest. What that means is that I don't ask questions until I've searched, experimented in game, copied the opcode database, the updated INI, etc. Maybe you didn't realize the forums search has been down for some time. Maybe you didn't realize that searching google's cache is also a challenge since you can't exactly limit the search by specifying mission coding for example... since the words mission coding appear on every single GTAF page. I apologize if you bore of my seemingly unrelenting questions lately. I assure you each one comes usually after 2 hours of using all the resources available to me to come up with the answer.

 

In the end, I ended up grabbing the updated INI... only to find it may make matters worse every bit as much as it helps. At any rate, I found 068D=3,store_camera_position_to %1d% %2d% %3d% (@creed: colgate.gif hope you're as happy with that as I am). In closing, I don't think you understand that my "problem" is that I have no way of knowing what car to look at. If I did, I could come up with any number of workarounds. Without knowing what car to talk about, it's hard to look into it's measurements.

 

The code was becoming so large, that my patchwork was growing troublesome and my threads strained. So I've "started over". Already, there's improvements bringing features closer to what I originally envisioned. Using more globals than I usually do, but it sure makes it easier to read. Utilizing a modular approach that makes it easier to shift about for testing and should make it that much more scalable for future expansion.

 

@creed: In one "scene", I wanted the camera to rotate around the player. I was able to dig into my old Neo code and piece something together that works quite nicely. GTA3 didn't have the get point on plane command, so I had to use sin and cosine. Back then, I actually had to add them (and many other) opcodes to MB's usability. I was so happy when my 8 directional Neo took on a 360 degree fluidity.

Share this post


Link to post
Share on other sites
Demarest

Next question...

 

I'd like to be able to tie markers to actors so that they show up on the radar but NOT over them. So if you were looking at a marked actor, you wouldn't know unless you looked at the radar. Is this possible? Going to test some things, but my first passes over various texts suggests not, so I thought I'd ask on the off chance that the 3 or 4 people that still frequent here might know tounge.gif

 

[EDIT]

It was as easy as I thought.

018B: show_on_radar @6  2

 

So as not to waste this post, somebody tell me about the hunger system. Is it provoked by the JFUD external thread for exmple? Or an inherent part of the engine? I've never seen such messages pop up in a stripped SCM for example about starving. In my game though, I wouldn't know because I've nuked textboxes. The GXT entry is NOTEAT and there is no call for it in the SCM.

Edited by Demarest

Share this post


Link to post
Share on other sites
spaceeinstein
Stats can be controlled through the ar_stats.dat and statdisp.dat files.

Share this post


Link to post
Share on other sites
Demarest
I didn't realize that I was trying to change stats. I was just asking if hunger is a hard-coded element or if something present in full code makes it happen. Are you sayin I should change
# amount stats get decremented#23	STAT_DEC_FAT    	1524	STAT_DEC_BODY_MUSCLE  	1525	STAT_DEC_MAX_HEALTH    10

...to

# amount stats get decremented#23	STAT_DEC_FAT    	024	STAT_DEC_BODY_MUSCLE  	025	STAT_DEC_MAX_HEALTH    0

? Because I wasn't asking whether or not I should change that. I was asking if I need to or not. Looking at the SCM, it doesn't appear that hunger is provoked, but I've never suffered side effects from playing with stripped SCM's and such. Longevity is an element in my game and stat/textboxes aren't present. I'd hate for my players to suffer unintentionally.

Share this post


Link to post
Share on other sites
tomworld10

Hi,

 

 

About hunger, you do get starving on a stripped main, and you actualy really get starving because you've got no place to eat, tey're ain't working.

 

If you want to be sure get some muscle or some fat with cheatcodes wait and you'll quickly get skinny. Much quickly than when you're already skinny and you're loosing health (this really take ages I think I've done it once for the sake of getting that poor CJ starving because he was hungry too often !!!).

 

 

So yes it is harcoded. By the way when you increase only the kalories stat (can't remember if it's called food in the stomach, I don't remember neither the number) the health and fat actaully increase too, and with healthy meals JFUD redecrease to the value it was before so you don't get fat.

 

 

Have fun

Share this post


Link to post
Share on other sites
pdescobar

 

About hunger, you do get starving on a stripped main, and you actualy really get starving because you've got no place to eat, tey're ain't working.

Yep. Hunger occurs after approximately 48 in-game hours of straight play without either eating or saving (wasted/busted probably resets the counter too.) If you invoke the faster clock cheat (YSOHNUL) you'll reach that threshold fairly quickly, and you'll see it in a stripped SCM. If you add a couple calories while you are starving you get about a 12-hour reprieve before it starts again; a larger number of calories might get a bigger rest period, but I didn't test it all that thoroughly.

 

 

So yes it is harcoded. By the way when you increase only the kalories stat (can't remember if it's called food in the stomach, I don't remember neither the number) the health and fat actaully increase too, and with healthy meals JFUD redecrease to the value it was before so you don't get fat.

The calories stat is stat 245, so if you run a thread that occasionally (certainly no less than every 48 in-game hours, maybe every 24 or 12 to be safe) ups stat 245 by a small amount and then restores fat (stat 21) and health to their previous values, you should essentially disable the hunger issue. The game will zero stat 245 by itself more-or-less immediately when it adds the fat and health. You might want to wrap the whole thing in calls to 08F8: show_progress_bar_for_stat_change (0/1) to make sure the fat meter doesn't pop up while you do that.

Share this post


Link to post
Share on other sites
Demarest

So it IS hardcoded. And you guys have been great with filling in the specifics. Thank you colgate.gif

 

So does anybody have reason to suspect that my proposed solution of zeroing the values in ar_stat like space eluded to wouldn't work? Like I said, I've already nuked the textboxes, so I wouldn't care if a message popped up, so long as it didn't actually change your stats ingame.

Share this post


Link to post
Share on other sites
pdescobar
So it IS hardcoded. And you guys have been great with filling in the specifics. Thank you colgate.gif

 

So does anybody have reason to suspect that my proposed solution of zeroing the values in ar_stat like space eluded to wouldn't work? Like I said, I've already nuked the textboxes, so I wouldn't care if a message popped up, so long as it didn't actually change your stats ingame.

My gut instinct is that zeroing those stats won't do it as the fat and muscle values there are used for exercise and that health stat is a loss of max health as opposed to current health. The starvation values are 25 fat and 2 health in the unmodified game so unless it's applying a multiplier to those values, starvation decreases are defined elsewhere. It shouldn't be hard to test, though, under faster time.

Share this post


Link to post
Share on other sites
Demarest

Just wanted to post that I tested it, and indeed, putting zeroes into ar_stats.dat did not prevent hunger from taking its toll.

 

Anyways, it is RELEASED!

Share this post


Link to post
Share on other sites
Demarest
Sorry for the bump, but I wanted to return to the topic of health. I wanted to find out what the player's max health is in the released version of SA and find no such opcode. So should I go by the bar's current max level? What I mean is, we've established here that 255 is the true max, but the bar only supports 176. So does that mean that in the course of an unmodded SA, max health attainable is 176?

Share this post


Link to post
Share on other sites
ceedj

This is gonna be a REALLY dumb question, but did you check the end of the Ambulance mission? It seems to change the stat to max health upon completion (:AMBULAN_1608 - I think it multiplies the max health stat by 1.5 to give you the new max).

 

If you have, feel free to ridicule me muchly. lol.gif

Share this post


Link to post
Share on other sites
Demarest

Oooh, free ridicule? tounge.gif Okay, but only to say: Somebody didn't read the whole topic, did they? wink.gif

 

From what I can tell so far, just using pdescobar's equation seems to do the trick.

Share this post


Link to post
Share on other sites
ceedj

Yah, I HAD read that, but for reasons only my brain can decipher (note I didn't say understand), I had only latched on to the hunger part of the discussion. Indeed, re-reading the thread gave me the all to frequent opportunity to nod at myself knowingly, with a quiet but firm "duh" tacked on the end.

 

My apologies.

 

I mean for making you read all that instead of just "Whoops, sorry."

 

biggrin.gif

Share this post


Link to post
Share on other sites
PLPynton

breaking 176 health limit is easy. you have to hit into higher momory range than stat 24 is located. i have done it before with probably 367 or something higher. if it is still interesting let me know so i will find it in my data. i remember as well it is stored as float (all of the important are) not as int so you have to trick it a bit because there is no opcode to access float stat.

Share this post


Link to post
Share on other sites
Demarest
I apologize if posting this in the thread entitled for TFB has misled you in any way. But my most recent inquiry isn't meant for TFB or to redefine the game at all. It's meant to exist within the regular game, which is why I was asking how to go about detecting max health. But pdescobar's mention of 5.69 seems to be working.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

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