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

Jump to content

  • 124 Pages +
  • « First
  • 43
  • 44
  • 45
  • 46
  • 47
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1314

EGS = Enter Game Spawn/State?
0

User is offline   zazo 

#1315

I wonder if there are some improvements on the water effects for eduke: water distortion, water reflection, waves... ? something more realistic
0

User is offline   Plagman 

  • Former VP of Media Operations

#1316

The current mirror code can combine with parallax mapping to do an OK water effect, but it's definitely not ideal; having a real water effect is something I'm planning to do at some point.

Posted Image
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1317

Won't that work only with ROR?
0

User is offline   Hendricks266 

  • Weaponized Autism

  #1318

Not necessarily, you would just need to set up a view portal with Polymer.
0

User is offline   zazo 

#1319

very great,
view portal ? miror code for floor ???
have some code or mapster keys for this ?? :lol: :lol:
0

User is offline   Hendricks266 

  • Weaponized Autism

  #1320

There is currently no way to give Polymer the information. Same with the screenshot of E1L1 windows reflecting.
0

User is offline   zazo 

#1321

View PostHendricks266, on 17 June 2013 - 05:53 PM, said:

Not necessarily, you would just need to set up a view portal with Polymer.

how set up a view portal in mapster?
0

User is offline   Hendricks266 

  • Weaponized Autism

  #1322

View PostHendricks266, on 18 June 2013 - 08:27 AM, said:

There is currently no way to give Polymer the information. Same with the screenshot of E1L1 windows reflecting.

0

User is offline   zazo 

#1323

the defineprojectile only shot projectiles horizontally ? ... Possible to set a positive angle to shoot projectiles as an arc ?
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1324

That would require you to use zshoot.
0

User is offline   Jblade 

#1325

Anyway to change the speed of a rotating sector with code? I've tried modifying the GPSPEED sprite but not even event_pregame lets me do anything to it (I set up a 'ifactor GPSPEED addlog' to test and nothing shows up)
0

User is offline   Helixhorned 

  • EDuke32 Developer

#1326

View PostJames, on 21 June 2013 - 04:32 AM, said:

Anyway to change the speed of a rotating sector with code? I've tried modifying the GPSPEED sprite but not even event_pregame lets me do anything to it (I set up a 'ifactor GPSPEED addlog' to test and nothing shows up)

It depends on whether you only want to set up a different static rotation speed, or if you want to modify it on the fly.
In the first case, you can change the GPSPEED's lotag in EVENT_LOADACTOR or an eventloadactor block.
After premap, where these are run from, all GPSPEED sprites are deleted and their former lotags are assigned to their containing sector's .extra member. Thus, for the dynamic speed control, you could change that one in intervals. The GPSPEED lotag -> sector extra backup is somewhat of an implementation detail, but it's unlikely to ever change.
Also note that for SE0/SE1 constructions, the GPSPEEDs are placed in the SE1 (actual rotating sector) instead of the matching SE0 (pivot). Thus, you must be prepared to change all speeds belonging to one pivot to the same value.
2

User is offline   Jblade 

#1327

That's just the information I was looking for, much appreciated! With that information, it should be possible to somewhat mimmic Blood's ability to have doors or elevators start off slow, speed up, and then slow down again just before stopping. I'll have to get my hands dirty and try it out.
0

#1328

How can i play musics, making they don't reset when loading a game ?

For example i start a boss fight and another track starts, using strattrack #... i save... when i load i get back to normal level music... how to avoid this ?
0

User is offline   Hendricks266 

  • Weaponized Autism

  #1329

I wrote some CON code for zykov eddy which will maintain the currently playing track, but with the downside that it will restart after every load, so I don't know how much use it will be to you. It's been on my to-do list for some time for EDuke32 to save the currently playing music in the savegame and restore it automatically, not restarting the track if it is the same. Currently it just checks the current level and episode number of the map.
0

User is offline   Mikko 

  • Honored Donor

#1330

View PostRichardStorm, on 29 June 2013 - 03:21 AM, said:

For example i start a boss fight and another track starts, using strattrack #... i save... when i load i get back to normal level music... how to avoid this ?


Well you should use starttrackvar instead of starttrack, and then set the currently playing track as a variable. Then to avoid the problem of reverting to the "normal level music" upon loading, you should put a check in EVENT_LOADGAME event.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #1331

Here is how I did it for Sonic 3D:

gamevar musicVolume -1 1
gamevar musicLevel -1 1

state reset_music
    setvar musicVolume -1
    setvar musicLevel -1
ends

state trigger_music
    ifvarg musicVolume -1
        setuserdef[THISACTOR].volume_number musicVolume 

    ifvarg musicLevel -1
        starttrackvar musicLevel

    // always reset to the proper value
    setuserdef[THISACTOR].volume_number VOLUME
ends

onevent EVENT_RESETPLAYER
    state reset_music
endevent

onevent EVENT_ENTERLEVEL
    state reset_music
endevent

onevent EVENT_LOADGAME
    state trigger_music
endevent


To change a track, you would set the variables and then call state trigger_music. I used per-player variables for Sonic 3D so that something like an invincibility jingle would only affect the player with it.
0

User is offline   Mark 

#1332

I created an actor ( a new model ). It's default action is the animation "idle". When it is shot by the player the model runs it's other animation ( from an action command ) one time and plays a sound. But when shot at a second time or more, only the sound plays and not the animation action command. So after more research I found a "resetactioncount" command and put that in the code to hopefully reset things back to default making it ready to fully run again with the next bullet hit. No luck.

I know I should be posting the code but I don't want to give away some info contained in it and spoil the suprise for future players. I'm basically asking if I'm on the wrong trail trying to use the "resetactioncount" instead of something else.

I also figured out how to have something spawn from the actor after the hit but I have a slight problem. The item spawns at the same location as the actor that spawned it. Because of mapping issues I need the spawned item to be at a slightly higher elevation to clear an obstacle. How would I go about doing that?
0

User is offline   Jblade 

#1333

For the first part, try 'strength 1' in the part where you set what happens after it gets shot.

For the second part, do you need it to just spawn higher up, or away from the model altogether? If it's the former, try:
getactor[THISACTOR].z TEMP
espawn WHATYOUWANTTOSPAWN
subvar TEMP 4096 // This will move it up a bit
setactor[RETURN].z TEMP


This post has been edited by James: 30 June 2013 - 11:01 AM

1

User is offline   Mark 

#1334

Thanks. I will try those out shortly.
0

User is offline   Mark 

#1335

No luck on either one. Second one gave me some error message about TEMP. I suppose I'm S.O.L. without posting the code. Thanks for trying.
0

User is offline   Mikko 

  • Honored Donor

#1336

You of course need to define the TEMP as a gamevar, i.e., gamevar TEMP 0 2 (or 0 0 if it's a global variable).
1

User is offline   Mark 

#1337

That will probably do the trick because the error messages were saying TEMP was not a gamevar.

EDIT: It moved the spawned sprite down instead of up. :)

This post has been edited by Mark.: 30 June 2013 - 11:56 AM

0

User is offline   Mark 

#1338

Maybe this wil help. I took out any identifying names or actions and left in just the relevant code for this discussion. Maybe something quite obvious will jump out at you experts.

action IDLEANIM 0 1 1 1 0
action ANIM2 1 14 1 1 0

useractor notenemy MYACTOR 0
gamevar TEMP 0 2
ifhitweapon
{
strength 0
action ANIM2
sound XXX
getactor[THISACTOR].z TEMP
espawn XXXX
subvar TEMP 4096 // This will move it up a bit
setactor[RETURN].z TEMP
}

enda

This post has been edited by Mark.: 30 June 2013 - 12:16 PM

0

User is offline   Jblade 

#1339

gamevar TEMP 0 2 // gamevars should be outside of actors

useractor notenemy MYACTOR
ifhitweapon 
{ 
strength 1
action ANIM2
sound XXX
getactor[THISACTOR].z TEMP 
espawn XXXX 
addvar TEMP 4096 // This will move it up a bit 
setactor[RETURN].z TEMP
}
enda

1

User is offline   Mark 

#1340

The animation still runs only the first time. I tried a different item to spawn and it was at correct height , with or without the extra code. It seems spawning the gun turret 2360 was the problem. So I will re-think what to spawn instead of that. Having the animation run only once I can live with. It was just "icing on the cake" to have it run every time. As long as the sound is played the effect will work ok. Thanks guys for the help. I never used gamevars before so its something new I learned today. Thats always good.

BTW, the new item I tested the spawn with was one of my new enemies. I happened to shoot the actor with the machine gun. A whole butt-load of enemies appeared. It was like an episode of Serious Sam. :)
0

User is offline   Mikko 

  • Honored Donor

#1341

The animation thing shouldn't be hard to do. Remember the trash bin that gets a dent when hit but reverts back to its idle animation shortly after? Use that as a starting point.
1

User is offline   Mark 

#1342

Thats why my first uneducated guess was to use the resetactioncount command hoping that it would reset the action for the next time. I'll take a peek at the trashcan code.

EDIT: That did it. Having the idle action run after the animation and then break command are what did it. WOO HOO. Thanks again.

Now for my next 24 questions...... :) Actually I think I'll take a short break from the "hard" stuff and take care of some easier sound and projectile replacements.

This post has been edited by Mark.: 30 June 2013 - 02:27 PM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1343

Is it possible to extend EVENT_DISPLAYROOMS to the Automap? I use it to change the sector or wall structures temporarily (similar to EVENT_ANIMATESPRITES), however I can't do that for the Automap.
0

Share this topic:


  • 124 Pages +
  • « First
  • 43
  • 44
  • 45
  • 46
  • 47
  • 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