Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Gibshooter, and breakable glass

Author
Message
osc
20
Years of Service
User Offline
Joined: 13th Jul 2004
Location:
Posted: 22nd Aug 2004 00:26
ok so im working on some breakable glass. I dont really have a clue how it works apart from that the glass would need a health counter, and that once this reaches0 i would trigger some kind of gibshooter. The problem is, i dont know how a gibshooter works in DBC!

I understand that it would fire out a .x model i made of shattered glass in different directions, but im not sure how the code would go.

Any help would be greatly apreciated.

P.S whats the command to make the glass seethrough, cant use ghoost, because that also makes it 'walk through'.

cheers

-osc
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 22nd Aug 2004 02:32 Edited at: 22nd Aug 2004 02:47
you seem to be muddling two seperate languages here, setting ghost on for a object does not make it walkthrough, collision still works on ghosted objects, transparent objects or hidden objects even, just like all objects you need to check for collisions each loop of the game, but a ghosted object will remain solid unless you code it to act different, the "ghost" just refers to visual properties.
for your "gibshooter" you can just make some particles and spray them from the window position, settings for that would depend on the effect you are aiming for, or like you said you can load an .x animation and position at the center of the windowpane, you don`t need a window health counter, just check for a hit by a bullet or rocket shockwave and ignore player/npc collisions (if you don`t want the player to be able to break glass that is).
heres a VERY simple example of semi-psuedo code

load object "glassburst.x",1
load object "window.x",2
make object sphere 3,1 << the bullet!
position object 2,10,10,10 << window floating in space
position object 3,0,0,0 << bullets start position
position object 2,10000,10000,10000 << out of sight for now
repeat
until spacekey()=1
do
move object 3,1
if object collision 3,2
Explode_Glass()
endif
sync
loop

function Explode_Glass()
position object 1,10,10,10
play object 1
for i=100 to 0 step -1
fade object 2,i
sync
next i
endfunction

is the sort of thing you need to explode the window, or you could substitute particles for the exploding glass model and make em large and shard shaped, or you could just load the glas as an animation with the first frame of it intact, then just play the animation when the glass gets hit, or load several interlocking shards, position them at the window and then use a simple particle system to move them outwards after swapping them for the intact window, loads of ways to do it, just pick the one you think seems best.

Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, Nvidia FX5900 gfx, 6 way surround sound, PC2: AMD 2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster.
osc
20
Years of Service
User Offline
Joined: 13th Jul 2004
Location:
Posted: 22nd Aug 2004 06:07
thankyou very much, i shall post about how i get on

Login to post a reply

Server time is: 2025-05-25 13:11:10
Your offset time is: 2025-05-25 13:11:10