Duke4.net Forums: EDuke32 Scripting - Duke4.net Forums

Jump to content

  • 124 Pages +
  • « First
  • 63
  • 64
  • 65
  • 66
  • 67
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   DotK3D 

#1914

That's a quick answer !

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

0

User is offline   Hendricks266 

  • Weaponized Autism

  #1915

Not yet but it is very high on my to-do list.
1

User is offline   DotK3D 

#1916

Ok, nice.

Thanks again,
Dotk3D
0

#1917

I'm trying to add to my projectile_type projectiles a way to press buttons... my idea is to shoot a short-range hitscan dummy on event_killit, but it doesn't work:

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

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1918

REALCLIP: Something to do with hard-coded behavior. Very specific usage.

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

0

User is offline   Mark 

#1919

After a long break I'm getting back into con coding ( what little I know ) . I'm a little rusty and need some help. I have an animated md3 model that unfortunately was created facing sideways. Its causing me problems when trying to use the faceplayerslow command. As expected the model's side faces the player as you move around it. So then I had the bright idea of using the angoff command to offset the model at the start to get it to spin 90 degrees CW. Problem is, when faceplayer kicks in the model still never quite faces the player. I can't seem to get the full 90 degree spin I need. I tried inserting angoff at the very beginning of the actor's code and also tried inside the brackets with the move and faceplayer command. Nothing gets me exactly what I want.

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

0

User is offline   Mark 

#1920

Double post, ahh... Blender Guru TeaMonster came to the rescue with an older version of Blender that still imported and exported md3 models properly. He was able to spin the model so I don't need the con solution right away. But for the sake of learning I would still like to know if there was a con solution that I missed.
0

User is offline   Mblackwell 

  • Evil Overlord

#1921

angoff is Build values so 0-2047, positive or negative. Positive is clockwise. 512 is 90 degrees.
1

User is offline   Mark 

#1922

AHA. So I was using the command right but didn't go high enough with the values. It was a case of me assuming wrongly that it would have been either -128 to +128 or 0-255. I never entered anything outside that range. Thanks.

If I knew how, I would add that info to the wiki.

This post has been edited by Mark.: 01 February 2017 - 04:42 AM

0

User is offline   Gambini 

#1923

nevermind, got it working!!

This post has been edited by Gambini: 02 February 2017 - 08:26 PM

0

User is offline   Gambini 

#1924

I did this, which spawns a driver on my jetskies and then it follows the player around (it´s a placeholder so we can start working on the level) but i can´t get the driver (5 angled sprite) retain the jetski (model) angle. the driver follows the jetski and all but it always points north. Any idea how to do it?

define JETSKI 5440
define JETSKISHOOT 5441
define JETSKI_DRIVER 5446

spritenvg JETSKI
spritenvg JETSKI_DRIVER
spriteshadow JETSKI

//JETSKI

define JETSKISTRENGTH 150

action JETSKISTAND 0 1 1
action JETSKIRUN   0 1 1
action JETSKISHOOT 0 2 1 4 
action JETSKI_DRIVERSTAND 0 1 5

move JETSKIRUNVEL 150
move JETSKISTOP

ai AIJETSKIGETENEMY JETSKIRUN JETSKIRUNVEL seekplayer
ai AIJETSKISHOOTENEMY JETSKIRUN JETSKIRUNVEL faceplayer

useractor notenemy JETSKI_DRIVER 0

ifvarn target -1
 {
	ifvare actorvar[target].peractor1 -1 killit
	sizeat 40 40
	getactor[target].z z
	action JETSKI_DRIVERSTAND
	cstat 0
	setsprite THISACTOR sprite[target].x sprite[target].y z
	setangle THISACTOR [target].ang
}
enda

useractor enemy JETSKI JETSKISTRENGTH
fall
ifaction 0
  {
  fall
  sizeat 58 58
  action JETSKIRUN
  cstat 257
  espawn JETSKI_DRIVER
  setactorvar[RETURN].target THISACTOR
  setvarvar peractor1 RETURN
  }

ifmove 0 move JETSKIRUNVEL faceplayer

enda


This post has been edited by Gambini: 02 February 2017 - 09:11 PM

0

User is online   Danukem 

  • Duke Plus Developer

#1925

I'm not sure how you are getting that to compile, since there is no such command as "setangle" but try this change:

ifvarn target -1
{
ifvare actorvar[target].peractor1 -1 killit
sizeat 40 40
getactor[target].z z
action JETSKI_DRIVERSTAND
cstat 0
setsprite THISACTOR sprite[target].x sprite[target].y z
setactor[THISACTOR].ang sprite[target].ang
}
enda
1

User is offline   Mblackwell 

  • Evil Overlord

#1926

Why would you need to killit if peractor1 is -1? Based on your code it will never be -1.
0

User is online   Danukem 

  • Duke Plus Developer

#1927

View PostMblackwell, on 02 February 2017 - 09:28 PM, said:

Why would you need to killit if peractor1 is -1? Based on your code it will never be -1.


He copied the code from a different actor where it made sense to have that line. I think it was code I wrote that had an enemy spawning a force field or something similar. There were other parts to it which didn't get copied. I left it in my edit because it wasn't related to the angle issue and it could become relevant later if more code is added.
2

User is offline   Gambini 

#1928

Thanks a lot! That setangle line was a blind shot trying to fix the problem, the code compiled alright without it.

Yes I based most of this by looking at code of actors that behaved similar to what i wanted. The driver (or attached sprite) is the tentacles code of the EDF troopers, i removed the pal specific lines but didn´t touch that ifvare actorvar[target].peractor1 -1 killit because i dont have a clue of what it is.
0

User is offline   Mark 

#1929

I used it a couple of years ago but I can't seem to find now the snippet of code to disable global screen flash when firing a weapon.
0

User is online   Danukem 

  • Duke Plus Developer

#1930

View PostMark., on 17 February 2017 - 07:38 PM, said:

I used it a couple of years ago but I can't seem to find now the snippet of code to disable global screen flash when firing a weapon.


http://wiki.eduke32....i/WEAPONx_FLAGS

orvar 256 on the weapon#_flags corresponding to the weapon
1

User is offline   Mark 

#1931

Thanks for steering me in the right direction. In case anyone else wants to use it.
// NO GLOBAL FLASH WHEN FIRING PISTOL SHOTGUN CHAINGUN
onevent EVENT_RESETWEAPONS
setvarvar gs WEAPON1_FLAGS
setvarvar gs WEAPON2_FLAGS
setvarvar gs WEAPON3_FLAGS
orvar gs 256
setvarvar WEAPON1_FLAGS gs
setvarvar WEAPON2_FLAGS gs
setvarvar WEAPON3_FLAGS gs
endevent

EDIT: CODE PRODUCED A GLITCH. DO NOT USE AS-IS

This post has been edited by Mark.: 18 February 2017 - 08:25 AM

0

User is offline   Mblackwell 

  • Evil Overlord

#1932

Not sure you want to use gs there, if it works it works but don't be surprised if something breaks at some point:
http://wiki.eduke32.com/wiki/Gs
0

User is online   Danukem 

  • Duke Plus Developer

#1933

View PostMark., on 18 February 2017 - 04:09 AM, said:

Thanks for steering me in the right direction. In case anyone else wants to use it.
// NO GLOBAL FLASH WHEN FIRING PISTOL SHOTGUN CHAINGUN
onevent EVENT_RESETWEAPONS
setvarvar gs WEAPON1_FLAGS
setvarvar gs WEAPON2_FLAGS
setvarvar gs WEAPON3_FLAGS


The var can only store one value at a time, so it's equal to WEAPON3_FLAGS as of that last line...
0

User is offline   Mark 

#1934

Thats copy pasted from my Graveyard mod where everything "seemed" to be fine. I pasted it in my ongoing project and at first glance it seems to be working. I'll double check.

EDIT: It works as intended removing the flash but it messed up the firing making those 3 weapons rapid fire like the chaingun. I'll have to also check to see if it affected Graveyard in the same way. Nobody ever reported the issue.... No rapid firing pistol or shotgun in Graveyard but I did not have the chaingun in it's noflash con. If I remove the noflash for weapon3, the chaingun, firing sequence goes back to normal for the pistol and shotgun while still keeping the noflash for those 2.

So I guess it will noflash for just those 2. I can live with that if no other glitches show up.

This post has been edited by Mark.: 18 February 2017 - 08:28 AM

0

User is offline   David B. 

#1935

Hello everybody,

I suppose it's the right thread to post that question, so is there any way to control an animated 3d model with the 'use' key ?
What I mean is a 3d model which starts its animation forward or backward each time the player presses the "use" key when looking at it : for example an animated switch, a valve wheel or a door.

Does anyone think it's possible - and possibly knows the way one could do that ?
0

User is offline   Mark 

#1936

I'm not sure of actual tile numbers, this is just an example. Use an existing switch that has tile 100 for open and tile 101 for close. Your animated switch model has 8 frames. 1 - 4 moving the valve wheel clockwise and 5-8 moving the wheel counter clockwise. In the defs you would assign frames 1-4 for tile 100 and 5-8 for tile 101.

There are other ways including con coding with the "ifhitspace" command which detects when the use key is pressed. But the above does not require con code. Just def'ing in the new model to replace the old.

This post has been edited by Mark.: 18 February 2017 - 12:47 PM

0

User is online   Danukem 

  • Duke Plus Developer

#1937

View PostMark., on 18 February 2017 - 07:57 AM, said:

EDIT: It works as intended removing the flash but it messed up the firing making those 3 weapons rapid fire like the chaingun.


Yes, for the reason I pointed out in my post immediately above yours. You used the chaingun value to set all 3 weapons.
0

User is offline   Mark 

#1938

I assumed wrongly that my code would have no effect on firing timing because gs had nothing to do with that. Live and learn.
0

User is offline   Kyanos 

#1939

View PostMark., on 18 February 2017 - 04:40 PM, said:

I assumed wrongly that my code would have no effect on firing timing because gs had nothing to do with that. Live and learn.

You aren't even using gs as the engine gun shade variable. You may as well replace it with a temp var. You are just storing the weapon flag value there then orvaring it. You should do the orvar once per weapon.

onevent EVENT_RESETWEAPONS 

setvarvar temp WEAPON1_FLAGS
orvar temp 256
setvarvar WEAPON1_FLAGS temp

setvarvar temp WEAPON2_FLAGS 
orvar temp 256
setvarvar WEAPON2_FLAGS temp

setvarvar temp WEAPON3_FLAGS
orvar temp 256
setvarvar WEAPON3_FLAGS temp

endevent


Posted from my phone sorry in advance for any errors.
1

User is offline   Kyanos 

#1940

View PostDavid B., on 18 February 2017 - 09:46 AM, said:

Hello everybody,

I suppose it's the right thread to post that question, so is there any way to control an animated 3d model with the 'use' key ?
What I mean is a 3d model which starts its animation forward or backward each time the player presses the "use" key when looking at it : for example an animated switch, a valve wheel or a door.

Does anyone think it's possible - and possibly knows the way one could do that ?


Yes. I have made working door models.
1 the models work best with clip shape maps for blocking IMO
2 ifhitspace is the con command you'll want to use
3 I made two states one was advance a tile num, the other subtracted one from the picnum
4 like in defs.con define two tiles as your model states aka open/closed
5 like in game.con write code for each state of the model to switch picnum to opposite state if it detects hitspace
6 add sounds via soundonce con code

Good luck feel free to ask more or for clarification.
1

User is offline   Mark 

#1941

Thanks Drek. It worked but you forgot the all important first line. gamevar temp 0 0. Luckily I knew just enough about cons to add that in. :P
1

User is offline   Kyanos 

#1942

View PostDavid B., on 18 February 2017 - 09:46 AM, said:

is there any way to control an animated 3d model with the 'use' key ?

View PostDrek, on 18 February 2017 - 05:00 PM, said:

Yes. I have made working door models.



I found the old project and copied out the code for reference.

Spoiler

2

User is offline   David B. 

#1943

View PostDrek, on 19 February 2017 - 12:46 PM, said:

I found the old project and copied out the code for reference.



That's great, thanks. In fact I have never made a script and I didn't know how to begin.

Well I'm not very skilled in coding.
I'm wondering how the door is animated when it's closing.
And also why there is a counter to 32.

This post has been edited by David B.: 21 February 2017 - 10:47 AM

0

Share this topic:


  • 124 Pages +
  • « First
  • 63
  • 64
  • 65
  • 66
  • 67
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options