espawn TRANSPORTERSTAR setactor[RETURN].pal 7
EDuke32 Scripting "CON coding help"
#1891 Posted 18 August 2016 - 05:25 PM
#1893 Posted 19 August 2016 - 02:50 AM
#1894 Posted 19 August 2016 - 03:27 AM
ifvarg sprite[THISACTOR].htextra 0 // Is this actor taking damage? { getactor[THISACTOR].htpicnum TEMP // get the tile number of the attack ifvare TEMP SHOTGUN // if it's the shotgun... { setactor[THISACTOR].xvel -10 // set its backwards velocity by 10 } }
Make sure to define the TEMP gamevar if you haven't already.
That should do it - it's a quick and dirty method but it should work. Then you can go from there and make it a bit more complex. You would put this in the actor code - I can't remember if it has to be before or after a 'ifhitweapon' statement so try both.
#1895 Posted 19 August 2016 - 07:25 AM
Mr. Alias Nameless, on 15 August 2016 - 11:42 PM, said:
I mean screen resolution, yes. For example setting 16:10 vs 16:9 and 4:3 as well as 5:4
#1896 Posted 19 August 2016 - 07:26 AM
Mblackwell, on 19 August 2016 - 07:25 AM, said:
Hasn't someone already done code for something like this that works in the software renderer, but is off in the gl renderers due to the different perspective?
It was for drawing boxes around actors from memory.
This post has been edited by Micky C: 19 August 2016 - 07:27 AM
#1897 Posted 19 August 2016 - 12:50 PM
#1898 Posted 19 August 2016 - 02:53 PM
Jblade, on 19 August 2016 - 03:27 AM, said:
ifvarg sprite[THISACTOR].htextra 0 // Is this actor taking damage? { getactor[THISACTOR].htpicnum TEMP // get the tile number of the attack ifvare TEMP SHOTGUN // if it's the shotgun... { setactor[THISACTOR].xvel -10 // set its backwards velocity by 10 } }
Make sure to define the TEMP gamevar if you haven't already.
That should do it - it's a quick and dirty method but it should work. Then you can go from there and make it a bit more complex. You would put this in the actor code - I can't remember if it has to be before or after a 'ifhitweapon' statement so try both.
Thanks Jblade! I'm not 100% about defining the 'TEMP gamevar' but I will try to look around the Wiki a bit and see if its explained there..
#1899 Posted 19 August 2016 - 02:56 PM
#1900 Posted 20 August 2016 - 07:44 AM
#1901 Posted 20 August 2016 - 11:33 AM
stumppy84, on 20 August 2016 - 07:44 AM, said:
http://wiki.eduke32.com/wiki/Scripting
You can read the first section on gamevars.
Also, there is an entry here:
http://wiki.eduke32....ar_manipulation
#1902 Posted 23 August 2016 - 04:05 AM
- getting htextra from enemies always returns -1 rather than incurring damage (i also used useractor as additional caution as wiki suggests)
- if adding cstat 256 to dead corpses for being able to shoot them, they use some hardcoded clipping rectangle as high as the living actor (see pic below); maybe i miss something, but I found no way to change it by working on clipdist or various flags.
I know that the first issue can be avoided by constantly checking actor's extra, and the second with separate actors for corpses.
Unfortunately the separate actor solution opens several issues in a project i'm working on, if not solvable via attributes or some strange trick.
#1903 Posted 23 August 2016 - 10:47 AM
RichardStorm, on 23 August 2016 - 04:05 AM, said:
If that were true it would break just about every one of my mods, and since I have released tested versions of some mods using the latest r5811 snapshot, I have to conclude that you are doing something wrong. Most likely, you are checking htextra after the actor has called ifhitweapon (that command resets htextra to -1).
EDIT: I made an edit to the wiki page to clear that up http://wiki.eduke32.com/wiki/Htextra
This post has been edited by Trooper Dan: 23 August 2016 - 11:37 AM
#1904 Posted 23 August 2016 - 01:30 PM
#1905 Posted 23 August 2016 - 02:37 PM
Anyway, getting htextra at very top of enemy codes (before states etc) works quite well, many thanks.
But still:
Eduke Wiki of Secrets said:
i get the full amount of damage instead, like getting 200+ when shooting a 30hp liztroop with an rpg. What
Now, my main interest is that clipping shaping, i should expect another CON secret...
This post has been edited by RichardStorm: 23 August 2016 - 02:38 PM
#1906 Posted 23 August 2016 - 05:26 PM
RichardStorm, on 23 August 2016 - 02:37 PM, said:
I didn't realize that the information was missing from the wiki entry until you asked the question and I checked on it. I would argue that this is an example of the system working well -- someone asks a question, it gets answered, and then the wiki is updated so that other people won't have to ask (in theory).
RichardStorm, on 23 August 2016 - 02:37 PM, said:
i get the full amount of damage instead, like getting 200+ when shooting a 30hp liztroop with an rpg. What
I don't know who wrote that line in the wiki. Maybe it was correct at one time. Anyone with a wiki account can delete that line (maybe I will do that when I get home from work).
RichardStorm, on 23 August 2016 - 02:37 PM, said:
At the risk of being blasted for revealing that I know stuff, here goes... The hittable dimensions of an actor are determined by the tile number that it is defined on, not on the dimensions of the tile it happens to be displaying at a given moment. If an actor is displaying a dead body sprite because of an action command, that will not change the hittable area. What you need to do is use the cactor command to change its picnum to the dead body tile number. Then make the dead body tile number an actor with appropriate code.
#1907 Posted 23 August 2016 - 08:18 PM
Great times!
#1908 Posted 15 December 2016 - 06:21 PM
Like for the player we have
Which can move the player to any areas of the level (at the speed of light) without any use of `move` code.
*
setplayer[THISACTOR].cursectnum (sector ID numbers number)
setplayer[THISACTOR].posx (horizontal distance number)
setplayer[THISACTOR].posy (vertical distance number)
setplayer[THISACTOR].posz (height altitude number)
setplayer[THISACTOR].ang (its angle number)
But is there a version of this code to teleport an individual sprite*
Like a version as the code above but for nonplayer sprites?
#1910 Posted 15 December 2016 - 08:46 PM
I put the setsprite THISSPRITE and the xyz coordinates etc.
#1911 Posted 27 December 2016 - 12:17 PM
I havent found enough information about that.
1- "status and crosshair" page (available from "display options" menu) ;
2- "select skill" when loading a new game ; I know this is port 110 but how to skip it ? manipulating the RETURN would lead back to a menu again. Maybe I'm not reasoning in the right way...??
As a subsidiary question : I managed to skip "cheat" menu - and other unused ones - but when I click on them, the main menu is "reloaded" and thus "slides".
I don't want to see that ; I would have liked nothing happens when an user select an "unavailable" page.
This post has been edited by David B.: 30 December 2016 - 09:12 AM
#1912 Posted 01 January 2017 - 08:37 AM
I wanted to try some things in scripting and I have a small problem :
I have made a switch to operate a door and I want this switch to get back to "released" state after a delay while in "pressed" state you can't activate it.
It works nearly as I want but sometimes the switch is reactivated nearly immediately (the door open a bit and close afterwards - and vice versa).
Any help is welcome,
Bye,
DotK3D
here the code :
// Custom switches define NEWSWITCH 3585 action NEWSWITCHRELEASE 0 1 1 1 1 action NEWSWITCHPRESS 1 1 1 1 1 eventloadactor NEWSWITCH gamevar activatorLotag 0 2 getactor[THISACTOR].lotag activatorLotag enda useractor notenemy NEWSWITCH 0 NEWSWITCHRELEASE ifp pfacing ifpdistl 1280 ifhitspace ifaction NEWSWITCHRELEASE { action NEWSWITCHPRESS soundonce SWITCH_ON operateactivators activatorLotag 0 break } ifaction NEWSWITCHPRESS ifcount 64 { action NEWSWITCHRELEASE resetcount break } enda
and the test map with art file and game.con
Attached File(s)
-
testswitch.zip (23.42K)
Number of downloads: 498
This post has been edited by DotK3D: 01 January 2017 - 08:38 AM
#1913 Posted 01 January 2017 - 09:02 AM
#1914 Posted 01 January 2017 - 09:35 AM
It seem to works. I have added resetcount just after soundonce SWITCH_ON
Thanks a lot,
DotK3D
PS : I have read somewhere that a EVENT_DAMAGEWALL was planned, to do custom breakable screens If I have understand correctly, is it available ?
This post has been edited by DotK3D: 01 January 2017 - 09:37 AM
#1917 Posted 13 January 2017 - 11:29 AM
define _BPRESS #### defineprojectile _BPRESS PROJ_WORKSLIKE 1 // or 16 defineprojectile _BPRESS PROJ_EXTRA 1 // or 0 defineprojectile _BPRESS PROJ_XREPEAT 4 defineprojectile _BPRESS PROJ_XREPEAT 4 defineprojectile _BPRESS PROJ_RANGE 128 onevent EVENT_KILLIT switch sprite[THISACTOR].picnum ... case FIRELASER case PLASMA_PROJ case ... shoot _BPRESS break endswitch endevent
I tried various combinations of size, damage, no_aim flag, zshoot at 0, different range...
Is something wrong/odd in the projectile declaration, or is the whole idea wrong and there are other ways to do that ?
// edit
Also, i would know the description of the PROJECTILE_REALCLIPDIST, _ACCURATE and _NOSETOWNERSHADE flags, not yet on wiki
This post has been edited by RichardStorm: 13 January 2017 - 11:42 AM
#1918 Posted 13 January 2017 - 12:00 PM
ACCURATE: Bullet-type projectile doesn't spread.
NOSETOWNERSHADE: Shooting actor won't glow when firing the projectile.
This post has been edited by Fox: 13 January 2017 - 12:01 PM
#1919 Posted 30 January 2017 - 04:15 PM
For starters, what are the min/max values for the angoff command? It is not stated in the Wiki. Second, am I going about it all wrong?
Editing the model itself is a last resort because of it being an md3 and not something with a skeleton. I would have to manually spin all the frames by 90 degrees to keep it intact.
This post has been edited by Mark.: 30 January 2017 - 04:20 PM