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.

Newcomers AppGameKit Corner / How to do multitexturing of objects correctly?

Author
Message
pavel_sv_1982
9
Years of Service
User Offline
Joined: 9th Apr 2013
Location: Russia
Posted: 5th Dec 2021 08:17 Edited at: 3rd Aug 2022 20:26
How to do multitexturing of objects correctly?


This is an example of loading a map from a fps creator into an app game kit.
Did I write everything correctly?

The code doesn't work for some reason.
Although it worked in the examples.
programming is a hobby, not a job.
P.S. in google and youtube - nikename pavelman- it is not me!
PartTimeCoder
AGK Tool Maker
7
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 5th Dec 2021 15:01 Edited at: 5th Dec 2021 15:29
if it works in the examples and not in your project then the code is good, check the file paths

and please, don't spam my inbox with your help requests, all it will achieve is make me ignore you!

Edit: in future, if you want help via PM send the project, not a wall of unformatted text
Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
pavel_sv_1982
9
Years of Service
User Offline
Joined: 9th Apr 2013
Location: Russia
Posted: 6th Dec 2021 13:03
The program gave an error when going to the list of meshes of the main mesh. I suppose this is due to a glitch in determining the number of meshes of the main mesh.
After all, I compiled the simplest game in fps creator and used your program to convert the map.
I just haven't dealt with objects like object before so I have no idea. how it actually works.
Checked in dark basic pro. Everything works.
It automatically applies all textures. he does not need this code.
I added comments to the code.
Correct me if I was wrong. Thanks.
programming is a hobby, not a job.
PartTimeCoder
AGK Tool Maker
7
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 6th Dec 2021 13:41 Edited at: 6th Dec 2021 13:42
Not my program, Not my code.

That code *looks* ok to me, I see no obvious errors the fault must be the model

LoadObjectWithChildren expects a animated object, the meshes are children of the armature, try with LoadObject

add:


and run in debug >> if you get 0, there is your problem
Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
pavel_sv_1982
9
Years of Service
User Offline
Joined: 9th Apr 2013
Location: Russia
Posted: 6th Dec 2021 14:50
code from DLC Shader pack

From here this code.
I cut off the special effects that are premium to him.
Left only loading the textures themselves. And that's all. the code doesn't work. Can you help me figure out the part of the code that loads and textures the map?
Please.

programming is a hobby, not a job.
PartTimeCoder
AGK Tool Maker
7
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 6th Dec 2021 15:56
Quote: "the code doesn't work."


That's very vague, what does not work, exactly?

I just ran a test here



The untextured part uses illumination maps which you saw I commented out, to use this you need to use the shaders
Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
pavel_sv_1982
9
Years of Service
User Offline
Joined: 9th Apr 2013
Location: Russia
Posted: 6th Dec 2021 19:47
Now swing the magic wand.
Have you tried to put your card there?
For example, made in FPS creator,
And converted with a welder?
programming is a hobby, not a job.
PartTimeCoder
AGK Tool Maker
7
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 6th Dec 2021 21:21
Expelliarmus!! ....

Many Confucius quotes are running through my head right now!

I do not have FPSC or the welder installed, sorry, you still have not said what is not working, I think I need a magic wand trying to solve your problem!!

upload your project to dropbox [or other reputable file sharing site] and PM me a link I will take a look but I am not installing a bunch of stuff just to answer a question
Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
EdzUp
20
Years of Service
User Offline
Joined: 8th Sep 2002
Location: Citadel Cyberspace
Posted: 14th Dec 2021 08:48
For one thing shouldn't the length of the array be set to 0 not -1 as setting to -1 will cause an issue when accessing the materials array.
-EdzUp
Patreon: https://www.patreon.com/EdzUp
Buy me a coffee:https://www.buymeacoffee.com/EdzUp
pavel_sv_1982
9
Years of Service
User Offline
Joined: 9th Apr 2013
Location: Russia
Posted: 14th Dec 2021 13:24 Edited at: 14th Dec 2021 13:25

It seems to have worked out, but the last texture for some reason does not want to dress.

programming is a hobby, not a job.

Attachments

Login to view attachments
Bored of the Rings
17
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 14th Dec 2021 13:42
a quick guess at a glance:

try removing the -1 from:

function SetObjectMaterials(WorldObjectID)
for MeshID=1 to GetObjectNumMeshes(WorldObjectID)-1
Professional Programmer, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others
pavel_sv_1982
9
Years of Service
User Offline
Joined: 9th Apr 2013
Location: Russia
Posted: 14th Dec 2021 14:30 Edited at: 14th Dec 2021 14:59
function SetObjectMaterials(WorldObjectID)
for MeshID=1 to GetObjectNumMeshes(WorldObjectID)
Error message.




Also wrong texturing....


But this is in principle decisive.
You can change the names of the textures in the substitution mode and leave them when they coincide with the original.
But it’s hard.
programming is a hobby, not a job.

Attachments

Login to view attachments
blink0k
Moderator
9
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Dec 2021 19:55 Edited at: 14th Dec 2021 19:55
That error suggests to me that you have more meshes in the object than you think.
It would also explain why one of the textures is not showing
pavel_sv_1982
9
Years of Service
User Offline
Joined: 9th Apr 2013
Location: Russia
Posted: 15th Dec 2021 10:41 Edited at: 15th Dec 2021 11:06
The texture of the last mesh is not displayed.
But why are textures overlaid on their own? Unclear
That is, the textures are generally not applied quite correctly.
The map was made in FPS creator.
With the help of a tool provided by a kind user, I processed the map. And made a readable file. [file.x]
I converted the textures to a readable format. [file.png]
It seems that everything worked out, but ... It looks like we will have to start renaming textures. But they are superimposed according to their rooms.
programming is a hobby, not a job.
Bored of the Rings
17
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 15th Dec 2021 12:56 Edited at: 15th Dec 2021 12:56
if you used my tool AutoWelder, which version did you use? I have fixed texture/limb issues in latest version. if not , pls ignore this post.
Professional Programmer, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others
pavel_sv_1982
9
Years of Service
User Offline
Joined: 9th Apr 2013
Location: Russia
Posted: 15th Dec 2021 13:03
@Bored of the Rings
AutoWelder2.6d
programming is a hobby, not a job.
Bored of the Rings
17
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 15th Dec 2021 13:24 Edited at: 15th Dec 2021 13:40
Ah yes it's at v2.9, will pm you a link when I get a moment, doing this on phone
Professional Programmer, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others
pavel_sv_1982
9
Years of Service
User Offline
Joined: 9th Apr 2013
Location: Russia
Posted: 15th Dec 2021 13:28
I will be very grateful.
I already have a large collection of instruments
yours including.
programming is a hobby, not a job.
Bored of the Rings
17
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 15th Dec 2021 14:37
PM'd you a link to 2.9 AW
Professional Programmer, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others
pavel_sv_1982
9
Years of Service
User Offline
Joined: 9th Apr 2013
Location: Russia
Posted: 15th Dec 2021 15:39 Edited at: 15th Dec 2021 15:40
Thank you. I checked the object again.
It loads into dark basic pro without errors.
In the app game kit with errors.
It is necessary to look for an error in the code.
Or, using the substitution method, rename the texture files.

This means that the error is not in your program.
programming is a hobby, not a job.

Login to post a reply

Server time is: 2022-09-25 09:14:16
Your offset time is: 2022-09-25 09:14:16