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

Jump to content

Hide message Show message
Welcome to the Duke4.net Forums!

Register an account now to get access to all board features. After you've registered and logged in, you'll be able to create topics, post replies, send and receive private messages, disable the viewing of ads and more!

  • 85 Pages +
  • « First
  • 82
  • 83
  • 84
  • 85
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   thisbecasper 

  • 1

#2491

Turns out, it was actually because I was calculating the maxscore variable in EVENT_DISPLAYREST. I think I've read somewhere displayrest is only for HUD :o)
0

User is online   Trooper Dan 

  • Duke Plus Developer
  • 3,677

#2492

View Postthisbecasper, on 13 January 2019 - 02:18 AM, said:

Turns out, it was actually because I was calculating the maxscore variable in EVENT_DISPLAYREST. I think I've read somewhere displayrest is only for HUD :o)


Yeah, display events are frame rate dependent and nothing that needs to be synced should ever be handled in them.
1

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!
  • 4,987

#2493

totalclock is a variable that is incremented based on 120 fps. Animations (tiles, shading, etc) are usually based on totalclock.

However Duke 3D carelessly handle a few animations based on frame rate updates, such as a shrunk players fists.

This post has been edited by Fox: 13 January 2019 - 05:37 PM

0

User is offline   thisbecasper 

  • 1

#2494

Can it be that it is difficult to know what kind of projectile hit you with its radius explosion? I'm just trying to make a flash bang, but I can't figure out how to check what picnum made the explosion...
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!
  • 4,987

#2495

If PROJ_WORKSLIKE equals PROJECTILE_RADIUS_PICNUM, then ifwasweapon will return the picnum.
1

User is offline   thisbecasper 

  • 1

#2496

I'm still looking for a way to can change the default song on user-maps. Anybody? :D
0

User is offline   Mark 

  • Honored Donor
  • 2,839

#2497

View Postthisbecasper, on 12 January 2019 - 03:23 PM, said:

Yup, thanks, that made it possible to play another song at Holly. Although this doesn't work
music 1 stalker.mid GRABBAG.mid streets.mid watrwld1.mid snake1.mid
        thecall.mid ahgeez.mid GRABBAG.mid streets.mid watrwld1.mid snake1.mid

even though this worked
music 1 GRABBAG.mid dethtoll.mid streets.mid watrwld1.mid snake1.mid
        thecall.mid ahgeez.mid dethtoll.mid streets.mid watrwld1.mid snake1.mid

and that has always been my problem. I can't play other music than dethtoll on usermaps...


I took a look at what I did for my Graveyard mod.

// Music for title and end
music 0 GAMEOVER.mid BRIEFING.MID

// Music for the individual levels
music 1 graveyardnew.ogg map2.ogg map2.ogg bonus.mid

I was able to choose whatever I wanted. I have no idea why you can't. As a test, try an older eduke32 version from a few months or a year ago.
0

User is offline   thisbecasper 

  • 1

#2498

View PostMark, on 17 January 2019 - 06:21 AM, said:

I took a look at what I did for my Graveyard mod.

// Music for title and end
music 0 GAMEOVER.mid BRIEFING.MID

// Music for the individual levels
music 1 graveyardnew.ogg map2.ogg map2.ogg bonus.mid


Maybe I have to say that I'm not playing a custom episode, but rather on usermaps (so I guess thats E1L8?)

View PostMark, on 17 January 2019 - 06:21 AM, said:

As a test, try an older eduke32 version from a few months or a year ago.


Good point. I'm using the eduke-oldmp build, but I tried the "normal" eduke and it's the same. The songs change when I replace the filenames with others, like you showed. It still plays dethtoll on usermaps though...

This post has been edited by thisbecasper: 17 January 2019 - 07:14 AM

0

#2499

Is it possible to reduce the speed of the fall of the actor?
actor 3747
	ifvarvarg sprite[THISACTOR].z 0 {
		setactor[THISACTOR].htbposx sprite[THISACTOR].z
		setactor[THISACTOR].z -100000
	} else
		fall
	cstator 8192 
enda


This post has been edited by Mr. Alias Nameless: 30 January 2019 - 01:26 AM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!
  • 4,987

#2500

The easiest way is to add ifrnd % before.

This post has been edited by Fox: 30 January 2019 - 02:06 AM

0

User is online   Trooper Dan 

  • Duke Plus Developer
  • 3,677

#2501

If you want it to be exactly half speed and not random, you can use ifvarand player[].player_par 1 fall
0

User is offline   Mark 

  • Honored Donor
  • 2,839

#2502

Darn. I wish I knew that fall speed was adjustable. I have an enemy that falls off a ladder but the fall was too fast. I ended up using a combo of move and iffloordistl commands. This new way would have been much quicker.
0

User is online   Trooper Dan 

  • Duke Plus Developer
  • 3,677

#2503

View PostMark, on 30 January 2019 - 06:07 AM, said:

Darn. I wish I knew that fall speed was adjustable. I have an enemy that falls off a ladder but the fall was too fast. I ended up using a combo of move and iffloordistl commands. This new way would have been much quicker.


It's not really "adjustable". What both Fox and I are saying is you can simply not have the command be executed every single game tic.
0

User is offline   Firefly_Trooper 

  • 41

#2504

A question. Is it useful to post one of my problems here? In addition to my thread?
0

User is offline   Firefly_Trooper 

  • 41

#2505

View PostFirefly_Trooper, on 30 January 2019 - 11:41 AM, said:

A question. Is it useful to post one of my problems here? In addition to my thread?


Finally it will not be worth it, because I have a new unexpected problem that pisses me off :angry: My King Cobra REFUSES to die being once shrunk.

The code is posted on my thread.

This post has been edited by Firefly_Trooper: 31 January 2019 - 06:22 AM

0

User is offline   Mark 

  • Honored Donor
  • 2,839

#2506

In another thread Trooper Dan posted:
" onevent EVENT_FIRE set RETURN -1 break

That will prevent weapon firing but quick kick is a separate function."

How would I use that so its active only while the player is in a "lockplayer" mode during a conversation with an enemy?
If it helps any, there are quotes on the top of the screen and sound clips playing during this time.

This post has been edited by Mark: 31 January 2019 - 08:30 PM

0

User is online   Trooper Dan 

  • Duke Plus Developer
  • 3,677

#2507

View PostMark, on 31 January 2019 - 08:23 PM, said:

How would I use that so its active only while the player is in a "lockplayer" mode during a conversation with an enemy?
If it helps any, there are quotes on the top of the screen and sound clips playing during this time.


For that context it would be better to use setp[].weapon_pos -9

That will force the weapon down to the bottom of the screen like you were switching weapons and not allow the player to fire. As soon as you stop setting it to -9, it will smoothly come back up.

Now let's say that quotes 150 to 155 are used for the conversation (just picking numbers at random), and are not used for other purposes. Then the following code would work in the APLAYER actor:

ifg player[].fta 0 ifge player[].ftq 150 ifle player[].ftq 155 setp[].weapon_pos -9

But it would be better to do it in the same block of code that is locking the player.
1

User is offline   Mark 

  • Honored Donor
  • 2,839

#2508

I know next to nothing about using member structs so instead of just copy/pasting your code I looked up the parts of it to understand it.
I see a potential problem. Hopefully I'm wrong. Right now the quotes in the conversation are part of the enemy actor's code and are different lengths and synced with the sound clips using ifcount for timing. The fta according to the wiki is a countdown timer for how long to display a quote. Am I going to break my existing timings by using fta?

This post has been edited by Mark: 01 February 2019 - 05:51 AM

0

User is offline   Mark 

  • Honored Donor
  • 2,839

#2509

It worked fine in the APLAYER code even though the lockplayer comes from the enemy code. The gun popped up for a second in the middle. Probably just some ifcount timing I have to tighten up a bit.
I need this for at least 3-4 other places. I'm assuming I can reuse this line multiple times with the proper quote numbers.
Thanks again Buddy.

This post has been edited by Mark: 01 February 2019 - 12:12 PM

0

User is offline   Firefly_Trooper 

  • 41

#2510

And thank you for the function EVENT_FIRE.
0

User is offline   Firefly_Trooper 

  • 41

#2511

If I understood correctly, EVENT_FIRE can be used to prevent a monster from shooting in a vacuum?
0

User is online   Trooper Dan 

  • Duke Plus Developer
  • 3,677

#2512

View PostMark, on 01 February 2019 - 08:43 AM, said:

It worked fine in the APLAYER code even though the lockplayer comes from the enemy code. The gun popped up for a second in the middle. Probably just some ifcount timing I have to tighten up a bit.
I need this for at least 3-4 other places. I'm assuming I can reuse this line multiple times with the proper quote numbers.
Thanks again Buddy.


My advice is to try to organize the code better before it gets out of hand. Write a state that can be used by different enemies, which has all of the necessary code in it (none of it needs to be in the player actor). For things that change from one enemy to another, you can set one or more vars before the state is called.
1

User is offline   Mark 

  • Honored Donor
  • 2,839

#2513

I fully agree but too late. I considered it out of hand before I started. Lack of continuity has been a hurdle for me. IIRC I am the 3rd coder to get his hands dirty in this project plus some of the previous code was gathered from even earlier code from the early 2000's. Coding styles for different actors varies. There is so much organized and disorganized stuff spread around I surprised myself for getting as far as I have. Also I did not have much pre-planning at all and as I think of new fun features I add them in ( feature creep ). There is also so much undocumented or unused code blocks that I find as I cruise thru the code and then decide on a whim to try and use them. I'm going at this in a very haphazard way.

This post has been edited by Mark: 01 February 2019 - 03:50 PM

0

User is online   Trooper Dan 

  • Duke Plus Developer
  • 3,677

#2514

I'm not saying that you need to go through the entire codebase line by line and organize it, but if there are effects that you are changing yourself, then it seems reasonable to tidy them up since it will save you grief later on.
0

User is offline   Mark 

  • Honored Donor
  • 2,839

#2515

Some actors are clean with most all code in states and almost nothing loose. Then there are others with no states, all loose code. Gamevars spread all around. It felt like so much work already just doing what I have let alone attempting to figure out someone else's code and format it similar to mine without creating another load of errors.

But...somehow "I get by with a little help from my friends". ( a Beatles song for you youngsters )

This post has been edited by Mark: 01 February 2019 - 04:48 PM

0

User is offline   Firefly_Trooper 

  • 41

#2516

As I managed to correct the problems of my monsters, I have another question to ask. What is the name that unlocks an actor? When an actor is active, he remains stuck on the spot and I would like him to move normally.

Is it good the value "moveflags seekplayer"?

Thanks

This post has been edited by Firefly_Trooper: 02 February 2019 - 05:46 AM

0

User is offline   Mark 

  • Honored Donor
  • 2,839

#2517

I've seen the spriteshadow con command for a long time but never tried using it until this morning. I used it on a 3d model but the shadow doesn't show up. Could it be because that tile number uses dummytile which places an empty black box instead of a regular texture? Or is there something else I'm forgetting.

Oops, forgot to mention that model is a useractor. ;)

This post has been edited by Mark: 06 February 2019 - 09:29 AM

0

User is online   Trooper Dan 

  • Duke Plus Developer
  • 3,677

#2518

Shadows don't work in Polymer. In Polymost, they sort of work on models, but not well. If you look carefully you can see a squiggly grey shape under the model. With work you can make your own shadow using tricks and EVENT_ANIMATESPRITES but it's not fun.
1

User is offline   Mark 

  • Honored Donor
  • 2,839

#2519

No showview, single skybox and now no shadows. What's next? ;)

This post has been edited by Mark: 06 February 2019 - 11:02 AM

0

User is offline   Mark 

  • Honored Donor
  • 2,839

#2520

Another odd problem. I cut and pasted the properly working code for a dog from my GraveyardTC project into my new project.

When run I get the error... SUBURBS.CON: In actor `DOG':
SUBURBS.CON:11559: error: `enda' not at top level within script.

I have enda at the end of this actor code just like every other actor I've ever done. Any hints what I should look for?
0

Share this topic:


  • 85 Pages +
  • « First
  • 82
  • 83
  • 84
  • 85
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks are property of their respective owners. Instead of reading this text, you could be playing Ion Maiden! ;) © 2018 Voidpoint, LLC

Enter your sign in name and password


Sign in options