Commit Graph
82 Commits
Author SHA1 Message Date
ac-stef 400e7eb9a6 fix glitch in map editor that allowed to violate map borders
Also, provide a more detailed error message in case of client fatal due
 to bad map (with non-solid borders).
2015-01-29 15:09:54 +01:00
ac-stef e2ac8efadd remove restrictions on mapmodel rotation
Until now, the angles of mapmodels (and ctf-flags) were rounded to the
nearest 15-degree-step during rendering. This patch moves the rounding
to the time of placement of the model. Now the angle can be changed freely
after the model has been placed.

This commit also changes the angle resolution to 0.25 degree.

When changing the angle (press "1" + scrollwheel), additionally pressing
editmeta (a.k.a. LCTRL) changes the increments of the wheel from 1 to 10.

During a savemap with format 9, the angle resolution is reduced again, to
keep compatibility. Therefore, this features is only for testing right now.
It won't be preserved during a save (at least, as long as format 9 is used)
2014-10-22 12:08:42 +02:00
aurhatandac-stef 38d88602aa Drop activated grenade, when player switches to edit mode 2014-07-19 14:38:33 +02:00
ac-stef b3ee85fd6d fix failed assertion on making selections in editmode
last() may not be used on an empty vector

also, the FIXME was obsolete, since addselection() does call correctsel()
2014-06-07 00:30:50 +02:00
ac-stef bca1e7a3cc play drop sound when exiting edit mode
...and the player "drops" back into the map
(fixes issue #55)
2014-05-24 16:47:07 +02:00
ac-stef 493aefd34b fix: convert xmap path names for windows
* make sure, unsaved edits only count in editmode (otherwise "watercolour"
  in map configs would already be "edits")

* nicer filenames for backup-xmaps

* catch failed xmap file write access

* unsavededits is now flag (!= 0) and counter - to enable scripts to
  detect "new edits".

new commands:

xmap_delete_backup    deletes the backup xmap

xmap_keep_backup    moves the backup xmap to a regular named spot

xmap_rename    changes the nickname of an xmap
2014-05-19 12:31:26 +02:00
ac-stef af92c3cf22 substitute ffs()
windows libraries seem to lack this nice function
2014-05-16 18:38:51 +02:00
ac-stef b0649b5ea5 multiple map buffers for map editing: "xmaps"
An xmap holds everything related to map editing at a certain moment: it is
a map editing snapshot. It contains the name, the header, the geometry,
the entities, the extra headers, the undo/redo data and the cameraposition
from the moment, the snapshot was taken.

Xmaps are held in memory and, if persistentxmaps is set to "1", are saved
at game end and restored at game start.

xmap_list
  lists all xmaps currently in memory

xmap_store <nickname>
  create a snapshot and store it under the given nickname
  (nicknames have to qualify as valid filenames)

xmap_restore <nickname>
  restores the named snapshot. Also creates a backup snapshot of the
  current editing data.

xmap_restore
  restores the last automatic backup snapshot. Automatic snapshots are
  taken, a) before a snapshot is restored, b) before a new map is loaded
  (if there were unsaved edits on the map) and c) when the game ends (if
  there were unsaved edits).

xmap_delete <nickname>
  deletes the named snapshot.

Unsaved edits are flagged in the HUD with an "U" in the lower right
corner of the screen.

The files with the persistent xmaps are stored in mapediting/xmaps. After
they were restored at game start, the files are moved to
mapediting/xmaps/backups. Xmap files are cubescript files.
2014-05-15 17:34:25 +02:00
ac-stef d3bda71212 map file addons: embedded config file; persistent undo/redo data
This commit establishes an extensible way of storing additional data in
map file headers. Those header extras can be permanent, like the embedded
config file or be used only once after map load like the undo/redo data.

Additional extra data can be easily added and will not break backward
compatibility, so this map format should hold up for quite some time.

To make things easier for mappers, maps can now be saved without invoking
the various optimisations. That, in combination with the stored undo data,
means, that editing a map can be picked up at exactly the same state, as
the map was saved in.

Maps will automatically be written in the appropriate fashion, depending
on the situation:
 1) for sendmap: no optimisation, no undo data
 2) savemap during editing: no optimisation, with undo data
 3) savemap when not editing: optimised, no undo data
 4) savemapoptimised: optimised, no undo data
(For savemap to save different maps during editing, the variable
 preserveundosonsave has to be "1". It is "0" by default.)

All of the above map files can be played without problems - they only
differ in file size. (However, maps with undo data may be too big to send)

The new command "embedconfigfile" will load the config file, include it in
the map header and rename the original text file.

"extractconfigfile" will write an embedded config file to a separate file
and remove it from the map header.

Embedded config files take precedence over regular config files and
therefore make it harder for cheaters to play with modified config files.

further changes: cleaned up some debugging code; more ASSERTs
2014-05-15 16:07:52 +02:00
ac-stef 832e46141b undo/redo with editmeta pressed also restores player position
also selects the affected area
(less useful in coopedit because always the own position is restored)

for testers: editmeta still defaults to LCTRL
2014-05-15 13:48:31 +02:00
ac-stef aaf01e8b2a redo for the editor
an undo for undos :)
2014-05-15 13:48:31 +02:00
ac-stef 50b3f6867c show detailed data of the cube inside editing focus
* shows all geometry data of the cube in editing focus in the hud
* can be toggled by F8 in editmode
* shows cuby type, floor and ceiling heights, vdelta and all textures

(if mipstats *and* edit focus details are requested: show focus detail)
2014-05-15 13:48:30 +02:00
ac-stef 2c2395d97a have the waterlevel variable reflect the actual value of the map 2014-05-15 11:43:37 +02:00
ac-stef ff8aea940d some edit fixes
* fixing edit paste
* fix power of 2 check for corner selection
* fix pasting multiple selections changed target selections
* fixing editdrag: plugging memory leak
* fixing editdrag: proper binding of keys
* fixing editdrag: allow deselecting (by selecting a second time)
* make a little more room for undos (RAM is cheap and maps are big)
* some cleanups
2014-05-15 11:42:54 +02:00
ac-stef eb60302e67 cleanup
- fix possible crash in conc (but it's still an ugly hack)
- fix noob usage of strcmp
- flag some memory leaks (it would be nice, if the author(s) would clean
   up the mess himself)
- fix crash in substr
- whitespace cleanup

there are plenty more memory leaks in command.cpp - for example, every
goto in cubescript does not clean up anything
2014-05-14 22:54:37 +02:00
ac-stef e69a94cdd8 loop optimizations
also cut some overshooting lines
2014-01-31 00:53:12 +01:00
ac-stef d258b7c186 less annoying visualisation for tagclips
- press B to get the former filled volume view
- raise the value of tagnumfull to get both views simultaneously
- cubescript parameters should be cleaned up before release
2014-01-30 19:38:41 +01:00
ac-stef a8d2ab1c65 transformclipentities improved
The function will now also take care of obsolete clip entities, which
gives the mapper the opportunity to tag clip areas manually and then
have the envelopped (and therefore obsolete) clip entities removed.

When done, the map will be cleaned of "clip & plclip" tags, since clip
already includes the properties of plclip.
2014-01-29 13:03:37 +01:00
ac-stef 7f12ef4131 command to automatically convert all suitable clip entities into tag clips
also: fix sparklies in heightfields
2014-01-29 00:03:50 +01:00
ac-stef 0ff8fafb5f limit particle emission to 50 fps 2014-01-28 16:01:21 +01:00
ac-stef 6f5635917f visualisation for tagclips
To keep things cheap, only tagged areas inside the editing grid are shown.
I added two variables, tagnum and taglife, to allow playing with the
parameters of the sparklies. Those should be removed later. The default
values work quite well on my really crappy onboard graphics card. Higher
values start dropping fps.

Also, the edit status line now shows the tag value of the cube pointed at.

The patch also fixes the bug, that the edit status line did not show
details about the selection, unless there was at least one entity in the
map.
2014-01-28 14:28:43 +01:00
Lucas GAUTHERON 31c0d29bc2 minor code "fixes"
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7276 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-03-02 15:04:23 +00:00
Bukz f353141284 alias newselkeys - "binds" a list of keys to make new (multiple) selections in editmode (left CTRL is default)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7221 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-02-17 02:21:07 +00:00
Ronald Reagan ca838cd760 Two bug fixes, Mouse1+E crash, and setnext in SP crash
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6969 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2012-12-11 20:52:57 +00:00
sireus b2daa778b7 use the right function (thanks, Felix)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6936 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2012-11-20 16:10:30 +00:00
sireus b33116712c sane(r) command signatures (warning: huge commit)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6908 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2012-10-06 22:49:49 +00:00
Bukz 0a0d09e73a /paste fix, use light data from destination not the source
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6804 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2012-05-23 15:21:24 +00:00
Bukz be0f32d2c7 /paste remip fix
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6803 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2012-05-23 15:08:01 +00:00
Lucas GAUTHERON 37efdcdb3e registersound fix, + new "showgrid" variable
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6729 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-12-10 18:03:04 +00:00
Lucas GAUTHERON b8fd22b476 lil' fix
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6707 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-11-22 19:16:54 +00:00
flowtron 5f3fb3ef67 keep SPECT state across spawns
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6665 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-10-15 23:57:27 +00:00
Lucas GAUTHERON f1ff34db9c small fix
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6662 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-10-02 15:20:18 +00:00
Lucas GAUTHERON 4c3fdd16ef cubescript commands (addselection/resetselections) + win32 binaries
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6661 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-09-30 18:54:18 +00:00
Lucas GAUTHERON 8f90268d82 multiple selections support in editmode
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6647 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-09-14 14:59:40 +00:00
aerkefiende 06f73f4627 Replaced Tabs with 4 spaces in every source file
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6561 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-07-31 15:44:57 +00:00
Lucas GAUTHERON b339831354 settex command
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6303 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-04-23 09:35:18 +00:00
Lucas GAUTHERON ca7867aa1f git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6175 e016b1c5-ed68-44aa-a2f7-31cac88cffde 2011-03-31 19:09:19 +00:00
flowtron af5902b370 revert bogus and really fix stuck-in-editmode bug
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5741 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-10-10 13:34:58 +00:00
flowtron 0a077bbae3 TESTING: avoid being stuck in editmode + minor stuff
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5737 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-10-09 22:59:24 +00:00
flowtron e4bc0ea4c6 informative edittoggle
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5687 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-09-11 14:38:51 +00:00
flowtron 0d4a1e4deb remove double-send
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5286 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-07-05 18:45:36 +00:00
flowtron fd07a2be14 fixing bugs 2913506 and 2913507
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5284 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-07-05 18:35:16 +00:00
Lee Salzman e725e5ed8c string function cleanups
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4714 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2009-11-07 22:44:32 +00:00
Lee Salzman 54cc44c3db revising pch setup
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4690 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2009-11-07 06:42:37 +00:00
flowtron 3dfc3ae815 basic MapPack/MediaPack functionality - "checkmapdependencies"-CubeScript command needs testing/validation.
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4649 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2009-10-04 12:38:12 +00:00
ac_stef f1e879e7fd akimbo bug fixed; some new bugs added
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4598 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2009-08-05 21:21:57 +00:00
ac_stef 39d3868406 cleanup
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4345 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2009-04-15 16:12:22 +00:00
flowtron 7fae585a88 don't set health to 100 on edittoggle since it's only client-side anyway (bug found by grenadier)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4302 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2009-03-28 14:51:25 +00:00
ac_stef 720f7c4651 convenient moving of map entities
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4240 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2009-03-03 13:53:17 +00:00
Lee Salzman 0e25e544e3 delete type fix
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3690 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2008-11-20 21:23:45 +00:00