home home

downloads files

forum forum

docs docs

wiki wiki

faq faq

Cube & Cube 2 FORUM


Save/load selected cubes

by RPG on 01/31/2011 20:55, 46 messages, last message: 02/18/2011 23:42, 7851 views, last view: 05/19/2024 00:56

This is idea in editing.
Like copy/paste, but you can save selection on disk and load it later or use in other maps. For example, you create arch/sphere/house and want to save it on disk to use later or use on other map.

These cube "presets" will keep much time when you using geometry of the same type (arches and ladders for example). You could "save" house/ladder/shere from one map and use it in your own map. Very convenient.

Is there any complete solutions?

I think it's possible to create preset library of houses, laggers, spheres, circles, arches and so on like mapmodels, but based on octree geometry.

/loadpreset sphere_4.oct -> put in cursor sphere of radius 4 (just suggestion).

Go to first 20 messagesGo to previous 20 messages    Board Index    Go to next 20 messagesGo to last 20 messages

#7: ..

by RPG on 02/01/2011 16:00

if (noedit(false, true)) return;

What does it mean? false, true... maybe:)

reply to this message

#8: ..

by Osbios on 02/01/2011 16:36

The function noedit test if you are in edit mode.

The first value decides if the selection can be outside of your view.
Set it to false so you don\'t edit your selection by accident if you forgot about it, e.g. if you want to edit something later without selecting it explicit and the old selection is still active.

The second value just enables error messages.

The return value gives you the \"its ok to edit\" or \"no no\".

reply to this message

#9: ..

by RPG on 02/01/2011 18:26

I hope to see it in the next release.
Next step - adding presets in menu like mapmodels.

reply to this message

#10: Re: ..

by SheeEttin on 02/01/2011 20:38, refers to #9

May I also suggest a variable to define where these prefabs are stored, so we don't have them cluttering up packages/base? ;)

Also, I'm curious to know why you're delete-ing things that haven't been new'd.

reply to this message

#11: ..

by Razgriz on 02/01/2011 20:42

"could no load preset hoouse"

i guess your fingers are slippery :P

reply to this message

#12: ..

by RPG on 02/01/2011 21:58, refers to #11

> May I also suggest a variable to define where these prefabs are stored, so we don't have them cluttering up packages/base? ;)
I think "packades/presets" will be enough.
packades/presets/ladders
packades/presets/arches
packades/presets/buildings
packades/presets/etc...

I would be very grateful if someone will make a set of primitives such as circles, cylinders, spheres, arches.

> Also, I'm curious to know why you're delete-ing things that haven't been new'd.
What are you talking about?

> i guess your fingers are slippery :P
It was a misprint :D

reply to this message

#13: Re: ..

by SheeEttin on 02/01/2011 22:48, refers to #12

> stream *f;
but:
> delete f;

Unless I'm missing something really obvious.

As for your primitives:
http://quadropolis.us/node/2058
http://quadropolis.us/node/2133
They'd just need to be broken up. :)

reply to this message

#14: ..

by RPG on 02/01/2011 23:23

> > stream *f;
> but:
> > delete f;
>
> Unless I'm missing something really obvious.
Taken from original cube source. I think that's right.

Done:
http://ompldr.org/vNzkydA

showpresetsshot = [ guibar; guiimage (concatword "packages/presets/" (if (> $numargs 0) [result $arg1] [result (at $guirollovername 0)]) ".jpg") $guirolloveraction 4 1 "data/cube.png"]

newgui presets [
guilist [
guilist [
loopfiles f packages/presets pgz [
guibutton $f (concat loadpreset $f) "cube"
]
]
showpresetsshot
]
]
editbind "F7" [if (cleargui 1) [] [showgui presets]]

reply to this message

#15: Re: ..

by suicizer01 on 02/01/2011 23:54, refers to #14

0.0! Very interresting! I really hope it makes the next release, so not only people who map and also program take profit out of it, but also average knowledged mappers.

reply to this message

#16: ..

by RPG on 02/02/2011 16:12

My code still not working as I want. When I try to save/load file only by name (house.pgz for example) - all right. When I try to load it from packades/presets - "could not load preset".
I tried to use "findfile" function - useless. Wheni try to load file from any other folder (except "loadpreset house") - fail.

How to load files from packade folder correctly?
The source code is poorly documented:(

And is there any way to post sources (like patches on sourceforge)? Or devs not take someone else's code?

reply to this message

#17: Re: ..

by tempest on 02/02/2011 17:00, refers to #16

I think you should load presets/blah, not packages/presets/blah.

reply to this message

#18: ..

by RPG on 02/02/2011 17:21

opengzfile("presets/sphere_1.pgz"), "rb");//not working

opengzfile("sphere_1.pgz"), "rb");//working, because i have sphere_1.pgz in ~/.sauerbraten/packades directory

reply to this message

#19: ..

by RPG on 02/02/2011 17:42

I think engine doesn't load file from "packades" in game, but loads files from "packades" in home directory.

reply to this message

#20: Re: ..

by tempest on 02/02/2011 18:31, refers to #19

You'll have to do something like this:
defformatstring(tmppath)("packages/%s.pgz", ppath);
path(tmppath);
opengzfile(tmppath, "rb");

That should work.

reply to this message

#21: ..

by RPG on 02/02/2011 19:05

Thanks, i did it (again!):
http://ompldr.org/vNzlmMw

reply to this message

#22: ..

by RPG on 02/03/2011 13:54

Export with entities - if you want to save a candle model with light and particle systems (fire) (work in progress).

reply to this message

#23: ..

by aiueo on 02/03/2011 18:52

Awesome. That's all I wanted to say.

reply to this message

#24: ..

by RPG on 02/03/2011 22:20

Sources are completely done. I can't build engine in Windows (using Linux), maybe someone can?

reply to this message

#25: Re: ..

by |ice|sub-zero|L on 02/04/2011 00:30, refers to #24

give me full code (of the mod you have, i already have all the normal sauer code), and the .cfg file, and i'll compile. my unpersonal email (which i don't care about because its just that "unpersonal") is soulsubzero@gmail.com

reply to this message

#26: ..

by RPG on 02/04/2011 23:27

http://ompldr.org/vN2Fpdg - screenshot
http://ompldr.org/vN2FqMw - screenshot

Current features:
- save and load seleced area, including entities - save candles with fire and light!
- keep grid size (no more scaling due to gridpower)
- fully automatic (!) menu generation based on presets folder written on cubescript
- when you save preset screenshot made automatically (new), gui hiding
- automatic grouping similar presets, for example sphere_1, sphere_2, sphere_3, sphere_4, sphere_5 will be sphere_1, 2, 3, 4, 5 (see screenshot)
- hotkey (F7)
- compact compressed files
- not compact png screnshots. When Cube 2 learn jpeg?

DOWNLOAD SOURCE:
http://ompldr.org/vN2FqYw
Replace original. Try to compile. Enjoy!
Write here about bugs and requesting features.

reply to this message

Go to first 20 messagesGo to previous 20 messages    Board Index    Go to next 20 messagesGo to last 20 messages


Unvalidated accounts can only reply to the 'Permanent Threads' section!


content by Aardappel & eihrul © 2001-2024
website by SleepwalkR © 2001-2024
54040419 visitors requested 71821493 pages
page created in 0.073 seconds using 9 queries
hosted by Boost Digital