Ouchface
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Special Interest > Eternity > Small help?
 
Author
All times are GMT. The time now is 21:58. Post New Thread    Post A Reply
Lance MDR Rocket
Green Marine


Posts: 49
Registered: 03-06


I'm having a little trouble with the Small scripting engine. Basically I want to set up a monster that will exit my map when killed. I've tried to set it up so that it will measure the creature's health every couple of seconds and exit the level when it reaches zero.

However, the compiler whinges at me when I attempt to set up an integer using the _ThingGetProperty command (so:
static bosshealth = (_ThingGetProperty(69, _THING_HEALTH))) and setting it to a value of 1 or something similar doesn't work properly either (a low value means it exits too soon, a high one makes it not work at all). An attempt to work around the second problem by rechecking the health value every time the script is called hasn't helped either. Can anyone help?

This is the full script in it's final form (ie. before I gave up and went to bed):

public OnInit()
{
//_SectorColormap ("BLDMAP", "_cmap_bottom", 7);
Incidently, I'm also having trouble with this. I've tried changing the punctuation, capitalisation etc. etc. around but it refuses to work for me (hence why its commented out). Help?
_SetCallback("StartupTXT", _SWAIT_DELAY, 35);
_SetCallback("Script69", _SWAIT_DELAY, 35);
}

public Script10()
//The Soulsphere Script
{
static bool:spherei = false;

if(!spherei)
{
_Printf(_MSG_CENTER, "Placeholder script here\a");
spherei = true;
}
}

public Script69()
//The exit script (or at least part of it)
{
//_Printf(_MSG_CENTER, "Placeholder script here\a");

static bosshealth = (_ThingGetProperty(69, _THING_HEALTH));

if (bosshealth < 1)
{
_SetCallback("EndGame", _SWAIT_DELAY, 350);
}

bosshealth = (_ThingGetProperty(69, _THING_HEALTH));
_SetCallback("Script69", _SWAIT_DELAY, 35);

}

public StartupTXT()
{
_Printf(_MSG_CENTER, "Welcome to \133The Wicked Shall Perish,\n\139 by Lance MDR Rocket.\a");
}

public EndGame()
{
_ExitLevel();
}


Thanks in advance, and I'm sorry if this is a fairly noob-like question. I'm afraid my grasp on maths and the maths-like disciplines is fairly shaky.

Finally, as a suggestion, would it be possible to update the small_funcref file in the docs .zip to include working examples of each script? I'd really appreciate it.

Old Post 03-28-06 05:56 #
Lance MDR Rocket is offline Profile || Blog || PM || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
Mordeth
Administrator


Posts: 1704
Registered: 05-00



Lance MDR Rocket said:
Finally, as a suggestion, would it be possible to update the small_funcref file in the docs .zip to include working examples of each script? I'd really appreciate it.


Seconded!

Old Post 03-28-06 07:33 #
Mordeth is offline Profile || Blog || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
Joe
Has an Avatar avatar


Posts: 230
Registered: 07-04


Well, the problem here is how you've declared bosshealth. YOu can't give a static variable a value then change it. It stays static, hence the name. To fix it, get rid of the static before bosshealth = (_ThingGetProperty(69, _THING_HEALTH)); and instead stick new bosshealth; at the top, or at the start of Script69. That should do you. I'd also reccomend removing the static before spherei. I only made those changes and it compiled fine for me.

Also, I'm pretty sure Quasar told me that the colormap functions were disabled for some gaybar reason.

Hope that helps.

Old Post 03-28-06 16:42 #
Joe is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 2200
Registered: 08-00


I am not certain what the problem with the bosshealth assignment is. Could you please post the message that you get from the compiler? It would go miles toward helping me figure out what's going on here. It looks like it should work to me, unless there's no thing with TID 69 for some reason.

Do not use _SectorColormap yet -- it is broken and must be reimplemented completely before it's going to work. Sorry about that; I had meant to remove it from the documentation until it was fixed, but forgot to do this before 3.33.02 was released.

I encourage users to help with the authoring of tutorials, because it is something I have very little time to do. Joe has written one tutorial which is now posted on the Eternity Engine's page, but we need more. Is anybody willing to do this?

Old Post 03-28-06 19:44 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
myk
patron mod of ugly ducklings and black sheep


Posts: 10410
Registered: 04-02



Quasar said:
I encourage users to help with the authoring of tutorials, because it is something I have very little time to do. Joe has written one tutorial which is now posted on the Eternity Engine's page, but we need more. Is anybody willing to do this?
You might want to shift toward a wiki-style page for Eternity, so that people can more easily contribute in that regard.

Old Post 03-28-06 20:09 #
myk is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 2200
Registered: 08-00


We have a Wiki too. I'm not discouraging its use in any way :P

Old Post 03-28-06 20:38 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
Bloodshedder
Spellchecker


Posts: 4031
Registered: 03-02


Behold the unused wiki that nobody seems to know about

Old Post 03-28-06 20:42 #
Bloodshedder is online now Profile || Blog || PM || Email || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
Lance MDR Rocket
Green Marine


Posts: 49
Registered: 03-06


OK, cheers guys. I'll try changing the 'static' prior to bosshealth to 'new' and see what happens (and the Soulsphere script if necessary, but that compiled fine and seemed to work OK for me) when I get home. Although, I seem to be under the impression that that will break the script if someone loads a save game?

Shame about _SectorColormap: is there at least a way to change the colour of the light in a sector? I've got a bit where the player is submerged in blood and it does look a bit silly without that or a similar effect.

Also, I'll happily help out with tutorials, or the wiki (which I've never seen before: is there even a link on the Eternity page?), when I suck a bit less.

Old Post 03-29-06 00:18 #
Lance MDR Rocket is offline Profile || Blog || PM || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
Bloodshedder
Spellchecker


Posts: 4031
Registered: 03-02



Lance MDR Rocket said:
or the wiki (which I've never seen before: is there even a link on the Eternity page?)
Quasar doesn't seem to want to link to it until it has some material, but it's not going to get any material unless people know about it. Chicken or the egg.

Old Post 03-29-06 00:43 #
Bloodshedder is online now Profile || Blog || PM || Email || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
Lance MDR Rocket
Green Marine


Posts: 49
Registered: 03-06


For future reference, the error message I got was the following:

map01scr.txt(25) : error 008: must be a constant expression; assumed zero

Old Post 03-29-06 13:47 #
Lance MDR Rocket is offline Profile || Blog || PM || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 2200
Registered: 08-00


You told me not to link it until I had created an entire framework of subjects, which is something I simply am not capable of doing on my own, so I had refrained for some time.

Old Post 03-29-06 14:41 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 2200
Registered: 08-00



Lance MDR Rocket said:
For future reference, the error message I got was the following:

map01scr.txt(25) : error 008: must be a constant expression; assumed zero



OK. That means that you have an executable statement where only a constant expression (like the number 0) is allowed.

Changing bosshealth to static will break your script if you expect the value to persist between calls to the script; variables declared with "new" disappear when the script stops executing.

Here's an example that should work:

code:
public Script0() { static bosshealth; static bool:firsttime = true; if(firsttime) { bosshealth = _ThingGetProperty(...); firsttime = false; } ... }

Old Post 03-29-06 14:45 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
Bloodshedder
Spellchecker


Posts: 4031
Registered: 03-02



Quasar said:
You told me not to link it until I had created an entire framework of subjects, which is something I simply am not capable of doing on my own, so I had refrained for some time.
I don't recall saying that, but if you're not capable of doing it on your own, why not link to it so other people who might want to help can do so?

Old Post 03-29-06 17:36 #
Bloodshedder is online now Profile || Blog || PM || Email || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 2200
Registered: 08-00


BTW, if the sector you are trying to manipulate is already subject to the effects of a 242 linedef, it's possible to assign it a colormap via that method. Instead of trying to set _cmap_bottom, just set the lower texture name on the 242 linedef to the colormap lump (at least, IIRC, this is how it works). In Eternity, 242 colormaps work more like sector lighting than they did in BOOM, where they refused to work unless you were in the sector itself. While the change breaks compatibility slightly, it is a positive one where the benefits far outweigh the problems.

Old Post 03-30-06 15:46 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
Mordeth
Administrator


Posts: 1704
Registered: 05-00



Quasar said:
In Eternity, 242 colormaps work more like sector lighting than they did in BOOM, where they refused to work unless you were in the sector itself.


OMFG I didn't know this. Yay for colormaps!

Old Post 04-01-06 11:29 #
Mordeth is offline Profile || Blog || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
Mordeth
Administrator


Posts: 1704
Registered: 05-00



Mordeth said:
OMFG I didn't know this. Yay for colormaps!


... And it does not work for portals. SOM..! :)

Old Post 04-04-06 20:52 #
Mordeth is offline Profile || Blog || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 2200
Registered: 08-00


Mordeth, the restrictions on 242 spaces still apply across portals. The player cannot see different vertical partitions of 242 spaces at the same time. If the player is in the "middle" section, as he is when he is in normal space, then he must ONLY be able to view the "normal" space of ALL 242 sectors in the entire map -- the alternative is HOM. Portals cannot violate this.

This restriction is inherent to the 242 hack as it was created for BOOM, and cannot be removed as far as I know. Try using the "middle" space of the 242 effect . I'm not sure if it can be assigned a colormap or not. If not, you'll have to wait until general sector colormap assignment works properly.

Old Post 04-05-06 19:06 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
Mordeth
Administrator


Posts: 1704
Registered: 05-00



Quasar said:
This restriction is inherent to the 242 hack as it was created for BOOM, and cannot be removed as far as I know. Try using the "middle" space of the 242 effect . I'm not sure if it can be assigned a colormap or not.


That is what I was talking about. Middle-space colormaps work right now, so you can have eg. a red-coloured sector somewhere on your map that looks OK from every other sector. Applying a middle-space colormap on a portal sector also colours that portal sector, but it looks normal (without colour) when the portal is viewed from its anchor (in-game) sector.

If that worked, it would be extremely cool... especially with linked portals in place. For example: fog effects on the ground only, or a green glow just above nukage pools.

God I love this engine ;)

Old Post 04-06-06 09:11 #
Mordeth is offline Profile || Blog || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
All times are GMT. The time now is 21:58. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Special Interest > Eternity > Small help?

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Forums Directory