GTAMP.com

Grand Theft Auto Media Press
It is currently Wed Oct 18, 2017 2:04 am

All times are UTC




Post new topic Reply to topic  [ 20 posts ] 
Author Message
 Post subject: NPC Suicide
PostPosted: Sat Jun 17, 2017 12:35 am 
Offline
Hitman

Joined: Tue Dec 06, 2011 4:54 pm
Posts: 115
So I've been working on a script in the GTA1 San Andreas map that is going to involve many different Assassins hunting after the player, as well as several assassination targets throughout the map. Near the giant Bridge is a building complex I zoned to be free from any dummy ped spawns, only scripted characters. The Gang Leader is located atop a rooftop. I have him scripted to run away as soon the player crosses a roof bridge. & I wanted to make it so that he jumped off the building to his death once the player jumped to the roof he was on, but it doesn't seem possible with scripting commands.

So I set his objective to kill himself, causing him to punch himself to death. It doesn't work if he has a gun though, He'll just fire off into the distance.

Is there anyway to get scripted characters to jump off of roofs like in GTA1? I imagine you could script an invisible block & then delete it as soon as he steps onto it to make him fall but that's a bit more complex than just commanding him to jump off a building.

It'd be cool if there was an NPC only scripted gun that created the bullet inside the character & instantly killed them, so you could
GIVE_WEAPON (GangBoss, Suicide_Gun)
SET_CHAR_OBJECTIVE, (GangBoss, KILL_CHAR_ON_FOOT, GangBoss)
& script some pretty cool missions involving people honor killing themselves.

Anyway, it's funny to watch someone punch themselves to death.


Attachments:
HeDead.png
HeDead.png [ 1.04 MiB | Viewed 1637 times ]
Top
 Profile  
 
 Post subject: Re: NPC Suicide
PostPosted: Sat Jun 17, 2017 1:08 am 
Offline
User avatar

Joined: Sat Dec 26, 2009 11:53 pm
Posts: 1061
Devastator wrote:
I imagine you could script an invisible block & then delete it as soon as he steps onto it to make him fall but that's a bit more complex than just commanding him to jump off a building.


that was my first idea as well. conveyor belts cannot be turned off and explosions wouldnt make sense except if invisble explosions worked which i dont remember. maybe you could create an invisble object on top of him so he jumps but i dont know if he would jump to death. you could create an invisible char with flamethrower that sets him on fire like if hes burning himself or you simply explode the char.

_________________
yur sa'nok ngeyä


Top
 Profile  
 
 Post subject: Re: NPC Suicide
PostPosted: Sat Jun 17, 2017 1:11 am 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1283
Location: GTAMP.com
KILL_CHAR (GangBoss) will instantly kill any character. Making a ped jump to their death is more interesting but until someone figures out how to force a jump, you could teleport them off the edge using a memory write command (warp command only works on players, not bots).


Top
 Profile  
 
 Post subject: Re: NPC Suicide
PostPosted: Sat Jun 17, 2017 2:15 am 
Offline
Hitman

Joined: Tue Dec 06, 2011 4:54 pm
Posts: 115
I have an idea.
I could command the character to go to the edge of X block, do a check to See if he completed his objective, create a water cannon bullet aimed at him to blow him off, & then do a Is Character Falling check to kill him. Can you command someone who is falling to be killed? I think this idea would be a good substitute.


Top
 Profile  
 
 Post subject: Re: NPC Suicide
PostPosted: Sat Jun 17, 2017 3:14 am 
Offline
User avatar

Joined: Sat Dec 26, 2009 11:53 pm
Posts: 1061
i think to remember that the water bullet didnt work. killing a falling char works. i did that on high land

_________________
yur sa'nok ngeyä


Top
 Profile  
 
 Post subject: Re: NPC Suicide
PostPosted: Sat Jun 17, 2017 3:21 am 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1283
Location: GTAMP.com
I forgot that the WARP command only works on players, that really should be changed. You can still teleport peds by changing their x, y, z values with poke commands.


Top
 Profile  
 
 Post subject: Re: NPC Suicide
PostPosted: Sat Jun 17, 2017 5:59 am 
Offline
Hitman

Joined: Tue Dec 06, 2011 4:54 pm
Posts: 115
I was going to see about using the PISTOL_BULLET object to create a suicide effect, after testing out water bullet & it crashing the game. I had it set up to continuously create the bullet however when checking Player health, creating what could be perfect as a laser trap in certain maps,


EDIT: If you run straight through it with full armor it's guaranteed to take 5 points of armor away. If you aren't wearing armor it'll kill you instantly.

EDIT2: If you use TASER_BULLET you can create a nonlethal stream that you could use to visually represent laser trip triggers (alarms, guards swarming you, etc)


Attachments:
Laser.png
Laser.png [ 603.93 KiB | Viewed 1620 times ]
Top
 Profile  
 
 Post subject: Re: NPC Suicide
PostPosted: Sat Jun 17, 2017 6:42 am 
Offline
Hitman

Joined: Tue Dec 06, 2011 4:54 pm
Posts: 115
That whole laser thing inspired me to make TRACER ROUNDS.
It may not look like much in a still shot but in motion it's pretty awesome. Just edit the bullet sprites to be 15 pixels tall instead of three, & shade them in the same way.


Attachments:
TRACERS.png
TRACERS.png [ 379.03 KiB | Viewed 1617 times ]
Top
 Profile  
 
 Post subject: Re: NPC Suicide
PostPosted: Sat Jun 17, 2017 6:54 am 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1283
Location: GTAMP.com
I wonder if you removed the reload delay if it would just look like a laser.


Top
 Profile  
 
 Post subject: Re: NPC Suicide
PostPosted: Sat Jun 17, 2017 6:57 am 
Offline
Hitman

Joined: Tue Dec 06, 2011 4:54 pm
Posts: 115
The machine gun still has a distinct projectile differentiation too. I'll have to try it out with fast reload. But that was actually the inspiration, I'm sure if I set it up in that scripted bullet stream it would look like a laser for sure.

EDIT:
Almost, but I think the game knows to space out the projectiles a certain distance. I counted & both these & default bullets only have 8 on a screen at a time if firing continuously, I don't know that increasing the height of the sprite would affect it or not.

EDIT2: Laser works for continuous object creation stream


Attachments:
lasertrip.png
lasertrip.png [ 894.92 KiB | Viewed 1614 times ]
laserattempt.png
laserattempt.png [ 615.13 KiB | Viewed 1615 times ]
TRACERS2.png
TRACERS2.png [ 883.62 KiB | Viewed 1616 times ]
Top
 Profile  
 
 Post subject: Re: NPC Suicide
PostPosted: Sat Jun 17, 2017 12:27 pm 
Offline
User avatar

Joined: Sat Dec 26, 2009 11:53 pm
Posts: 1061
to make a laser waepon you would need the address of the bullet speed

_________________
yur sa'nok ngeyä


Top
 Profile  
 
 Post subject: Re: NPC Suicide
PostPosted: Sat Jun 17, 2017 12:52 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1283
Location: GTAMP.com
I don't know bullet speed address, I would try just changing the reload speed first since you can make that faster than fast reload.

Syntax: [ Download ] [ Hide ]
Using GTA2 Script Syntax Highlighting
//remove reload delay
SET in=(p+368) //player + 368 is a pointer to the player ammo (only for first weapon slot)
CHANGE_GANG_CHAR_RESPECT (in,out,104) //read those 4 bytes
IF (out>0)
  SET reload=(out+2) //we don't care about ammo, reload countdown is located at ammo location + 2
  SET out=0 //constantly set reload countdown to 0 so we can always fire
  CHANGE_GANG_CHAR_RESPECT (reload,out,111) //write 1 byte
ENDIF
 
Parsed in 0.009 seconds, using GeSHi 1.0.8.10


Top
 Profile  
 
 Post subject: Re: NPC Suicide
PostPosted: Sat Jun 17, 2017 2:13 pm 
Offline
User avatar

Joined: Sat Dec 26, 2009 11:53 pm
Posts: 1061
if bullet objects can be deleted you could make a light saber with it. that would be sespicially cool if you could deflect projectiles with it and use it as a secondary weapon powerup

_________________
yur sa'nok ngeyä


Top
 Profile  
 
 Post subject: Re: NPC Suicide
PostPosted: Sat Jun 17, 2017 3:07 pm 
Offline
Hitman

Joined: Tue Dec 06, 2011 4:54 pm
Posts: 115
Bahahahaha.

Also that code doesn't just work for weapon slot one. If I have more than one weapon they all fire without delay.

EDIT: OH MY GOD IT WORKS ON NPCS TOO

- if you use the same code on an NPC but set the reload counter to 1 they'll never be able to fire their gun. This could be useful for making guys who are aiming at you but never attack, or someone shooting at an invisible target but you're creating bullets inside them, to create a suicide effect.


Attachments:
LASERGUN.png
LASERGUN.png [ 508.72 KiB | Viewed 1592 times ]
LASERGUNnpc.png
LASERGUNnpc.png [ 334.89 KiB | Viewed 1592 times ]
Top
 Profile  
 
 Post subject: Re: NPC Suicide
PostPosted: Sat Jun 17, 2017 8:18 pm 
Offline
Hitman

Joined: Tue Dec 06, 2011 4:54 pm
Posts: 115
With Dual pistols it'll create an impregnable death wall surrounding the player. Imagine setting two or three of these guy to the Army occupation (to fire from far away), & then creating a few guys set to punch the player to death. It'd create an enclosed fighting arena the player has to fight the melee attackers in without being able to retreat without dying.


Attachments:
DualLaser.png
DualLaser.png [ 852.83 KiB | Viewed 1584 times ]
Top
 Profile  
 
 Post subject: Re: NPC Suicide
PostPosted: Mon Jun 19, 2017 11:08 am 
Offline
Hitman

Joined: Tue Dec 06, 2011 4:54 pm
Posts: 115
Here's a short vid of the script I'm working on. I forgot to set the audio to record though. It ends with a guy jumping to his death using the invisible block trick, but in the video he doesn't just go straight to do it like he's supposed to I think because his threat search was set to LINE_OF_SIGHT_PLAYER_ONLY & threat reaction was REACT_AS_NORMAL.

I'm surprised how well everything played out here though, it's pretty great. I just wish I got the audio.

https://www.youtube.com/watch?v=az24nna ... e=youtu.be


Top
 Profile  
 
 Post subject: Re: NPC Suicide
PostPosted: Mon Jun 19, 2017 2:58 pm 
Offline
User avatar

Joined: Sat Dec 26, 2009 11:53 pm
Posts: 1061
nice, there is a lot that can be done with this. a nice zombie coop mode like the ones in call of duty could work really nice

_________________
yur sa'nok ngeyä


Top
 Profile  
 
 Post subject: Re: NPC Suicide
PostPosted: Mon Jun 19, 2017 4:53 pm 
Offline
Hitman

Joined: Tue Dec 06, 2011 4:54 pm
Posts: 115
Which aspect would be good for a zombie coop?

I noticed one weird effect though, & this is may be why peds don't fall to their death: The corpse if floating. Peds & Cars go under it.


Top
 Profile  
 
 Post subject: Re: NPC Suicide
PostPosted: Mon Jun 19, 2017 6:04 pm 
Offline
User avatar

Joined: Sat Dec 26, 2009 11:53 pm
Posts: 1061
the naked zone if those are converted normal peds and the usage of special weapons.

maybe hes floating because he has fallen too deep and the game killed him in flight just above the ground

_________________
yur sa'nok ngeyä


Top
 Profile  
 
 Post subject: Re: NPC Suicide
PostPosted: Mon Jun 19, 2017 7:14 pm 
Offline
Hitman

Joined: Tue Dec 06, 2011 4:54 pm
Posts: 115
Oh! Actually that's one of my "Hit Targets," it's a karma bus filled with four groups of hostile nudists, 31 people total. If the bus is at all stopped when you're near it the passengers get out by default to attack due to their respective gang respect being at -5.

& if the jumper hits the ground to where he falls over & dies his corpse is normal. It's when he's killed by the game just before hitting the ground that he floats, that's what I assume anyway.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group