EDuke32 Scripting "CON coding help"
#1831 Posted 24 January 2016 - 03:09 PM
#1832 Posted 29 January 2016 - 07:11 PM
I tried this:
onevent <EVENT_WEAPKEY7> { setvar RETURN 6 } endevent
which I thought would do it, then experimented with curr_weapon checks and never got it to work at all.
EDIT:
nevermind I got it figured out.
This post has been edited by Drek: 29 January 2016 - 09:24 PM
#1833 Posted 01 February 2016 - 01:20 PM
TTFN,
Jon
#1834 Posted 01 February 2016 - 01:43 PM
#1835 Posted 01 February 2016 - 03:26 PM
Hendricks266, on 01 February 2016 - 01:43 PM, said:
Excellent In order to avoid modifying DEFS.CON I saved my alternative sound track as "watrwld1.ogg" (==e1l4) and used "starttrack 3" and that worked a treat.
Is there a way of getting Eduke to always look for alternative tracks in the same folder as the map that is running ? I know in the startup screen there is a dropdown where you specify the appropriate folder and obviously that works but it is easilly overlooked.
TTFN,
Jon
#1836 Posted 06 February 2016 - 10:44 AM
then falls, bounces few times and explodes.
When I tried other ways it doesn't bounce high.
I've tried OFFSET, Similar to a spit etc.
It partially works but not much.
I want the projectile to "aim" at the player but if I use RPG style (WORKSLIKE 2) it wont bounce but will explode on impact.
defineprojectile 16270 PROJ_WORKSLIKE (???what to put to do like in the picture below???)
defineprojectile 16270 PROJ_TRAIL SMALLSMOKE
defineprojectile 16270 PROJ_CLIPDIST 19
defineprojectile 16270 PROJ_VEL 911
defineprojectile 16270 PROJ_VEL_MULT 4 (speed may change if too fast since throwing and RPG speed seems to be different)
defineprojectile 16270 PROJ_EXTRA 410
defineprojectile 16270 PROJ_OFFSET 224 (like a morter but doesn't work right probably due to wrong WORKSLIKE)
defineprojectile 16270 PROJ_DROP -131
defineprojectile 16270 PROJ_BOUNCES 4
defineprojectile 16270 PROJ_BSOUND HARDIMPACT
defineprojectile 16270 PROJ_HITRADIUS 3666
defineprojectile 16270 PROJ_XREPEAT 18
defineprojectile 16270 PROJ_YREPEAT 18
defineprojectile 16270 PROJ_ISOUND PIPEBOMB_EXPLODE
defineprojectile 16270 PROJ_FLASH_COLOR 2
defineprojectile 16270 PROJ_SPAWNS EXPLOSION2
Here is the pic in details.
This post has been edited by Zaxtor: 06 February 2016 - 10:45 AM
#1837 Posted 06 February 2016 - 12:31 PM
#1838 Posted 07 February 2016 - 09:43 AM
Zaxtor, on 06 February 2016 - 10:44 AM, said:
Here is a workslike flag I use for a projectile that bounces off floors and walls without exploding... till reaching numbouces
36870
=
32768 damage on impact for rpg-type (rather than damage only by hitradius)
+
4096 noaim...doesn't autoaim
+
4 bounces off walls
You will want to take out the 4096 for noaim, and add in the timer flag I'd imagine, plus that loses velocity one TD mentioned.
#1839 Posted 12 February 2016 - 07:30 PM
proj goes upward then fall (bounced few times and explode)
but semi-aims at you once it finishes going up and then slightly-heading toward you.
However I may use those for diff projectile.
#1840 Posted 21 February 2016 - 06:35 AM
I need a function that takes parameters: camerax,cameray,cameraz,camerasect,camerahoriz,cameraang, screenx,screeny (xd,yd) and return x,y,z in build coordinates.
Can somebody help with programming such functions for non classic modes?
#1841 Posted 29 February 2016 - 11:38 PM
Now we need to translate it into the CON
input: x, y, Fov, pan, tilt, w, h
output: panRes, tiltRes
pan = tofloat( get("camera","pan") ); tilt = tofloat( get("camera","tilt") ); fov = tofloat( get("camera","fov") ); w = tofloat( get( "applet", "width" ) ); h = tofloat( get( "applet", "height" ) ); x = tofloat( x ); y = tofloat( y ); r = (sqrt(w*w + h*h) / 2.0) / tan( gradToRad(fov/2.0) ); vx = r; vy = w/2.0 - x; vz = h/2.0 - y; pan = gradToRad( pan ); tilt = gradToRad( -tilt ); cosp = cos( pan ); sinp = sin( pan ); cost = cos( tilt ); sint = sin( tilt ); /*My * Mz*/ vx2 = vx*cost*cosp - vy*sinp + vz*cosp*sint; vy2 = vx*cost*sinp + vy*cosp + vz*sint*sinp; vz2 = -vx*sint + vz*cost; sinRes = vy2 / sqrt(vx2*vx2 + vy2*vy2); panRes = radToGrad( asin(sinRes) ); if( vx2 <= 0 && vy2 > 0 ) panRes = 180 - panRes; else if( vx2 < 0 && vy2 <= 0 ) panRes = -180 - panRes; sinRes = vz2 / sqrt(vx2*vx2 + vy2*vy2 + vz2*vz2); tiltRes = radToGrad( asin(sinRes) );
Where:
w, h - width and height of Java Applet (pixels);
Fov - current field of view angle (degrees);
pan, tilt - camera direction point (degrees).
panRes, tiltRes - model coordinates of clicked (x, y) point (degrees).
x, y - screen clicked point coordinates (pixels);
r - panorama model sphere radius;
vx, vy, vz - coordinates of vector from origin to picked point in projection plane;
vx2, vy2, vz2 - transformed vector of picked point.
#1843 Posted 01 March 2016 - 05:05 AM
Fox, on 01 March 2016 - 12:35 AM, said:
Thank you captain! Hitscan does not take into account the position of the cursor on the screen. I need the ability to select objects on the screen by mouse cursor
This post has been edited by Mr. Alias Nameless: 01 March 2016 - 05:06 AM
#1845 Posted 01 March 2016 - 06:17 AM
Fox, on 01 March 2016 - 05:21 AM, said:
Yes, of course I have coded a cursor. But how to use the cursor position in the hitscan function?
#1846 Posted 01 March 2016 - 06:33 AM
#1847 Posted 01 March 2016 - 07:47 AM
Mr. Alias Nameless, on 01 March 2016 - 06:17 AM, said:
Use getangle to determine the angle in relation to the screen cordinates (320px = 90º). Remember that when you are looking up or down the view differs drastically between classic and OpenGL modes.
#1848 Posted 01 March 2016 - 09:49 AM
#1849 Posted 02 March 2016 - 01:04 AM
Fox, on 01 March 2016 - 07:47 AM, said:
thank you this is useful.
Trooper Dan, on 01 March 2016 - 09:49 AM, said:
It is very difficult, due to the fact that there is no floating-point numbers in CON. And there is always the risk of overflow.
#1850 Posted 07 March 2016 - 01:54 PM
Maybe I can draw a graphic on top of where the string appears? EDIT: Nope, it looks like it is only possible to detect whether the player is in a menu, but not which specific menu, unless I am missing something.
This post has been edited by Trooper Dan: 07 March 2016 - 02:05 PM
#1851 Posted 07 March 2016 - 02:50 PM
#1852 Posted 07 March 2016 - 04:12 PM
gamevar screenx 0 0 gamevar screeny 0 0 defstate menuwhatever getuserdef .m_origin_x screenx getuserdef .m_origin_y screeny ifvare current_menu 110 // MENU_SKILL { // use screentext with the <<16 bit set, and *add* the coordinates you want to draw to screenx/y so it animates with the menu } ends onevent EVENT_DISPLAYMENUREST state menuwhatever endevent onevent EVENT_DISPLAYINACTIVEMENUREST state menuwhatever endevent
#1853 Posted 07 March 2016 - 07:55 PM
#1854 Posted 08 March 2016 - 06:04 AM
#1855 Posted 08 March 2016 - 08:26 AM
gamevar screenx 0 0 gamevar screeny 0 0 defstate menuwhatever getuserdef .m_origin_x screenx getuserdef .m_origin_y screeny ifvare RETURN 110 // MENU_SKILL { // use screentext with the <<16 bit set, and *add* the coordinates you want to draw to screenx/y so it animates with the menu } ends onevent EVENT_DISPLAYMENUREST state menuwhatever endevent onevent EVENT_DISPLAYINACTIVEMENUREST state menuwhatever endevent
#1856 Posted 18 March 2016 - 12:13 PM
#1857 Posted 18 March 2016 - 03:43 PM
#1858 Posted 18 March 2016 - 04:10 PM
#1859 Posted 18 March 2016 - 06:06 PM
#1860 Posted 18 March 2016 - 09:22 PM
Fox, on 18 March 2016 - 03:43 PM, said:
Most of the sprites in question are pickable objects, such as ammo. Doing what you suggest would cause the player to pick them up in some cases. What I'm going for is a kind of X-ray vision that reveals objects in secret areas. But it's okay, I've decided I don't really need it, I can make do with something else.