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

Jump to content

  • 115 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   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

User is offline   m210® 

#1344

I need help with own rotate sectors.
I can't make move of player in such sectors

Here is a part of my rotator:
//Code for rotation sector
	ifvare active 1 { setactorvar[THISACTOR].active 0 setvar rot_moving 0 }			
	getactor[THISACTOR].ang ang
	ifvare rot_turnway 0 
	{ addvarvar ang rot_angspeed ifvarg ang 2047 setvar ang 0 } else 
	ifvare rot_turnway 1 { subvarvar ang rot_angspeed ifvarl ang 0 setvar ang 2048 }
	subvarvar rot_saveang rot_angspeed
	setactor[THISACTOR].ang ang //set rotation angle of own sectoreffector sprite. With rotate of this sprite, sector will be rotating too.
	
	
//Here I trying move a player with the sector together
	getplayer[THISACTOR].i PLAYERID
	setvarvar spriteid PLAYERID
	getactor[spriteid].sectnum se_sector
	getactor[THISACTOR].sectnum se_sect1
	ifvarvare se_sector se_sect1                 //if player in a sector
	{
		getplayer[THISACTOR].posx x2
		getplayer[THISACTOR].posx y2
		subvarvar x2 sprite[THISACTOR].x
		subvarvar y2 sprite[THISACTOR].y
		mulvarvar x2 x2
		mulvarvar y2 y2
		addvarvar x2 y2
		sqrt x2 se_dist //calculating a distance between player and point of rotate sector
			
		setvarvar x2 sprite[THISACTOR].x
		addvarvar x2 se_dist
		rotatepoint sprite[THISACTOR].x sprite[THISACTOR].y x2 sprite[THISACTOR].y ang x y
		setplayer[THISACTOR].posx x
		setplayer[THISACTOR].posy y //set coodinates of player after rotation

	}




And of cource, with this code the player can't moving and after some tics player get away from sector.

This post has been edited by M210: 06 July 2013 - 12:19 AM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1345

Shouldn't you make the floor align relative?
0

User is offline   m210® 

#1346

Quote

Shouldn't you make the floor align relative?


it makes no difference in my code

This post has been edited by M210: 06 July 2013 - 02:28 AM

0

User is offline   m210® 

#1347

So, I just want to rotate a player around point with preservation of movement. Have anybody similar code?
rotatepoint doesn't works correctly with calculating distance from player to point at each tic
0

User is offline   darkcaleb 

#1348

Hey, I was wondering if this was possible. Is it possible for changing the loading screen with a animated screens of 5 frames. Does it need to be code or?
0

User is offline   Jblade 

#1349

View Postdarkcaleb, on 06 July 2013 - 02:35 PM, said:

Hey, I was wondering if this was possible. Is it possible for changing the loading screen with a animated screens of 5 frames. Does it need to be code or?

I'm sure animated tiles do work during loading, try it by checking out this tutorial on the Eduke32 wiki.
0

User is offline   darkcaleb 

#1350

hey James, i tried the code.What i did is I created a new con-code named dkgame.con and I put this text in it

oneventonevent EVENT_GETLOADTILE
setvar RETURN <3281>
endevent

Put a include dkgame.con in game.con and i get a error. If you create new con-code´s do you need to put any text in the file or? And how does the animation precisely work

This is the error I get:

Including: dkgame.CON (62 bytes)
dkgame.CON: In event `EVENT_GETLOADTILE':
dkgame.CON:2: error: parameter `' is undefined.
dkgame.CON:2: error: expected a keyword but found `'.
GAME.CON:34: error: parameter `ANULLACTION' is undefined.
GAME.CON:34: error: expected a keyword but found `0'.
Found 0 warning(s), 4 error(s).

I haven't done any con-coding in the past and I do want to know how the things work. Hopefully I can start with simple con-coding :)
0

Share this topic:


  • 115 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