simulate the crouch
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
- DOOMERO-21
- Posts: 1423
- Joined: Wed Jan 02, 2008 10:02 pm
- Location: Chile
simulate the crouch
i have a question, when i press the crouch buttom, the player view change and go down, i need sometime like that, but not using crouch buttom, i mean edit the player view height for some events.
- Ral22
- Posts: 531
- Joined: Sun Sep 05, 2010 12:09 pm
- Preferred Pronouns: He/Him
- Location: The Fortress of Dr. Radiaki
- Contact:
Re: simulate the crouch
I'm interested in this as well, but I haven't found a way to do it yet.
Re: simulate the crouch
I don't think the player view height can be altered dynamically using native ZDoom methods but you can fake it with camera views or even something as simple as putting the player on a platform and moving him up and down, provided that the player doesn't need to move around during your "events".
There is, however, [wiki]FraggleScript[/wiki] and it can alter the viewheight. eg this:
will switch the player viewheight to 16 and then raise it to 52 (the height I was using for the normal player viewheight in my mod). I was using it to simulate the player getting up from the floor after being knocked out in the previous level.
There is, however, [wiki]FraggleScript[/wiki] and it can alter the viewheight. eg this:
Code: Select all
[scripts]
script 254
{
runcommand("viewheight 16");
wait(30);
runcommand("viewheight 52");
}
startscript(254);- DOOMERO-21
- Posts: 1423
- Joined: Wed Jan 02, 2008 10:02 pm
- Location: Chile
Re: simulate the crouch
Enjay wrote:I don't think the player view height can be altered dynamically using native ZDoom methods but you can fake it with camera views or even something as simple as putting the player on a platform and moving him up and down, provided that the player doesn't need to move around during your "events".
There is, however, [wiki]FraggleScript[/wiki] and it can alter the viewheight. eg this:
will switch the player viewheight to 16 and then raise it to 52 (the height I was using for the normal player viewheight in my mod). I was using it to simulate the player getting up from the floor after being knocked out in the previous level.Code: Select all
[scripts] script 254 { runcommand("viewheight 16"); wait(30); runcommand("viewheight 52"); } startscript(254);
interesting Enjay, i will check this, thanks!
Re: simulate the crouch
Simple example map:
edit:
Thinking about it, I suppose creating a player class with a different viewheight and then morphing the player might also work. At least that would be using native ZDoom features.
Code: Select all
[scripts]
script 254
{
wait(70);
print("viewheight 128");
runcommand("viewheight 128");
wait(105);
print("viewheight 36");
runcommand("viewheight 36");
wait(105);
print("viewheight 4");
runcommand("viewheight 4");
wait(105);
print("viewheight 80");
runcommand("viewheight 80");
wait(105);
print("viewheight 41 - default");
runcommand("viewheight 41");
}
startscript(254);Thinking about it, I suppose creating a player class with a different viewheight and then morphing the player might also work. At least that would be using native ZDoom features.
- DOOMERO-21
- Posts: 1423
- Joined: Wed Jan 02, 2008 10:02 pm
- Location: Chile
Re: simulate the crouch
the player class, hmmm that could be too, but Enjay this could work with a global script? my mod not depend of maps.
edited: i have a problem, the xwe cant compile this.
edited2: also i tried with morph the actor and works!
edited: i have a problem, the xwe cant compile this.
edited2: also i tried with morph the actor and works!
Re: simulate the crouch
You probably don't need it now but...DOOMERO-21 wrote:the player class, hmmm that could be too, but Enjay this could work with a global script? my mod not depend of maps.
edited: i have a problem, the xwe cant compile this.
edited2: also i tried with morph the actor and works!
FraggleScripts do not get compiled. Map specific scripts are held in a text lump that is used to replace the usual map01, map02 etc markers in the WAD.
They can also be used from a global script. From memory, fragglescripts in a lump called FSGLOBAL get executed globally.
- DOOMERO-21
- Posts: 1423
- Joined: Wed Jan 02, 2008 10:02 pm
- Location: Chile
Re: simulate the crouch
i tried but is not working, on your test map the script was compiled.
Re: simulate the crouch
It really wasn't.DOOMERO-21 wrote:on your test map the script was compiled.
My map does have a behavior lump because the map is in ZDoomHexen format. However, if you look at it with SLADE, it doesn't contain any scripts.
The FS script data is held in the MAP01 lump. This is normally just a header with the various map lumps after it but, in the case of FraggleScript, it's a text lump containing the scripts. However, the only way that I can find to show it are by opening the WAD in a HEX editor or Text editor. It would seem that when SLADE or XWE see a lump called MAP01, they show a map preview even though there is data in the MAP01 lump.
Text editor screenshot:

See, not compiled.
[edit]Also, I just copied and pasted my script into a text file called FSGLOBAL.txt and loaded it at the command line (ie zdoom -file FSGLOBAL.txt) and when I started a game, the script ran.[/edit]
[edit2]My bad, SLADE does show the script if you use a recent SVN build (r1299 or newer). [/edit2]

