UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Need help with custom content?

broken avatar :(
Created 12 years ago
by GalifreyanGaming
0 Members and 1 Guest are viewing this topic.
1,382 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 31 May 2014
Last active: 7 years ago
Posts
11
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
GalifreyanGaming's Contact & Social LinksGallifreyanGaming
So I've been trying to include custom dynamic models into my map and I've managed to get a basketball working with a physics preset and I was quite happy  ;D Though when you shoot at it, the ball bounces around like a person dribbling at it. My goal is to somehow make the ball deflate. This model, of course, was only a test. I was more focused upon using a custom car I exported a while back ago. I am trying to get the car to blow up, much like the stock ones. I have everything working except the spawn of the new destroyed model. Here's my model's keys and values in Radiant:
Code Snippet
Plaintext
targetname: destr_murci
classname: dyn_model
type: destruct
physpreset: jeepride_boulder
health: 250
model: gg_murci
angles: 0 270 0
origin: -1464.4 -2240.6 1.5
destroyefx: fx_vehicle_explosion

I believed a script was needed to precache the destroyed model so I had help making this script from a friend who doesn't have the mod tools installed so he can't be too sure. I named the script _custommodels.gsc and placed it into the maps folder.
Code Snippet
Plaintext
 main()
{
    precachemodel("gg_murci_nowin");
   
    thread testFunction();
    isDestroyed = false;
}




testFunction()
{
    //    Gets old model.
    oldModel = getEnt( "destr_murci", "targetname" );
   
    //    Check to see if the model is gone, not sure if this will even work. I can't test as i have no tools.
    if(oldModel == null)
        isDestroyed = true;
    else if(oldModel != null)
        isDestroyed = false;
   
    //    If the model is destroyed then spawn the model at the same position as the old one, not sure if the angles has to be set as well
    if(isDestroyed)
    {
        newModel = spawn( "script_model", oldModel.origin );
        newModel setModel( "gg_murci_nowin" );?
    }
}

I saved the script and ticked it inside the mod builder as well. In game, the car blew up, along with the beautiful FX that I assigned it, but after the dust clears, the car has simply vanished. The destroyed model is nowhere in sight. I assumed that the script needed to be called on somewhere within the My_Mapname.gsc file, but I'm not entirely sure. In an attempt to get the script called on, I added this to my fastfile mod.csv:
Code Snippet
Plaintext
rawfile,maps\_custommodels.gsc
xmodel,gg_murci_nowin

Perhaps the script works but maybe I need to change the way I'm trying to execute it in Radiant? Any help would be greatly appreciated. This clueless ordeal has honestly paused my mapping to a huge degree and if I can't figure it out, I may just stop. I'd like for a level of reality in my map and not just boring stock or custom static models to just lie around. Thanks in advance to anyone who tries to help :D
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Code Snippet
Plaintext
oldModel setModel( "gg_murci_nowin" );

You should be able to change the model by just setting the old model to the new(destroyed) one like that.

 
Loading ...