Problem with Variables

Discuss all aspects related to modding Zandronum here.
Post Reply
TheBadHustlex
New User
Posts: 2
Joined: Fri Nov 08, 2013 9:39 pm
Location: Austria
Contact:

Problem with Variables

#1

Post by TheBadHustlex » Fri Nov 08, 2013 10:05 pm

(I hope this is the right place for questions like this).

Greetings.
I've got a little problem while editing on Zandronum 1.2.

When I try to create a user-variable for a projectile (Rocket2, in this case), I get this message:

[spoiler]Image[/spoiler]


This is how the script looks:

[spoiler]ACTOR Rocket2 Replaces Rocket
{
Radius 10
Height 8
Projectile
Speed 35
Damage 30
DamageType Explosive
MeleeDamage 0
Gravity 0.00
Decal "BigScorch"
-NOGRAVITY
+EXTREMEDEATH
+BLOODSPLATTER
Health 5
var int user_Rocket2[0];
SeeSound "weapons/RLL"
DeathSound "Explosion"
Obituary "$OB_MPROCKET"
States
{
.
.
.[/spoiler]

I would like to give it a variable, because I want to create an upgrade-system for Rockets. (When you get the upgrade-item, it sets the Rocket2-variable to 1. When the rocket reaches it's death-state after beeing fired, it should perform a jump [if the variable is 1] to an alternate death-state with a stronger explosion).

I know, there are plenty of variable-functions, like A_SetUserVar or A_SetUserArray. But here come's my question:

Am I doing something wrong, like creating the variable in a wrong way,
or are those features not yet implented in Zandronum 1.2?

I'd really like to know.
Last edited by TheBadHustlex on Fri Nov 08, 2013 10:06 pm, edited 1 time in total.

Ijon Tichy
Frequent Poster Miles card holder
Posts: 901
Joined: Mon Jun 04, 2012 5:07 am

RE: Problem with Variables

#2

Post by Ijon Tichy » Fri Nov 08, 2013 10:06 pm

user vars are not in zandronum

also you're missing a bunch of patches and graphics :v
Last edited by Ijon Tichy on Fri Nov 08, 2013 10:07 pm, edited 1 time in total.

TheBadHustlex
New User
Posts: 2
Joined: Fri Nov 08, 2013 9:39 pm
Location: Austria
Contact:

RE: Problem with Variables

#3

Post by TheBadHustlex » Fri Nov 08, 2013 10:13 pm

OK, thanks for the quick awnser. Then, I've got to come up with another way to reach my goal.

And yes, I deleted plenty of unused texture-graphics/patches today to reduze the size of my mod. But I'm not finished with wiping them out completely yet.

User avatar
Vincent(PDP)
Forum Regular
Posts: 527
Joined: Thu Mar 14, 2013 7:35 pm
Location: Sweden
Clan: My DOOM site
Clan Tag: <MDS>
Contact:

RE: Problem with Variables

#4

Post by Vincent(PDP) » Sun Nov 17, 2013 10:31 am

TheBadHustlex wrote: OK, thanks for the quick awnser. Then, I've got to come up with another way to reach my goal.

And yes, I deleted plenty of unused texture-graphics/patches today to reduze the size of my mod. But I'm not finished with wiping them out completely yet.
I don't know if this will work the way you want it, but you maybe can use CVars?

Code: Select all

#Include "zcommon.acs"
#Import "MODCVARS.acs"

Script 1 (void)
{
Str CVar1 = StrParam(s:"x_Rocket2_", d:PlayerNumber()+1); //Would return for example 'x_Rocket2_12' if you're the 12th player on the server//
Str CVar1Save = StrParam(s:"archivecvar x_Rocket2_", d:PlayerNumber()+1);
SetCvar(CVar1, <value>)
ConsoleCommand(CVar1Save);
}
//Visual Vincent ( Vincent (PDP) )
- My DOOM site Team

My projects:
Spoiler: (Open)
Doom Writer
Escape From The Laboratory - Done
Escape From The Laboratory Part 2
Parkskolan Zombie Horde Map (ZM10) - Done
In game Admin Commands for Zandronum.
Achievement Mod for Zandronum
Stats mod

Post Reply