Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 8 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : DOOM III
Category: DOOM III Mapping
D3 mapping and level design.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: Same old scripting problem
drech
General Member
Since: Aug 25, 2004
Posts: 118
Last: Jul 31, 2005
[view latest posts]
Level 4
Category: DOOM III Mapping
Posted: Wednesday, Sep. 22, 2004 11:09 pm
I'm getting really fed up with this, and I still can't understand why it doesn't work. I'm trying to make a rotating door script that is generic, so that it can be used by one of any doors in a map. After following a few tutorials, I've gained a fair understanding of how the scripting works, plus I've dealt with c-based scripting a lot in the past, so I'm pretty sure I'm doing it right..

I've got:

door.script:

void open_door( entity door )
{
door.rotateTo('0 90 0');
}

and a trigger_multiple entity set with
call
open_door(TheDoorIWantToOpen)


where, of course, TheDoorIWantToOpen is replaced by the name of the func_mover entity I want to run the script on. I've also tried it using
call
open_door($TheDoorIWantToOpen)

with the $, but still no luck. I get an error that says that "Trigger 'triggername' at (vector) calls unknown function 'open_door(TheDoorIWantToOpen)'"
Share |
Liquefier
General Member
Since: Aug 18, 2004
Posts: 67
Last: Oct 19, 2004
[view latest posts]
Level 3
Category: DOOM III Mapping
Posted: Wednesday, Sep. 22, 2004 11:42 pm
I used to get this error all the time, because I was using a scriptfile with a different name. I could never get this to work, even if I declared it in worldspawn. Try pasting the function into the mapname.script and see if you can get any further with that
Share |
foyleman
Preferred PLUS Member
Since: Nov 7, 2001
Posts: 95762
Last: Apr 13, 2021
[view latest posts]
Level 10
Admin
Forum Moderator
Im a fan of MODSonair
Im a HOST of MODSonair
Category: DOOM III Mapping
Posted: Wednesday, Sep. 22, 2004 11:45 pm
ahat about this:

open_door($TheDoorIWantToOpen)

Are you suppose to place that $ sign in there? Since it's not in a script and instead in the map, I think you are declaring the name and not referring to the name. Therefore, the $ should not be there.

I am not sure.. just trying to help.
Go ahead... You Play I Mod : Support Modsonline by becoming a PREFERRED MEMBER today!
Have you heard the MODSonair Podcast?:
MODSonair is a weekly podcast bringing you the news from a modders perspective.
Tune in every Sunday at 12pm EST to listen LIVE.
Quake 4 Mods for Dummies - Half-Life 2 Mods for Dummies
Share |
drech
General Member
Since: Aug 25, 2004
Posts: 118
Last: Jul 31, 2005
[view latest posts]
Level 4
Category: DOOM III Mapping
Posted: Thursday, Sep. 23, 2004 03:59 am
Liquefier writes...
Quote:
I used to get this error all the time, because I was using a scriptfile with a different name. I could never get this to work, even if I declared it in worldspawn. Try pasting the function into the mapname.script and see if you can get any further with that



It is in the mapname.script x_x

And I've tried it both ways, foyle. It's possible that it simply can't be done.
Share |
JBAM
General Member
Since: Jun 7, 2004
Posts: 86
Last: May 10, 2005
[view latest posts]
Level 3
Category: DOOM III Mapping
Posted: Thursday, Sep. 23, 2004 04:45 am
So if it is saying 'open_door(TheDoorIWantToOpen)', doesn't that suggest that the problem is at the editor end of things? --> ie it is not linking this line to the line in the script. do you need spaces either side like in the script

eg ( TheDoorIWantToOpen )

Maybe you need to specify the entity type in the brackets, and then put the name in that field as you've done...

void open_door( func_mover )
{
door.rotateTo('0 90 0');
}

I DONT CODE, AND I DONT KNOW WHAT I'M TALKING ABOUT WOOT! lol

just wanted to help

EDIT:

Should you have a $ in the script before "door.rotateTo('0 90 0'); "

void open_door( func_mover )
{
$door.rotateTo('0 90 0');
}
Share |
Liquefier
General Member
Since: Aug 18, 2004
Posts: 67
Last: Oct 19, 2004
[view latest posts]
Level 3
Category: DOOM III Mapping
Posted: Thursday, Sep. 23, 2004 08:03 am
ok, I'm just going with this here, I dunno how to make it work exactly.

You need to have the trigger that calls the function know the name of what entity you want triggered. Hypothetically, you should be able to give it a new value, under a new name. For Example: script_target = mydoor5
You'd type this into the trigger_relay in the game. OK.
Now, you need to tell the script to look at the entity calling it. In C/C++ you would use the this pointer. I dunno if doom3 has it for scripting. If it does, the syntax would look like this:

$this->script_target.rotateTo("rotation point");

I doubt that it is this simple, but I think it's along the right path.

If you know the address of the entity you want to manipulate, you should be able to use it in expressions.
Share |
foyleman
Preferred PLUS Member
Since: Nov 7, 2001
Posts: 95762
Last: Apr 13, 2021
[view latest posts]
Level 10
Admin
Forum Moderator
Im a fan of MODSonair
Im a HOST of MODSonair
Category: DOOM III Mapping
Posted: Thursday, Sep. 23, 2004 11:22 am
The last time I was playing with this script question, I was setting up reporting methods rather than actual functions. If I have time this weekend I will start it up again.

setup a script and use the sys.print() or similar to output to the screen. the idea it to try and trigger that... then to later trigger and have it print something that you specified in the editor. That way you know you are gettng your commands through to the script.

What about your declaration that the entity exists? Is that needed? I know if you want to setup a vector variable like

thispoint = '0 90 0' ;

that you have to head the script with

vector thispoint;

That would declare to the script that thispoint is a vector coordinate value.

bah.. I need time to play with it.
Go ahead... You Play I Mod : Support Modsonline by becoming a PREFERRED MEMBER today!
Have you heard the MODSonair Podcast?:
MODSonair is a weekly podcast bringing you the news from a modders perspective.
Tune in every Sunday at 12pm EST to listen LIVE.
Quake 4 Mods for Dummies - Half-Life 2 Mods for Dummies
Share |
Liquefier
General Member
Since: Aug 18, 2004
Posts: 67
Last: Oct 19, 2004
[view latest posts]
Level 3
Category: DOOM III Mapping
Posted: Friday, Sep. 24, 2004 08:16 am
Man, this really has me stumped. The this pointer doesn't give me an error, but it doesn't seem to be the entity that is calling the script. I can't seem to find a way to determine how to get the name of the entity that is making the script call. If I could do this, I could make it work. However, I am not really versed in the syntax of doom3 scripting. I'm a C++ programmer and not really sure how the scripting engine works. I'm gonna keep trying though. Lemme know of any progress that you make.

There has GOT to be a way to do it!!!!
Share |
drech
General Member
Since: Aug 25, 2004
Posts: 118
Last: Jul 31, 2005
[view latest posts]
Level 4
Category: DOOM III Mapping
Posted: Saturday, Sep. 25, 2004 11:47 pm
the real problem with that is that Doom 3 does not have a "this" object. Usually you can use "this" (in Java, possibly C++ and in other forms of code including flash) to refer to the object that called the function. Doom 3 does not have a "this," and therefore, you must know the name of the object that targets another object to use $object.getTarget()
Share |
drech
General Member
Since: Aug 25, 2004
Posts: 118
Last: Jul 31, 2005
[view latest posts]
Level 4
Category: DOOM III Mapping
Posted: Saturday, Sep. 25, 2004 11:51 pm
JBAM writes...
Quote:
So if it is saying 'open_door(TheDoorIWantToOpen)', doesn't that suggest that the problem is at the editor end of things? --> ie it is not linking this line to the line in the script. do you need spaces either side like in the script

eg ( TheDoorIWantToOpen )

Maybe you need to specify the entity type in the brackets, and then put the name in that field as you've done...

void open_door( func_mover )
{
door.rotateTo('0 90 0');
}

I DONT CODE, AND I DONT KNOW WHAT I'M TALKING ABOUT WOOT! lol

just wanted to help

EDIT:

Should you have a $ in the script before "door.rotateTo('0 90 0'); "

void open_door( func_mover )
{
$door.rotateTo('0 90 0');
}



Thanks for your help, but nah, that won't work. You have to have a variable type in the function declaration (in the braces). You see, declaring (entity door) in the function declaration is also declaring a new variable of type entity, named "door," that will be set equal to whatever is put in the braces when that function is called. The new variable (door) can then be used throughout the function.

At least, that's the way I'm used to it working.
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : DOOM III : DOOM III Mapping

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»