Scripts / [SOLVED] Breakable Non-explosive Boxes

Author
Message
IvanKats
3
Years of Service
User Offline
Joined: 28th Jul 2020
Location: Russia
Posted: 8th Aug 2020 11:34
Hi! I need some help with making breakable non-explosive boxes, so that I could shoot at them, break them and get ammo. All of my breakable crates go with graphix_explosion.lua script which is buggy now. And I just don't want my boxes to explode.

The author of this post has marked a post as an answer.

Go to answer
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 8th Aug 2020 16:34
This post has been marked by the post author as the answer.
Hi
When I sent that breakable stuff to Lee he decides to attach an explodable script to avoid fragments (GG collision issues).

1- Attach the script below.
2- Strength = 50
3- Always active = yes


Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 8th Aug 2020 16:35 Edited at: 8th Aug 2020 16:36
Just attach a script to run the appropriate animation instead then.

Ah, 3com beat me to it.
Been there, done that, got all the T-Shirts!
PM
IvanKats
3
Years of Service
User Offline
Joined: 28th Jul 2020
Location: Russia
Posted: 8th Aug 2020 16:55
I made a small wooden crate breakable with the following code

But the weird thing is in this line "if g_Entity[e]['health'] > 1 then". It's like health is greater than but actually it becomes 1 when you shoot or hit the crate.
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 8th Aug 2020 17:29
Why just don't attach my script?
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
IvanKats
3
Years of Service
User Offline
Joined: 28th Jul 2020
Location: Russia
Posted: 8th Aug 2020 19:13
Yes, your script works just fine! Thanks a lot!
IvanKats
3
Years of Service
User Offline
Joined: 28th Jul 2020
Location: Russia
Posted: 8th Aug 2020 22:30
I made the script. And it works. But once. Then I have to restart the Game Guru to get the animation working. Or create a new level.


3com code works the same. I'm puzzled. It's something wrong with the animation or I'm doing something wrong.
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 8th Aug 2020 23:37
??
Get rid of /SpawnIfUsed(e)/
I don't know how to use it, but it clutters the code, it's confusing and
there's more logical ways to incorporate the temporary use of an entity.
Probably originates from back a few generations ago...

BTW, doesn't health > 0 signify that entity is "alive" or "active"- not dead?
PM
bluemeenie195
5
Years of Service
User Offline
Joined: 28th Oct 2018
Location:
Posted: 8th Aug 2020 23:59
Great script 3com. Very useful.
PM
IvanKats
3
Years of Service
User Offline
Joined: 28th Jul 2020
Location: Russia
Posted: 9th Aug 2020 06:17
I've noticed if you break the boxes right after loading a level then there may be bugs but if you wait for say 2 minutes, everything works - the animation plays
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 9th Aug 2020 07:47
It is not so natural a box breaking more than once.

Just place ammo inside the box, and use more than one box.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM

Login to post a reply

Server time is: 2024-04-25 21:53:18
Your offset time is: 2024-04-25 21:53:18