Descentforum.DE Forum Index Descentforum.DE
Search | FAQ | Memberlist | Usergroups | Newsfeed Newsfeed  Register
Profile | Log in to check your private messages | Log in 
Chat | D3-Tactics | Downloads | Map | Links | Serverlist | Teamspeak 

script help
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    Descentforum.DE Forum Index -> English Embassy / International Descenters Forum
View previous topic :: View next topic  
Author Message
NightmareUSA
Forum-Nutzer


Joined: 25 Apr 2004
Posts: 43
Location: New York USA

PostPosted: 25.04.2004, 05:24    Post subject: script help Reply with quote

Hi everyone,

I am a noob to scripting and have been having some dificulty with getting them to run. I tried the game edit tutorial for teleporter and I got the spark but teleporter. I also tried the one titled basic scripting but I can't even see my robot. DwnUndr gave me an idea to try single player mode on that one, which I am going to try right now. Any help will be appreciated.

Thanks,

Nightmare of [RIP]
Back to top
View user's profile Send private message
Atan
Moderator


Joined: 27 Jul 2001
Posts: 876

PostPosted: 25.04.2004, 21:07    Post subject: Reply with quote

Nightmare,
Sorry, I have some trouble to understand your question.
Could you please tell me what exactly you want to do, where you stuck?

If you would like to learn the basics,
I would suggest you should build a small 2-3 Room level
and insert a D3 switch object then, not more.
Name that switch as you like.
The player is inserted automaticly by D3Edit.
If you will follow my suggest,
I'll try to show you the first steps in Scripting by using that switch.
Tell me if this small level is ready and you can fly around inside
and see your switch inside.


(LL)Atan


Last edited by Atan on 25.04.2004, 21:49; edited 1 time in total
Back to top
View user's profile Send private message
Do_Checkor
Administrator


Joined: 19 Nov 2000
Posts: 7768
Location: Oldenburg (Oldb.)

PostPosted: 25.04.2004, 21:12    Post subject: Reply with quote

...but it would be nice if you would hold the conversation right here, because it may be interesting to others here too.

I have absolutely no clue of teleporters / scripting...
Back to top
View user's profile Send private message
NightmareUSA
Forum-Nutzer


Joined: 25 Apr 2004
Posts: 43
Location: New York USA

PostPosted: 26.04.2004, 06:32    Post subject: Reply with quote

Thanks Atan that would be great! I would like to learn some. I will put a switch in a small level by tomorrow.

I have a print screen image of my script for the teleporter, does it look right? cause I cannot figure out why it won't work.

I hope I attached it right. heheh

Thanks,

Nightmare
Back to top
View user's profile Send private message
Atan
Moderator


Joined: 27 Jul 2001
Posts: 876

PostPosted: 26.04.2004, 18:52    Post subject: Reply with quote

Can't see much detail at this bmp,
but it seems to be right.
But forget the teleporter in the moment, we'll come back to this later.

What I need to know is if you ever had any own script which is working inside your level.
Knowing this will give me an idea where to start.

Again:
Make a 2-3 room level by standard rooms and insert a switch anywhere,
best would be one of type 'Handleswitch'
Name it 'Sound'
Save your level.

Tell me how your testlevel is named ( the mn3 name)

If this way is not fast enough for you,
I must do a tuturial where you can follow all steps at once.
But this would not show where possible errors are done by your side.
Back to top
View user's profile Send private message
NightmareUSA
Forum-Nutzer


Joined: 25 Apr 2004
Posts: 43
Location: New York USA

PostPosted: 26.04.2004, 21:49    Post subject: Reply with quote

Ok I will have one by tonight named "script.mn3".

I am at school right now then I have to go to work but I will be home tonight around 9:30 pm est-usa
Back to top
View user's profile Send private message
Atan
Moderator


Joined: 27 Jul 2001
Posts: 876

PostPosted: 26.04.2004, 23:14    Post subject: Reply with quote

ok, we will have a one day delay, but that doesn't care.
Good things must have time Smilie

if your level ist ready, fly inside and look for your handleswitch.
Shooting it will do nothing, this is just to see if your level is ok.

Load your level into the editor, select world view.
Start Dallas
this should work without any problem. (config is ok)

//---------------

->NewScript

Script001: name it PlaySound

Owner: Sound (this is the name of the switch)

Event: Collided (With IT)

if the following condition is met :
Always

then perform following actions:
Play 2D Sound Bell for player object IT Volume 100%
(or which sound you'll like, except any ENV-sound)

Do Nothing

//---------------

ok, this should be your first script now, I hope I made no fault, because i made this one out of mind.

Press 'Save'
Dallas will work until 'done' and produce a file named: script.dll and script.msg (Osiris Folder) if all went well.
If you don't know where this new file went in, use the Windows Search function.

Open Quicktest and insert the two files into your hog now.
Save your level.
Start the level and fly against the switch now. (or shoot)
You should hear the sound.

Tell me if it works, or where you run into trouble now.
This little one must work before we go ahead!

Next time we'll animate the switch.
Back to top
View user's profile Send private message
NightmareUSA
Forum-Nutzer


Joined: 25 Apr 2004
Posts: 43
Location: New York USA

PostPosted: 28.04.2004, 01:08    Post subject: Reply with quote

Nice, it is working now! Thanks for helping me Atan!

OK, everthing is working ready for animation..
Back to top
View user's profile Send private message
Atan
Moderator


Joined: 27 Jul 2001
Posts: 876

PostPosted: 28.04.2004, 16:38    Post subject: Reply with quote

Nice Winken
so we can go ahead with a few steps now, but I strongly suggest:
PLEASE test it one by one, ok?
let's go
--------------------------------------------------------------

Nr. 2:
Animate the switch by collide

//--------

Script001: PlaySound

Owner: Sound

Event: Collided (With IT)

if the following condition is met :
Always

then perform following actions:
Play 2D Sound Bell for player object IT Volume 100%

Play object Sound animation from frame 0 to 20, cycle time = 1.00, looping=FALSE

Do Nothing
--------------------------------------------------------------

Nr. 3:
Insert a condition which limit the trigger-action to player weapon hits.

//--------

Script001: PlaySound

Owner: Sound

Event: Collided (With IT)

if the following condition is met :
(IT is a player weapon)= (TRUE)

then perform following actions:
Play 2D Sound Bell for player object IT Volume 100%

Play object Sound animation from frame 0 to 20, cycle time = 1.00, looping=FALSE
Do Nothing
--------------------------------------------------------------

Nr. 4:
Show a message if switch is activated.

This needs to prepare some things before:
Open Dallas, generate a new message, name it : ShowHitText
Write a text into the Win below ChangeNameID
i.e.: Switch is activated

//--------

Script001: PlaySound

Owner: Sound

Event: Collided (With IT)

if the following condition is met :
(IT is a player weapon)= (TRUE)

then perform following actions:
Play 2D Sound Bell for player object IT Volume 100%

Play object Sound animation from frame 0 to 20, cycle time = 1.00, looping=FALSE

Show HUD message ShowHitText

Do Nothing
--------------------------------------------------------------

Tell me if it's working for you or what problem will come up.
Some more things could follow next days, or is my way to 'teach' too easy for you?
Back to top
View user's profile Send private message
NightmareUSA
Forum-Nutzer


Joined: 25 Apr 2004
Posts: 43
Location: New York USA

PostPosted: 29.04.2004, 05:12    Post subject: Reply with quote

Finished Nr. 3:

Your teaching method is good Atan, the pace is just right. The difficulty level is just right. I have some beginning level programming experience from school [C++], which makes this is very interesting for me.

I do not see this part though

"Play object Sound animation from frame 0 to 20, cycle time = 1.00, looping=FALSE"

I do have the sound working though, just using the 2d sound for player mode.

I have it to the point where it is working with my player shots only and not just from contact. I will try the hud message in the tomorrow afternoon after school, it is late here and I have to go to bed. I will be ready for next lesson tomorrow.

Good news too, I got my teleporter working!

Many Thanks,

NightmareUSA
Back to top
View user's profile Send private message
Atan
Moderator


Joined: 27 Jul 2001
Posts: 876

PostPosted: 29.04.2004, 16:18    Post subject: Reply with quote

I do not see this part though

"Play object Sound animation from frame 0 to 20, cycle time = 1.00, looping=FALSE"


this means it don't work for you?
or don't understand what this means?
Back to top
View user's profile Send private message
NightmareUSA
Forum-Nutzer


Joined: 25 Apr 2004
Posts: 43
Location: New York USA

PostPosted: 29.04.2004, 20:10    Post subject: Reply with quote

my code basicly looks like this:

PlaySound
Owner: Switch1 (Object)
Event: Collided (with IT)
If the following condition is met:
(It is a player weapon) is TRUE
Bool: IT is a player weapon
Object: IT
Operation: is TRUE
Then perforn the following actions:
Play 2D Sound Bell2
PlayerObject: IT
Volume: 100.0%
Show HUD message SwitchActivated
Message: SwitchActivated


Everything is working I just did not see the following as a chioce to use:

"Play object Sound animation from frame 0 to 20, cycle time = 1.00, looping=FALSE"


but it seems to be working fine, so I am ready for more assignments if you are.

NightmareUSA
Back to top
View user's profile Send private message
Atan
Moderator


Joined: 27 Jul 2001
Posts: 876

PostPosted: 29.04.2004, 22:31    Post subject: Reply with quote

Everything is working I just did not see the following as a chioce to use:
"Play object Sound animation from frame 0 to 20, cycle time = 1.00, looping=FALSE"


Sorry, my English is not the best Traurig
You'll say that you didn't see why this point was inserted by me?
If:
This should animate the switch if it's hit.

Ok, nevertheless, I hope you see the switch-animation.

Next time we will add some more things.
In the meantime please insert a normal door anywhere in your level and name it MyDoor.
Back to top
View user's profile Send private message
NightmareUSA
Forum-Nutzer


Joined: 25 Apr 2004
Posts: 43
Location: New York USA

PostPosted: 30.04.2004, 04:56    Post subject: Reply with quote

OK I will do that in the morning.
Back to top
View user's profile Send private message
NightmareUSA
Forum-Nutzer


Joined: 25 Apr 2004
Posts: 43
Location: New York USA

PostPosted: 01.05.2004, 21:51    Post subject: Reply with quote

OK I have a level with a door.
Back to top
View user's profile Send private message
Atan
Moderator


Joined: 27 Jul 2001
Posts: 876

PostPosted: 01.05.2004, 22:41    Post subject: Reply with quote

ok, two very easy things are following now:

--------------------------------------------------------------
Nr. 6:

hit the switch should activate a door.

//--------

Script001: PlaySound

Owner: Sound

Event: Collided (With IT)

if the following condition is met :
(IT is a player weapon)= (TRUE)

then perform following actions:
Play 2D Sound Bell for player object IT Volume 100%

Play object Sound animation from frame 0 to 20, cycle time = 1.00, looping=FALSE

Show HUD message ShowHitText

Activate door MyDoor

Do Nothing

--------------------------------------------------------------
Please remove the 'Auto close' Flag for this door in D3Edit (DoorwayBar)
if it is set.


Nr. 7:
hit the switch should open a door.

//--------

Script001: PlaySound

Owner: Sound

Event: Collided (With IT)

if the following condition is met :
(IT is a player weapon)= (TRUE)

then perform following actions:
Play 2D Sound Bell for player object IT Volume 100%

Play object Sound animation from frame 0 to 20, cycle time = 1.00, looping=FALSE

Show HUD message ShowHitText

Set door MyDoor position to 100%

Do Nothing

--------------------------------------------------------------

See the difference between the last two examples?
First should Open/Close the door,
second should Open it only.

Next time we will add a timer to close that door again.

Please tell me how we could prevent opening the door
by direct hit, you know, so it can be opened by the switch only.
Any idea?
hint: we must do something at Event Levelstart


Last edited by Atan on 01.05.2004, 23:54; edited 1 time in total
Back to top
View user's profile Send private message
NightmareUSA
Forum-Nutzer


Joined: 25 Apr 2004
Posts: 43
Location: New York USA

PostPosted: 02.05.2004, 03:09    Post subject: Reply with quote

well I understand what the difference should be, but my script did not seem to change the door operation. I put opne switch to open and one switch to close it.

As far as your question goes I believe you would insert another script that would be owned by the level, named LevelStart

myDoor should be assigned to something but nothing I tried with the scripts worked. I did get it to work by locking the door in its properties window in D3Edit.

This is great Atan!

NightmareUSA
Back to top
View user's profile Send private message
Atan
Moderator


Joined: 27 Jul 2001
Posts: 876

PostPosted: 02.05.2004, 10:35    Post subject: Reply with quote

Activate should Open the door which closes automaticly
if.. the Flag 'AutoClose' in DoorwayBar is set for this door.
(Sure we should not use a blastable door her Winken )

Set postion to 100% means that the door should open only.
Flag 'autoClose' must be cleared for this otherwise it will close again with out a new event.

K, we must first see if this will work for you now,
or why it not work as discribed.
BTW, no need for a second switch for now, but let it still inside your level.

Yes you are right, at Levelstart we can set the Door behavior.
Please remove the Lock flag in DoorwayBar.
(This is fine too, but not what we want to do test out Smilie )

-----------------------------------------------------
->NewScript (add it to your existing, this was clear, or?)

Script002: name it Start
Owner : Level
Event : Level Start

If the following condition is met

always

Then perform the following actions:

LOCK door MyDoor
Do nothing
-----------------------------------------

This should Lock the door for you by script.
Test it out.

We need this new Script for the next steps, so let it inside.

Last stand should be a door which is locked
and set too 100% (opened but not closing) if you hit the switch.
Can we go ahead?
Back to top
View user's profile Send private message
NightmareUSA
Forum-Nutzer


Joined: 25 Apr 2004
Posts: 43
Location: New York USA

PostPosted: 03.05.2004, 23:44    Post subject: Reply with quote

I will try to get my scipt working tonight in about 4 hours when I get home from work.

Go ahead and continue. Auf den Arm nehmen

NightmareUSA
Back to top
View user's profile Send private message
Atan
Moderator


Joined: 27 Jul 2001
Posts: 876

PostPosted: 04.05.2004, 16:52    Post subject: Reply with quote

Nr. 9:
Close door by timer event

This needs to prepare some things before:
Open Dallas, -> Open the user type workshop -> Timer Id -> Add new value
name it 'CloseDoor'

New Script003 Name: Close Door
//--------

Script003: Close Door

OWner: Level

Event: Timer(TIMER ID) Went Off

if the following condition is met:
(CloseDoor)=(TIMER ID)

Then perform the following actions:
Set door MyDoor to 0.0%

Do nothing
-------------

Ok, this script will look for the level timer event CloseDoor
and then set the door animation to 0.0 (Close the door)
But before it will work, we must do what?

Right, we must start a level timer first..
we change our well known Script001 like this:
--------------------------------------------------------------

Nr. 10:
hit the switch should open a door.

//--------

Script001: PlaySound

Owner: Sound

Event: Collided (With IT)

if the following condition is met :
(IT is a player weapon)= (TRUE)

then perform following actions:
Play 2D Sound Bell for player object IT Volume 100%

Play object Sound animation from frame 0 to 20, cycle time = 1.00, looping=FALSE

Show HUD message ShowHitText

Set door MyDoor position to 100%

Generate level timer event in 10 seconds using with ID CloseDoor

Do Nothing
--------------------------------------------------------------

Try it out, it should work.
The door opens abd after a 10 secs delay ist will close again.
Works for you?

So, what about multiple hitting the switch with i.e. vauss, laser?
could this be dangerous for our idea?
Hm, what idea?
Ok, goal is shooting the switch, it should open one time,
and close again. Next hits should not open the door again,
...you had your chance to reach a goody Winken
Any idea how to realize that?

Next time we will try that by two different ways.


Last edited by Atan on 05.05.2004, 17:40; edited 1 time in total
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Descentforum.DE Forum Index -> English Embassy / International Descenters Forum All times are GMT + 2 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
PayPal


Descent is a trademark of Interplay Productions.
Descent, Descent II are © Parallax Software Corporation.
Descent III is © Outrage Entertainment.
Descentforum.DE and Descentforum.NET is © by Martin "Do_Checkor" Timmermann.
Powered by phpBB © 2001-2008 phpBB Group