EDuke32 Scripting "CON coding help"
#841 Posted 12 June 2012 - 05:03 PM
#842 Posted 13 June 2012 - 07:37 AM
Anyway I second my questions: Is it possible to change actor's attributes when I push the dipswitch with the same lotag?
Also is it possible to make make an RPG subweapon (like shrinker/expander) or do I have to make a separate weapon?
TerminX, as you are the author, does your newest build support the real sector over sector like in Redneck?
#843 Posted 13 June 2012 - 07:51 AM
#844 Posted 15 June 2012 - 02:34 AM
#845 Posted 17 June 2012 - 11:31 PM
#846 Posted 18 June 2012 - 01:21 AM
#847 Posted 19 June 2012 - 07:47 AM
#848 Posted 19 June 2012 - 12:28 PM
This post has been edited by LAW: 19 June 2012 - 12:33 PM
#849 Posted 26 June 2012 - 02:33 PM
This post has been edited by LAW: 28 June 2012 - 01:58 PM
#850 Posted 07 July 2012 - 02:42 PM
I'm new to the community and want to learn to script with EDuke. In the past I played around with Mapster, but I want to learn to use the possibilities of EDuke to make new gameplay stuff. So I'm asking if there are any tutorials to learn the basic stuff of EDuke scripting.
I hope you can give me some advices and point me to the right direction.
#852 Posted 07 July 2012 - 11:44 PM
Hendricks266, on 07 July 2012 - 04:03 PM, said:
Thank you Hendricks,
I will look trough this. I have some experience with editing the user.con, but beside this I never did anything more complex with the game.con back in the days. I will try out some of the tutorials on the wiki and look how far I will come with it.
#853 Posted 08 July 2012 - 09:43 PM
Is there a way to by-pass the episode select screen, and make the game load up as if it were always going into Episode 4? (Starting with the intro and such) ? Because i'm working on a mod, and for the sake of presentation I don't want a slightly fudged over Episode Select Screen.
So it would go Main Menu --> New Game --> Difficulty --> E4 Cinematic --> "Whatever map is assigned to definelevelname 3 0"
Well, I got the game to load to the first level of the fourth episode no matter what episode you choose. That's a start. Only, it doesn't play the fourth episode intro, and you still have to go through episode select.
Anybody have any ideas? Here's my very simple code so far.
onevent EVENT_NEWGAME { startlevel 3 0 } endevent
I noticed there's the read-only(which I assume means it's useless) variable "VOLUME" which keeps track of the current episode. Is there anyway to set the volume?
This post has been edited by Commando Nukem: 10 July 2012 - 05:42 PM
#854 Posted 16 July 2012 - 03:21 AM
Im new here and im making my own mod for eduke...
But i found out i need little help with .CON scripting...
I was studying plenty of materials but still I cant make two things:
1.
I have bridge (couple of sprites) - I need move this bridge down on the ground.
So i tried movesprite and changed zvel to 3, so it was looking like this:
movesprite 176 0 0 3 CLIPMASK0 RETURN
this works exactly i need, but there is problem - anything "standing" on that moving sprite will be very jiggle/unstable, simply it doesnt go along with that sprite - except the player.
How to fix it? I tried get coordinates of object and raise the .z position, but still it doesnt work.
2.
I need make a simple camera, i dont need moving camera just show some part of map. What is best solution for this?
Should i use showview or showviewunbiased? Because i tried find camera function in original game.con and modify that, but it wasnt there...
I'd appreciate any help, thanks.
#855 Posted 16 July 2012 - 08:58 AM
Biturbo, on 16 July 2012 - 03:21 AM, said:
I need make a simple camera, i dont need moving camera just show some part of map. What is best solution for this?
Should i use showview or showviewunbiased? Because i tried find camera function in original game.con and modify that, but it wasnt there...
If the viewport is supposed to cover the whole screen, you should use the unbiased version: the correct screen coordinates would then be 0 0 319 199.
#856 Posted 17 July 2012 - 03:02 AM
Helixhorned, on 16 July 2012 - 08:58 AM, said:
Thanks so much, its working...
Maybe last thing about this camera, should i disable somehow controls of player?
In my case it should work like little animation, for example, you do something like unlock door and showview show you that, which door were opened.
So should i disable controls like turn/left/up/down ?
And then, how can i revert it back? Back to the point from which player activated showview animation.
//Is showunbiased supported yet? because ive downloaded HRP polymer 5.1 & latest DukePlus, and it saying:
DukePlus/dpcons/DUKEPLUS.CON:20511: error: expected a keyword but found `showviewunbiased'.
but in old version is everything ok.
This post has been edited by Biturbo: 17 July 2012 - 07:12 AM
#857 Posted 20 July 2012 - 06:18 AM
#858 Posted 23 July 2012 - 03:36 AM
#859 Posted 23 July 2012 - 07:31 AM
Micky C, on 23 July 2012 - 03:36 AM, said:
I suppose it would if writing code is a completely foreign concept to you. But otherwise, if you want to learn CON it would be far more efficient to do it directly. By the way it's funny to think of a real programming language as a "stepping stone" to writing CON code, since the real languages are far more useful.
#860 Posted 23 July 2012 - 09:35 AM
#861 Posted 24 July 2012 - 11:51 AM
Where is the most appropriate place to handle .htextra modifications? In-actor or in a specific event?
Is using get/setactorvar[THISACTOR].somevar a really bad idea over get/setvar somevar, or are they functionally identical? I seem to remember someone saying that the former was slower but it's been a few years.
#862 Posted 24 July 2012 - 01:01 PM
2. {get,set}{actor,player}var[THISACTOR].somevar is functionally redundant with {get,set}var. The importance is when you have to access another actor or player's unique variable instance.
#863 Posted 26 July 2012 - 11:10 AM
#864 Posted 26 July 2012 - 11:10 AM
onevent EVENT_GAME { getactor[THISACTOR].extra hptemp ifvarg hptemp 0 { getactor[THISACTOR].htextra enemytemp ifvarn enemytemp -1 { getactor[THISACTOR].htowner playertemp getplayer[THISACTOR].i playertemp2 ifvarvare playertemp playertemp2 {
Am I doing something totally wrong here?
#865 Posted 26 July 2012 - 12:06 PM
What I do is create a state and make the actors call it from their actor code, before their call to ifhitweapon.
#866 Posted 26 July 2012 - 12:09 PM
#867 Posted 26 July 2012 - 12:19 PM
Reaper_Man, on 26 July 2012 - 12:09 PM, said:
Maybe this would work?
gamevar lastextra 32767 2 onevent EVENT_GAME ifvare sprite[THISACTOR].statnum 1 ifvarvarl sprite[THISACTOR].extra lastextra ifvarvare sprite[THISACTOR].htowner player[THISACTOR].i { // do your stuff here } getactor[THISACTOR].extra lastextra endevent
#868 Posted 26 July 2012 - 01:36 PM
If I am not wrong, the problem is that ifhitweapon command seems to do more than checking for damage, but also re-calculates it when used, so you can't use htextra after it.
====//====//====
How can I find out if music option in menu is on or off?
This post has been edited by Fox: 26 July 2012 - 01:37 PM
#869 Posted 26 July 2012 - 02:19 PM
I also didn't realize that something like ifvarvare sprite[THISACTOR].htowner player[THISACTOR].i would work, that's useful to know.
This post has been edited by Reaper_Man: 26 July 2012 - 02:23 PM