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 DBPro Corner / Annoying Pause when Making a Unit

Author
Message
Renegade Andy
19
Years of Service
User Offline
Joined: 16th Oct 2004
Location: Scotland
Posted: 21st May 2006 04:38
Hey guys. I have a "makeunit function" ok.

All this does is load and setup a new unit, basically a .x object.

However, everytime this happens - the game freezes for about 0.5 seconds whilst that model is loaded, i cannot afford this pause - it feels weird and doesnt really make the game flow lol.

How do i remove this pause - without pre loading like 200 of these objects before the program has even run?

NO KEYBOARD DETECED - PRESS F11 TO CONTINUE - FOOKED BIOS
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 21st May 2006 05:08
If your loading the same object/unit each time, then you should look at the Clone or Instance Object commands instead. Functions like Load & Deleting object really aren't designed for real time use in Dbpro.

indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 21st May 2006 05:25
changing the x model to dbo will greatly increase loading times.

If no-one gives your an answer to a question you have asked, consider:- Is your question clear.- Did you ask nicely.- Are you showing any effort to solve the problem yourself 
Renegade Andy
19
Years of Service
User Offline
Joined: 16th Oct 2004
Location: Scotland
Posted: 21st May 2006 14:06
Ok - how do i use the clone or instance code?

NO KEYBOARD DETECED - PRESS F11 TO CONTINUE - FOOKED BIOS
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 21st May 2006 14:19
Look it up, its fairly straight forward...

Renegade Andy
19
Years of Service
User Offline
Joined: 16th Oct 2004
Location: Scotland
Posted: 21st May 2006 14:34
INSTANCE OBJECT 101,spawnworker

which equals 1001 doesnt work, it doesnt turn blue either.

NO KEYBOARD DETECED - PRESS F11 TO CONTINUE - FOOKED BIOS
Renegade Andy
19
Years of Service
User Offline
Joined: 16th Oct 2004
Location: Scotland
Posted: 21st May 2006 15:22
when i use clone object spawnworker,1

it loads an instance of the model but it doesnt texture the model!

Why!

NO KEYBOARD DETECED - PRESS F11 TO CONTINUE - FOOKED BIOS
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 21st May 2006 17:34
You probably have to texture it. Load the texture before the game starts, and then texture the model after you clone it. That's what you have to do in DB Classic, but I don't know about DB Pro.

Renegade Andy
19
Years of Service
User Offline
Joined: 16th Oct 2004
Location: Scotland
Posted: 21st May 2006 17:51
But you dont need to do that otherwise, argh.

Ok so i do - load image "models\dwarf.jpg", 60

and then texture object spawnworker,60

???

NO KEYBOARD DETECED - PRESS F11 TO CONTINUE - FOOKED BIOS
Renegade Andy
19
Years of Service
User Offline
Joined: 16th Oct 2004
Location: Scotland
Posted: 21st May 2006 17:53
that still doesnt work - just tried it.

NO KEYBOARD DETECED - PRESS F11 TO CONTINUE - FOOKED BIOS
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 21st May 2006 18:08
Well did you texture the clone, or the original model, because you are supposed to texture the clone. It should work.

Renegade Andy
19
Years of Service
User Offline
Joined: 16th Oct 2004
Location: Scotland
Posted: 21st May 2006 18:29
I textured the clone :

Clone object spawnworker,256
texture object spawnworker,60

and thats after loading

load image "models\dwarf.jpg",60
load object "models\dwarf1.x", 256

those at the beginning of the code.

NO KEYBOARD DETECED - PRESS F11 TO CONTINUE - FOOKED BIOS
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 21st May 2006 20:09
Maybe jpg does not work, try bmp.

Renegade Andy
19
Years of Service
User Offline
Joined: 16th Oct 2004
Location: Scotland
Posted: 21st May 2006 20:21
Nope. Tried that also - still nothing.

NO KEYBOARD DETECED - PRESS F11 TO CONTINUE - FOOKED BIOS

Login to post a reply

Server time is: 2024-09-24 23:32:32
Your offset time is: 2024-09-24 23:32:32