Exporting and importing meshes

Discussions about Coding and Scripting
Post Reply
User avatar
Rakiayn
Masterful
Posts: 550
Joined: Fri Aug 28, 2009 3:33 pm

Exporting and importing meshes

Post by Rakiayn »

I want to import some stuff into my own MOD. like the ''spinner''
only problem, how do I get the spinner mesh and sounds from the spinner.u to mymod.u file?
gopostal

Re: Exporting and importing meshes

Post by gopostal »

Ask permission? :pfff:

By far the easiest way is to leave the original u file alone and call it from your mod, making whatever changes you want along the way. Since it is called you won't need serverpackage lines, just to have it on server. Make oop work for you!
In cases where I just want a small part of a very large mod I use WOTgreal exporter. It isn't perfect but it does OK sometimes. I usually tried to stick with option 1, however there are several "spinner" u's floating around so exporting it would be wise to avoid mismatch. If that is all you need, let me know. I still have the source for it from working on Survival.
User avatar
Rakiayn
Masterful
Posts: 550
Joined: Fri Aug 28, 2009 3:33 pm

Re: Exporting and importing meshes

Post by Rakiayn »

dont worry. Im not saying I wont ask permission ;)
and I want to import it, because I need to subclass it under my superclass
thanks, I will let you know when I get to that part
gopostal

Re: Exporting and importing meshes

Post by gopostal »

The permission thing was totally meant as a joke. I'm of the opinion that everything should be open source. There is no higher honor than to see your stuff used by someone else.
User avatar
Rakiayn
Masterful
Posts: 550
Joined: Fri Aug 28, 2009 3:33 pm

Re: Exporting and importing meshes

Post by Rakiayn »

ok lol , I should have known XD
I agree with you btw
User avatar
editor Dave
Inhuman
Posts: 904
Joined: Mon Mar 10, 2008 6:40 pm
Personal rank: Passionate SP Mapper
Location: Germany/Bavaria
Contact:

Re: Exporting and importing meshes

Post by editor Dave »

Type in your console

Code: Select all

obj load file=spinner.u package=mymod
Beforehand you have to create a new package called "mymod".
I don't know if it works because I only know this comand line in combination with MyLevel. But it should...
Image
10-Year Anniversary on Jun 08, 2019.
gopostal

Re: Exporting and importing meshes

Post by gopostal »

That will work in a map package's mylevel but if you insert this into the compiled code as an Exec line you will create a dependency on the old package no matter how you code it.
User avatar
editor Dave
Inhuman
Posts: 904
Joined: Mon Mar 10, 2008 6:40 pm
Personal rank: Passionate SP Mapper
Location: Germany/Bavaria
Contact:

Re: Exporting and importing meshes

Post by editor Dave »

I tried it. It does work:
trick.png
What I did:
1. I used this comand to import AsgardPredator.u in a new (not yet existing) package I named "Monsters"
2. I imported a second package (AsgardSpinner.u) in the new one.
3. I saved the Monsters.u package
4. I restarted the ED and opened Monsters.u
5. Now you see this package contains the Spinners as well as the Predator.
This line works with every Unreal file.

That's exactly what he wanted or am I wrong?
Image
10-Year Anniversary on Jun 08, 2019.
gopostal

Re: Exporting and importing meshes

Post by gopostal »

The problem is you still have the dependency to the old package. Importing packages together like this will not change the code, just the "packaging" so to speak. It's like making a mylevel but with a container file.

Try deleting the original package and you'll see it most likely will not work now. This is because the original code in the mod calls to a package no longer there. In essence what you are doing is option 1 from my original post: Extending the original code. This won't always be the case as some mods have such generic code that there are no package calls from inside but it's a pretty good rule of thumb.
Think about the packages int file now. What does it reference if you remove the original mod?
User avatar
editor Dave
Inhuman
Posts: 904
Joined: Mon Mar 10, 2008 6:40 pm
Personal rank: Passionate SP Mapper
Location: Germany/Bavaria
Contact:

Re: Exporting and importing meshes

Post by editor Dave »

I agree, when there are .int files there are problems but he never mentioned anything about them, didn't he?
I can open the Monsters.u even when I delete the original packages so this dependency only belongs to .int files. Let's wait for an answer which files exactly he wants to merge.
Image
10-Year Anniversary on Jun 08, 2019.
User avatar
Rakiayn
Masterful
Posts: 550
Joined: Fri Aug 28, 2009 3:33 pm

Re: Exporting and importing meshes

Post by Rakiayn »

thanks guys.
I want it to become independant from .int files too
gopostal

Re: Exporting and importing meshes

Post by gopostal »

The dependency solely depends on the code. Let me show you an example. Here is a sample of the code from Monsterhunt2v2:
if(Other.IsA('Flashlight') && !Other.IsA('LimeLight'))
{
ReplaceWith(Other,"MonsterHunt2v2.LimeLight");
return false;
}

++++++++++++++++
if(UseMHTranslocator)
DeathMatchPlus(Level.Game).GiveWeapon(Other,"MonsterHunt2v2.MHTranslocator");
++++++++++++++++
// This is added inventory to allow the double jump mod to function
InventoryClass = class<DJ_InventoryItem>(DynamicLoadObject("MonsterHunt2v2.DJ_InventoryItem", class'Class'));
++++++++++++++++
defaultproperties
{
KHMNaliFruit="MonsterHunt2v2.KHMNaliFruit"
Now this is a varied assortment but it's all from one class. If you add the mod into another package without also keeping the original mod on server (or installed) then all these calls will no longer work, since they look for a package that doesn't exist.
Don't get confused guys, int files are mostly used to declare a mod for offline games. Making one for an improperly generated compilation mod will not magically make it work if you break the interior code.
Post Reply