Native OSP World Map [Code][Mesh] Emoticons OSP

Users who are viewing this thread

Rigadoon said:
Wow really awesome. Is there a way to make them always face you?
No, there's no way to know where the camera is currently pointed on global map, so emoticons are rotating instead, to make them face towards camera at least 50% of the time. :smile:
 
cmpxchg8b said:
Caba`drin said:
apparently without the last 0 argument in the party_set_extra_icon, the engine wasn't being passed "0" as the fade-in-out time and the icons were slowly fading out and remaining faded out. Very strange that, unlike most operations, 0 isn't the assumed value of that last element.
Only the first 3 parameters are zeroed. The rest are garbage if not set by the modder.
Good to know. Cheers, as always.


Lav said:
The only real question that remains is how to make it even better. Interface to turn emoticons on/off is one thing, adding other icon packs (if anyone else volunteers to make them) is another, can anything else be done to improve it I wonder... :smile:
If creating an in-game option, it might be handy to have it more than an on/off toggle (I'd think a menu and/or a single hot-key might be appropriate), but with varying levels/filters for the types of parties/their relationship to you that you are displaying the icons for. Off-Allies Only-Allies and Neutrals Only-All; or Off-Kingdom Parties-Lords only-Non Kingdom-Non Lords-All

Might also have a special indicator if the party has targeted the player/is following the player
 
Lav said:
Rigadoon said:
Wow really awesome. Is there a way to make them always face you?
No, there's no way to know where the camera is currently pointed on global map, so emoticons are rotating instead, to make them face towards camera at least 50% of the time. :smile:

I thought I once saw some flag for the material/mesh that said 'face the camera', but I can't seem to find it any more =/
 
Lumos said:
Sorry for the offtopic bit, but how do you, in a scene, preferably in edit mode, get the position on the ground where the mouse is pointing?
There's no way to retrieve the coordinates directly, but theoretically you can try to guess them with some high-level voodoo. You have camera position and tilt angle. You have mouse position on the screen. From this, you can deduce the line on which your point is supposedly located, and angle at which this line travels from camera eye. With these numbers, you can build a formula h = f(d), where d is the distance from camera, and h is the height that terrain must have at this distance in order to intersect with your ray. Then just iterate your terrain starting from camera position and until end of map, and find the chunk where you have the first intersection. Then you can increase precision by splitting it in half several times, until you pinpoint your location with required accuracy.

Just please don't ask me to write a script for this, because it's hell. :smile:

UPDATE: Actually I think there's an easier way if you first identify the angle of mouse-pointer-defined-ray precisely (you can do this in about 11 iterations for any screen resolution up to 204:cool:, and then iterate some position along that angle, checking distance to ground for each iteration, until your position either travels to the map edge, or happens to be below ground.
 
Lav said:
Rigadoon said:
Wow really awesome. Is there a way to make them always face you?
No, there's no way to know where the camera is currently pointed on global map, so emoticons are rotating instead, to make them face towards camera at least 50% of the time. :smile:

Take a look to billboarding with shaders.
Code:
http://www.flipcode.com/archives/Billboarding-Excerpt_From_iReal-Time_Renderingi_2E.shtml

clouds.jpg
 
Lav and Mandible proudly present:
Emoticons v.1.0

3756-1-1345024369.jpg

Looters are trying to escape their rightful punishment!

3756-2-1345024369.jpg

Some lord is patrolling around Suno.

3756-3-1345024369.jpg

Those merchants have only one thing on their minds...

Download URL: http://mountandblade.nexusmods.com/mods/3756

Call "script_show_emoticons" to turn emoticons on (they are enabled by default), and "script_hide_emoticons" to turn them off.

If you want to disable them by default, initialize global variable "$g_disable_emoticons" with a non-zero value anywhere in "script_game_start".

Enjoy!
 
Nice work, Lav & Mandible.

I've added this to the latest version of the Floris Workshop.

Edit:
After playing around with this for a bit I noticed two points you may want to correct for your release.

1.) The option to disable the emoticons is available via script, but it has no method for triggering based upon toggling the global you've put in.  So changing "$g_disable_emoticons" to 1 doesn't really trigger turning them off.  I put in a second trigger and second global (to prevent the script always firing) to do this.  Something like:
Code:
    (3,
        [
            (eq, "$g_disable_emoticons", 1),
            (eq, "$g_emoticons_hidden", 0),
	    (call_script, "script_hide_emoticons"),
	    (assign, "$g_emoticons_hidden", 1),
        ]),

2.) More important is that there is a CTD bug in script "hide_emoticons".  As soon as I told the mod to disable the emoticons I'd get a crash whenever that script fired.  It appears this line was missing some arguments.
Code:
(party_set_extra_icon, ":pid", 0), # Clear
I changed it to this and that appears to be working correctly.
Code:
(party_set_extra_icon, ":pid", 0, 0, 0, 0, 0), # Clear
 
Strange, it worked fine for me. Oh well, the typical developer's "it works fine on my machine" syndrome. :smile:

Thanks, I'll make the fix ASAP.

UPDATE: Fixed. Thanks again!
 
Windyplains said:
1.) The option to disable the emoticons is available via script, but it has no method for triggering based upon toggling the global you've put in.  So changing "$g_disable_emoticons" to 1 doesn't really trigger turning them off.  I put in a second trigger and second global (to prevent the script always firing) to do this.
No, this is working as intended. Global should be set in script_game_start if you want to override default behavior - otherwise, you are supposed to call show_emoticons or hide_emoticons which will not only set the global to a proper value, but also instantly show/hide emoticons that are supposed to be shown/hidden. This means that you can hide them even while the game is on pause, and the effect will be immediately obvious - unlike setting global and waiting for a related trigger to fire.
 
That makes sense if you are using a menu system to toggle your game options.  I didn't think of it that way.  Instead I was opting for a checkbox list of options and wanted to make sure folks had the option to enable/disable it.  Pretty cool idea and implementation.
 
Windyplains said:
That makes sense if you are using a menu system to toggle your game options.  I didn't think of it that way.  Instead I was opting for a checkbox list of options and wanted to make sure folks had the option to enable/disable it.
Ah, I see. Floris does use a special presentation for configuration options, doesn't it? In this situation introduction of the second global variable is probably the best option.

It's just the matter of personal style really - I always try to keep number of globals to absolute minimum, even if this makes me write an extra few lines of code to do something.
 
I'll just put this here as a personal reminder. Marco did some billboard/impostor shaders for The Last Days' map trees back then:

Code:
http://mbx.streetofeyes.com/index.php/topic,812.msg20088.html#msg20088
http://mbx.streetofeyes.com/index.php/topic,812.msg20380.html#msg20380

http://vcg.isti.cnr.it/~tarini/tmp/newmap/newtrees/for_trees.fx
http://vcg.isti.cnr.it/~tarini/tmp/newmap/newtrees/ver2/for_trees.fx

Really great, pioneering advanced modding since 2007, Just in case you need them.
There are a good bunch of interesting experiments all along the thread, worth taking a look and learn from them.
 
Back
Top Bottom