Titlepic Intro project
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
- LastManonEarth
- Posts: 44
- Joined: Mon Apr 25, 2016 4:25 pm
Titlepic Intro project
Hi everyone.
working on a project to add a fancy and neat titlepic to my doom game. Basically I intend this to do what you will see in the code below + what I would like but I cannot code, therefore this post. What I have running now are several pics running in the back ground, a random level music after the d2ttl theme. This will run in a loop keeping the same music randomly selected as a never ending background.
What I intend now, is after the first loop of the while where it shows the DGUYFACE pic I would like to spawn a random enemy, weapon or item, before jumping again on CREDITD2 pic. The enemy weapon or item will show a brief description of the main characteristics, not sure if this will be shown as a cluster like the end of the game, where you see the letter appearing progressively, or if I should the same background with a predetermined description and have the script to pick the correct file according with the enemy or weapon shown at the moment. In any case, how to continue the below coding, any assistance will be greately appreciated.
#include "zcommon.acs"
script "Titlescript" OPEN
{
Delay(1);
//doom 1 titlemusic since it fits the TITLEPIC
SetMusic("D_DM2TTL");
Delay(570);
Light_Fade(2, 100, 50);
Delay(50);
//doom 1 demo tracks
switch(random(1,6))
{
case 1:
SetMusic("D_AMPIE");
break;
case 2:
SetMusic("D_MESSAG");
break;
case 3:
SetMusic("D_OPENIN");
break;
case 4:
SetMusic("D_DEAD");
break;
case 5:
SetMusic("D_SHAWN");
break;
case 6:
SetMusic("D_IN_CIT");
break;
}
//loop through credits & all titlepics
ReplaceTextures("TITLEPIC","CREDITD2");
Light_Fade(2, 255, 50);
Delay(500);
Light_Fade(2, 100, 50);
delay(50);
while(1)
{
ReplaceTextures("CREDITD2","CREDITPB");
Light_Fade(2, 255, 50);
Delay(500);
Light_Fade(2, 100, 50);
delay(50);
ReplaceTextures("CREDITPB","DGUYFACE");
Light_Fade(2, 255, 50);
Delay(2000);
Light_Fade(2, 100, 50);
delay(50);
ReplaceTextures("DGUYFACE","survg");
Light_Fade(2, 255, 50);
Delay(900);
Light_Fade(2, 100, 50);
delay(50);
ReplaceTextures("survg","DGUYFACE");
Light_Fade(2, 255, 50);
Delay(2000);
Light_Fade(2, 100, 50);
delay(50);
ReplaceTextures("DGUYFACE","Sthanks");
Light_Fade(2, 255, 50);
Delay(500);
Light_Fade(2, 100, 50);
delay(50);
ReplaceTextures("Sthanks","DGUYFACE");
Light_Fade(2, 255, 50);
Delay(2000);
Light_Fade(2, 100, 50);
delay(50);
ReplaceTextures("DGUYFACE","CREDITD2");
Light_Fade(2, 255, 50);
Delay(500);
Light_Fade(2, 100, 50);
delay(50);
}
}
working on a project to add a fancy and neat titlepic to my doom game. Basically I intend this to do what you will see in the code below + what I would like but I cannot code, therefore this post. What I have running now are several pics running in the back ground, a random level music after the d2ttl theme. This will run in a loop keeping the same music randomly selected as a never ending background.
What I intend now, is after the first loop of the while where it shows the DGUYFACE pic I would like to spawn a random enemy, weapon or item, before jumping again on CREDITD2 pic. The enemy weapon or item will show a brief description of the main characteristics, not sure if this will be shown as a cluster like the end of the game, where you see the letter appearing progressively, or if I should the same background with a predetermined description and have the script to pick the correct file according with the enemy or weapon shown at the moment. In any case, how to continue the below coding, any assistance will be greately appreciated.
#include "zcommon.acs"
script "Titlescript" OPEN
{
Delay(1);
//doom 1 titlemusic since it fits the TITLEPIC
SetMusic("D_DM2TTL");
Delay(570);
Light_Fade(2, 100, 50);
Delay(50);
//doom 1 demo tracks
switch(random(1,6))
{
case 1:
SetMusic("D_AMPIE");
break;
case 2:
SetMusic("D_MESSAG");
break;
case 3:
SetMusic("D_OPENIN");
break;
case 4:
SetMusic("D_DEAD");
break;
case 5:
SetMusic("D_SHAWN");
break;
case 6:
SetMusic("D_IN_CIT");
break;
}
//loop through credits & all titlepics
ReplaceTextures("TITLEPIC","CREDITD2");
Light_Fade(2, 255, 50);
Delay(500);
Light_Fade(2, 100, 50);
delay(50);
while(1)
{
ReplaceTextures("CREDITD2","CREDITPB");
Light_Fade(2, 255, 50);
Delay(500);
Light_Fade(2, 100, 50);
delay(50);
ReplaceTextures("CREDITPB","DGUYFACE");
Light_Fade(2, 255, 50);
Delay(2000);
Light_Fade(2, 100, 50);
delay(50);
ReplaceTextures("DGUYFACE","survg");
Light_Fade(2, 255, 50);
Delay(900);
Light_Fade(2, 100, 50);
delay(50);
ReplaceTextures("survg","DGUYFACE");
Light_Fade(2, 255, 50);
Delay(2000);
Light_Fade(2, 100, 50);
delay(50);
ReplaceTextures("DGUYFACE","Sthanks");
Light_Fade(2, 255, 50);
Delay(500);
Light_Fade(2, 100, 50);
delay(50);
ReplaceTextures("Sthanks","DGUYFACE");
Light_Fade(2, 255, 50);
Delay(2000);
Light_Fade(2, 100, 50);
delay(50);
ReplaceTextures("DGUYFACE","CREDITD2");
Light_Fade(2, 255, 50);
Delay(500);
Light_Fade(2, 100, 50);
delay(50);
}
}
- wildweasel
- Posts: 21706
- Joined: Tue Jul 15, 2003 7:33 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): A lot of them
- Graphics Processor: Not Listed
- Contact:
Re: Titlepic Intro project
Since this is more of a help thread than a Project, I've moved it to Scripting so you can get the help you're after.
- LastManonEarth
- Posts: 44
- Joined: Mon Apr 25, 2016 4:25 pm
Re: Titlepic Intro project
I apologize. Thanks.
- LastManonEarth
- Posts: 44
- Joined: Mon Apr 25, 2016 4:25 pm
Re: Titlepic Intro project
I was able to set some pictures randomly showing, music randomly played, and was able to spawn a spinning voxel into the desired place of the titlemap.wad. Not bad for my first script.
Now I need assistance with the below. Once the picture of the random weapon appears, it will spawn the respective voxel. The voxel spawned has it`s own actor to differentiate from the normal sprites in the game for those wanting 2d yet when playing. Problem is that when that background picture showing the weapon profile fades out, the spawned voxel will still be there. I need the voxel to be removed/faded at the same time background picture fades.
I used the below coding , anyone knows why it`s not fading out?
ACTOR Plasma_Gun4intro : PB_Weapon //Replaces PlasmaRifle
{
states
{
Spawn:
PLAI A -1 bright A_FadeOut(0.1,FTF_REMOVE)
stop
}
}
Now I need assistance with the below. Once the picture of the random weapon appears, it will spawn the respective voxel. The voxel spawned has it`s own actor to differentiate from the normal sprites in the game for those wanting 2d yet when playing. Problem is that when that background picture showing the weapon profile fades out, the spawned voxel will still be there. I need the voxel to be removed/faded at the same time background picture fades.
I used the below coding , anyone knows why it`s not fading out?
ACTOR Plasma_Gun4intro : PB_Weapon //Replaces PlasmaRifle
{
states
{
Spawn:
PLAI A -1 bright A_FadeOut(0.1,FTF_REMOVE)
stop
}
}
- Void Weaver
- Posts: 724
- Joined: Thu Dec 18, 2014 7:15 am
- Contact:
Re: Titlepic Intro project
Because A_FadeOut calls only once since it placed on infinity duration tic (-1). For smooth fading it should be like as:
Spawn:
PLAI A 1 bright A_FadeOut(0.0015)//FTF_REMOVE flag is true by default
Loop
Anyway total fading out speed depends on actor's initial Alpha value.
Spawn:
PLAI A 1 bright A_FadeOut(0.0015)//FTF_REMOVE flag is true by default
Loop
Anyway total fading out speed depends on actor's initial Alpha value.
- LastManonEarth
- Posts: 44
- Joined: Mon Apr 25, 2016 4:25 pm
Re: Titlepic Intro project
Thx. I had tried with loop instead of stop but nothing happened. Also, should try with 1 instead of -1 as you say. Last but not less important should the actor be translucent with an 1.0 alpha from the beginning?
RenderStyle "Translucent"
Alpha 1.0
or I am able to disregard those parameters?
RenderStyle "Translucent"
Alpha 1.0
or I am able to disregard those parameters?
- LastManonEarth
- Posts: 44
- Joined: Mon Apr 25, 2016 4:25 pm
Re: Titlepic Intro project
Worked, I appreciate the assistance.
Is there any way to make it fade out instantly, instead of progressively? I would say , fade out and object removed in about 2 seconds, to match the background picture fadeout....
Is there any way to make it fade out instantly, instead of progressively? I would say , fade out and object removed in about 2 seconds, to match the background picture fadeout....
- Void Weaver
- Posts: 724
- Joined: Thu Dec 18, 2014 7:15 am
- Contact:
Re: Titlepic Intro project
Just set a higher fading value, 0.5 or 0.1 instead of 0.0015. Seek out a desired value.
- LastManonEarth
- Posts: 44
- Joined: Mon Apr 25, 2016 4:25 pm
Re: Titlepic Intro project
It works. But there is an additional fact to be considered. Delay for background picture is 175 tics. I need the instant fade out to be applied at the same time the 175 tics of the background are consumed. This way, it will show and disappear very fast, and the background will keep showing with no voxel at all....the first way, will match the tics, but will start fading too earlier. Here we need to have an instant fadeout provided by a higher value as you mentioned, I think I should say the actor please wait 175 tics to disappear....not sure. Hopefully I am clear with this new request.
- Void Weaver
- Posts: 724
- Joined: Thu Dec 18, 2014 7:15 am
- Contact:
Re: Titlepic Intro project
Why do you needed for _FadeOut? With a such tiny duration its fading effect even aren't noticable...
Why just wouldn't use regular ReactionTime counter method for actor disappearing? Something like:
ACTOR Plasma_Gun4intro : PB_Weapon
{
ReactionTime 175 //Total duration of existance in tics while whole loop takes 1 tic
States
{
Spawn: //Full cycle takes a 1 tic
PLAI A 1 bright
TNT1 A 0 A_Countdown //Counter function
Loop
Death:
TNT1 A 0
Stop
}
}
EDIT:
Fixed. Forgot "States" keyword.
Why just wouldn't use regular ReactionTime counter method for actor disappearing? Something like:
ACTOR Plasma_Gun4intro : PB_Weapon
{
ReactionTime 175 //Total duration of existance in tics while whole loop takes 1 tic
States
{
Spawn: //Full cycle takes a 1 tic
PLAI A 1 bright
TNT1 A 0 A_Countdown //Counter function
Loop
Death:
TNT1 A 0
Stop
}
}
EDIT:
Fixed. Forgot "States" keyword.
Last edited by Void Weaver on Thu Jun 27, 2019 7:12 pm, edited 3 times in total.
- LastManonEarth
- Posts: 44
- Joined: Mon Apr 25, 2016 4:25 pm
Re: Titlepic Intro project
Sorry I am new to coding and learning. I did not know that ReactionTime existed, even I looked at the wiki. Will try and let you know.
- LastManonEarth
- Posts: 44
- Joined: Mon Apr 25, 2016 4:25 pm
Re: Titlepic Intro project
An error shows:
line 4:
Unexpected '{' in definition of 'Plasma_Gun4intro'
line 4:
Unexpected '{' in definition of 'Plasma_Gun4intro'
- LastManonEarth
- Posts: 44
- Joined: Mon Apr 25, 2016 4:25 pm
Re: Titlepic Intro project
I saw the edit. Works perfect now thanks!
Now I need to place monsters with a callcast. Need them to seesight as soon as the monster profile background appears, walk in the same place (limited) and firing at us randomnly with no effects on us. Like the doom2 end game cast, but with the random chosen monster. I was able to have a picture showing but only with a sprite. I understand a call cast limiting the properties of the monster and make it disappear too, will be somehow harder.
Will try and may ask for assistance later if needed. Which for sure will need.
Now I need to place monsters with a callcast. Need them to seesight as soon as the monster profile background appears, walk in the same place (limited) and firing at us randomnly with no effects on us. Like the doom2 end game cast, but with the random chosen monster. I was able to have a picture showing but only with a sprite. I understand a call cast limiting the properties of the monster and make it disappear too, will be somehow harder.
Will try and may ask for assistance later if needed. Which for sure will need.
- LastManonEarth
- Posts: 44
- Joined: Mon Apr 25, 2016 4:25 pm
Re: Titlepic Intro project
So I was able to place the monsters too finally. Need to get which properties need to provide him to walk instead of keep standing by. To be honest not sure if cyberdemon is standing by just as per the lack of space in the sector provided (good for a weapon, but bad for a big monster. So that, please see actor`s properties below. Just need him to walk toward us (but in the same place) and fire /shoot us randomly. It `s scaled 0.5 to fit, and intention is to have him even lower but need to solve the sector issue I posted in the mapping section for that.
ACTOR TheCyberdemon_CC2 : TheCyberdemon
{
+NOGRAVITY
-FLOATBOB
+FLOAT
+MISSILEMORE
+DONTTHRUST
+BRIGHT
Scale 0.5
FloatSpeed 0
Speed 0
Mass 99999
Radius 31
GibHealth
1000 Health
50 MeleeRange
100 DropItem None
}
****** EDIT: seems A_Chase will do the trick. However, any assistance on how to add this will be appreciated.
ACTOR TheCyberdemon_CC2 : TheCyberdemon
{
+NOGRAVITY
-FLOATBOB
+FLOAT
+MISSILEMORE
+DONTTHRUST
+BRIGHT
Scale 0.5
FloatSpeed 0
Speed 0
Mass 99999
Radius 31
GibHealth
1000 Health
50 MeleeRange
100 DropItem None
}
****** EDIT: seems A_Chase will do the trick. However, any assistance on how to add this will be appreciated.
- Attachments
-
- 11.png (53.47 KiB) Viewed 1074 times
- Void Weaver
- Posts: 724
- Joined: Thu Dec 18, 2014 7:15 am
- Contact:
Re: Titlepic Intro project
I guess that this actor aren't needed for any physical and battle properties (such as health, mass, speed, radius, etc.) at all. It's stay without movement because it awaits for acceptable target from A_Look function, since you inherited it from probably real monster "TheCyberdemon".
Try somethig like this:
Try somethig like this:
Code: Select all
ACTOR TheCyberdemon_CC2
{
Health 1
DeathSound "cyber/death"
ActiveSound "cyber/active"
var int user_cooldown;
States
{
Spawn:
TNT1 A 0 NoDelay A_PlaySound("cyber/sight",0)
See:
CYBR A 3 A_PlaySound("cyber/hoof")
CYBR ABBCC 3
CYBR D 3 A_PlaySound("spider/walk")
CYBR D 0
{
For(user_cooldown==0; user_cooldown<3; user_cooldown++)
{
A_Jump(256,"See");
}
}
CYBR D 0 A_SetUserVar(user_cooldown,0)
CYBR D 3 A_Jump(64,"Missile") //25% chance
Loop
Missile:
CYBR E 6
CYBR F 12 A_PlaySound("weapons/rocklf")
CYBR E 12
CYBR F 12 A_PlaySound("weapons/rocklf")
CYBR E 12
CYBR F 12 A_PlaySound("weapons/rocklf")
Goto See
/*
Death: //In case if you have handler for toggle death animation
CYBR H 10
CYBR I 10 A_Scream
CYBR JKLMNO 10
CYBR P 30
Stop
*/
}
}