EDuke32 Scripting "CON coding help"
#1341 Posted 30 June 2013 - 01:47 PM
#1342 Posted 30 June 2013 - 02:10 PM
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......
This post has been edited by Mark.: 30 June 2013 - 02:27 PM
#1343 Posted 01 July 2013 - 11:01 AM
#1344 Posted 06 July 2013 - 12:18 AM
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
#1346 Posted 06 July 2013 - 02:27 AM
Quote
it makes no difference in my code
This post has been edited by M210: 06 July 2013 - 02:28 AM
#1347 Posted 06 July 2013 - 09:01 AM
rotatepoint doesn't works correctly with calculating distance from player to point at each tic
#1348 Posted 06 July 2013 - 02:35 PM
#1349 Posted 06 July 2013 - 11:04 PM
darkcaleb, on 06 July 2013 - 02:35 PM, said:
I'm sure animated tiles do work during loading, try it by checking out this tutorial on the Eduke32 wiki.
#1350 Posted 07 July 2013 - 04:31 AM
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
#1352 Posted 07 July 2013 - 05:36 AM
Fox, on 07 July 2013 - 05:13 AM, said:
Sorry this is what is in the dkgame.con file:
onevent EVENT_GETLOADTILE
setvar RETURN <3281>
endevent
#1353 Posted 07 July 2013 - 06:23 AM
This post has been edited by Fox: 07 July 2013 - 06:23 AM
#1354 Posted 07 July 2013 - 07:15 AM
#1355 Posted 07 July 2013 - 08:49 AM
onevent EVENT_GETLOADTILE setvarvar RETURN totalclock divvar RETURN 16 // animation speed andvar RETURN 3 addvar RETURN LOADSCREEN endevent
#1356 Posted 07 July 2013 - 01:17 PM
onevent EVENT_GETLOADTILE (don't know this purpose)
setvarvar RETURN totalclock (don't know this purpose)
divvar RETURN 16 // animation speed (this is the speed)
andvar RETURN 3 (don't know this purpose)
addvar RETURN LOADSCREEN (this is the tile 3281 as I'm right?)
endevent (This is the end of the event)
Thanks again.
#1357 Posted 07 July 2013 - 02:17 PM
endevent
This is used to call an event, which allows you to use some code at a specific occasion. For example, the EVENT_GETLOADTILE occur during the loading screen.
totalclock
It is a variable which value is constantly increased. It serves for the purpose of providing a timing for the animations.
andvar 3
Cycles the current value (totalclock divided by speed) through 0-3 (four frames).
LOADSCREEN
Same as 3281, as defined in DEFS.CON.
This post has been edited by Fox: 07 July 2013 - 02:18 PM
#1359 Posted 08 July 2013 - 04:40 AM
Quote
I can't make move of player in such sectors
Well, I did it
getplayer[THISACTOR].i PLAYERID
setvarvar spriteid PLAYERID
getactor[THISACTOR].sectnum rot_sect
getactor[spriteid].sectnum se_sector
ifvarvare rot_sect se_sector
{
getactor[THISACTOR].x x
getactor[THISACTOR].y y
getactor[spriteid].x x2
getactor[spriteid].y y2
subvarvar x2 x
setvarvar dx x2
setvarvar rot_actspeed rot_angspeed
ifvare rot_turnway 1 mulvarvar rot_actspeed -1
cos mycos rot_actspeed
mulvarvar dx mycos
divvarvar dx TRIG_MAX
subvarvar y2 y
setvarvar dy y2
sin mysin rot_actspeed
mulvarvar dy mysin
divvarvar dy TRIG_MAX
addvarvar x dx
subvarvar x dy
//setactor[spriteid].x x
setplayer[THISACTOR].posx x
setvarvar dy y2
mulvarvar dy mycos
divvarvar dy TRIG_MAX
setvarvar dx x2
mulvarvar dx mysin
divvarvar dx TRIG_MAX
addvarvar y dy
addvarvar y dx
//setactor[spriteid].y y
setplayer[THISACTOR].posy y
//getactor[spriteid].ang se_ang
getplayer[THISACTOR].ang se_ang
addvarvar se_ang rot_actspeed
setplayer[THISACTOR].ang se_ang
//setactor[spriteid].ang se_ang
}
#1360 Posted 08 July 2013 - 10:44 AM
chaingun: none
rpg: none
mighty boot: 0
freezer firing top half: 0
pistol: 1
shotgun: 2
shotgun firing: 4
pipebomb: 5
shrinker: 6
right devastator: 7
left tripbomb hand: 8
freezer: 9
pipebomb detonator: 10
expander: 11
shrinker crystal: 12
left devastator: 14
right tripbomb hand: 16
expander crystal: 22
tripbomb: 32
quick kick: 100
right shrunk fist: 101
left shrunk fist: 102
#1361 Posted 10 July 2013 - 06:07 PM
Quote
This command will allow you to select a different slot so that any HUD models you are drawing can store their animation state independently, without conflict. By default it uses the first slot, 0. If you need several animating HUD models, you should switch to another slot, draw the model with rotatesprite, then switch back using guniqhudid 0.
guniqhudid is short for "g (game? gun?) unique HUD ID".
In weapons.con (written by Hendricks) it just looks like he assigned all of the hud models a unique id (which is not necessarily necessary unless the models are going to display simultaneously or you need the animation state preserved but it's fine). No big deal.
#1362 Posted 10 July 2013 - 06:49 PM
I copied the guniqhudid values in weapons.con.sample verbatim from what is used in player.c.
#1364 Posted 13 July 2013 - 05:32 AM
#1365 Posted 13 July 2013 - 07:24 AM
Hendricks266, on 10 July 2013 - 06:49 PM, said:
I copied the guniqhudid values in weapons.con.sample verbatim from what is used in player.c.
The values appear to be almost random. Every piece should be separated in a different layer defined by MAXWEAPONS times the layer.
#1366 Posted 13 July 2013 - 05:31 PM
Its real basic stuff right now and will be expanded upon as I learn more coding. But I need help with a problem that I've spent the last 2 hours on and can't figure out the fix. When the dog charges the player and gets within a certain distance it goes into the DOGBITE mode. The problem is that it only performs the actions ( action, sound, player health) once instead of multiple times. When the player backs away and the dog approaches again its the same thing. Just one bite and then nothing. I'm guessing I need to nest some lines in a better place but I tried and tried and couldn't figure it out.
This post has been edited by Mblackwell: 13 July 2013 - 07:57 PM
Reason for edit: Added code tags to preserve formatting.
#1367 Posted 13 July 2013 - 07:54 PM
Generally I recommend avoiding AI commands and just using simple actions/actioncount/move commands. Then again I also tend to define everything as notenemy and then manually adding in spriteshadow and kill counts but I'm an oddball I guess.
#1368 Posted 14 July 2013 - 02:01 AM
BTW, I still have had zero success in coding any climbing abilities for new enemies.
This post has been edited by Mark.: 14 July 2013 - 04:44 AM
#1369 Posted 14 July 2013 - 10:07 AM
You seems to be confused with the use of {} and break.
This post has been edited by Fox: 14 July 2013 - 10:07 AM
#1370 Posted 14 July 2013 - 11:45 AM
This post has been edited by Mark.: 14 July 2013 - 11:47 AM

Help
Duke4.net
DNF #1
Duke 3D #1


