acs ingame tutorial

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

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.

acs ingame tutorial

Postby tweaker212 » Wed Jul 28, 2021 3:33 pm

well i was tired of going in and out of gameplay
and so I thought hmm there has to be a easier way
well i found it

i first created these files
decorate.txt
cvarinfo.txt
loadacs.txt
menudef.txt
floor.acs

then in cvarinfo i put
server noarchive int fl2=0;

then in the action special for floor_lowerbyvalue
it had sector/tag speed and hight
so i thought hmm how can i make this work

heres how

#acs code#
#library "floorhelper"
#include "zcommon.acs"


script "fh1" (void)
{
delay(35);
int a= getcvar("tag");
int b= getcvar("sp1");
int c = getcvar("ht1");
delay(3);
floor_lowerbyvalue(a,b,c);
}
compiling the script this way will not error out because all the parameters are present only way to adjust the parameters is setting the cvar itself so i then went back into the
cvarinfo.txt i put


server noarchive int tag=0;
server noarchive int sp1=0;
server noarchive int ht1=0;


then in menudef.txt i have this

addoptionmenu optionsmenu
{
submenu "script helping menu","sandboxmenu"
}
optionmenu sandboxmenu
{
title "scripting help"
submenu "script help menu","modmenu1"
}

optionmenu modmenu1
{
title "ok which one do u need help with"
submenu "floors","poj1"
}

optionmenu poj1
{
title "floor script helper"
statictext"script chooser",gold
option "script:","fl2","poj2"
statictext"variable adjustments",gold
submenu "lowerbyvalue variables","ftl"
statictext"script activation",gold
command "activate script with above variables","summon floortest"
}

optionvalue poj2
{
1,"floor_lowerbyvalue"
}

optionmenu ftl
{
title "floor lowerbyvalue"
statictext"ok adjust what you need"
statictext" in acs its floor_lowerbyvalue(tag,speed,hight)",cyan
textfield "tag:","tag"
textfield "speed:","sp1"
textfield "hight:","ht1"
}

now to make the script option work u need a decorate actor like so

actor floortest
{
states
{
spawn:
tnt1 a 2
tnt1 a 0 a_jumpif(fl2== 1,"lower")
stop
lower:
tnt1 a 0 50
tnt1 a 0 a_printbold("executing script")
tnt1 a 0 50
tnt1 a 0 acs_namedexecute("fh1",0)
stop
}
}
then in the load acs text i put the following

floorhelper


since the cvar is linked to the decorate actor and the other cvars are linked to the scripts you will always get the desired affect you want and execute any script you need to for debugging perposes/testing perposes

horrah for gzdoom!!!!!
may it never die!!!!
rip and tear fellow doomers !!!!
thats a order damit lol

to witness this tutorial in action please visit this YouTube link
https://youtu.be/bilVJw2MdWQ

hopefully this will inspire someone to create a comprehensive acs scripter helper mod
You do not have the required permissions to view the files attached to this post.
tweaker212
 
Joined: 05 Mar 2018

Return to Scripting

Who is online

Users browsing this forum: No registered users and 2 guests