Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → darn cutscene
darn cutscene
2002-01-10, 8:15 AM #1
trying to make a cutscene...heres the cog...it never starts when i play the level..I just start as a player...Its in placed cogs and everything with the right values...but the cog just doesn't seem to start what's wrong??

Code:
symbols

thing        camera1 
thing		 camera2                                                                                                                                              
thing        bartender                                                            
thing        nox
thing		 nox2
thing		 alin
thing        player                             local                         
thing        kyle                               local  
 
keyframe	 bartstand=bartenderstand.key		local

sound		 alin1=alintrapdoor.wav	            local                                             			
sound		 alin2=alinwarsaw.wav	            local
sound		 alin3=alinluck.wav	            local
sound		 nox1=noxthx.wav	                  local

int		 keynum					local  
    
message      startup                                                          

end                                                                           

code

startup:

  Player = GetLocalPlayerThing();
  SetActorFlags(Player, 0xa00000);
  StopThing(Player);
  keynum=PlayKey(bartender, bartstand, 0x4);
  SetCameraFocus(0, camera1);
  MoveToFrame(camera1, 4, 0.5);
  Sleep(5.0);
  PlaySoundLocal(alin1, 1, 0, 132);
  Print("Alin: This trapdoor leads to an underground tunnel.");
  Sleep(1.0);
  Print("Alin: Eventually it comes up via another trapdoor inside a storage room,");
  Sleep(1.0);
  Print("Alin: This will get you inside the castle walls, but not the manor itself.");
  Sleep(2.0);
  PlaySoundLocal(alin2, 1, 0, 132);
  Print("Alin: I'm staying at the Warsaw Inn...meet me outside it when you've finished.");
  Sleep(2.0);
  PlaySoundLocal(nox1, 1, 0, 132);
  Print("Nox: Thank you Alin."
  Sleep(2.0);
  PlaySoundLocal(alin3, 1, 0, 132);
  Print("Alin: Good luck Nox!");
  Sleep(3.0);
  SetCameraFocus(0, camera2);
  AiSetMoveFrame(nox, 2); 
  Sleep(5.0);
  jkEndLevel(1);
Return;

end


[edit]updated code[/edit]

[This message has been edited by Frantic (edited January 10, 2002).]
Save a tree, Kill a beaver!
2002-01-10, 10:55 AM #2
You made several mistakes common to n00b coggers.

1) The 'JKcutscene()' verbs only work in MOTS. So, if this is JK, remove them.

2) A sleep() of 0.0 is futile. Remove it.

3) You used 'Movetoframe' incorrectly.

  (a) You only need one of them: Movetoframe(Camera1, 4, 0.5), the object will move through all the frames inbetween.
  (b) You need to tell the cog to wait before the object reaches the end. Either wil 'Sleep', or the 'Arrived' message. Otherwise, the cog will start playing sounds and whatnot while the camera is still in transit.

4) DOnt use 'Print()' for the printed text. Use UNI or ASCII strings for that.

5) The cog not starting is problably because you used the 'JKcutscene' verbs and this is JK. Remove them, and it should work.

6) There is alot more wrong with this cog, but Im tired, so Ill stop here.


------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2002-01-10, 1:03 PM #3
I fixed all you said, but still no difference...
Save a tree, Kill a beaver!
2002-01-10, 2:13 PM #4
Post your new cog.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2002-01-10, 4:36 PM #5
I did...
Save a tree, Kill a beaver!
2002-01-11, 5:06 AM #6
I have found that this will work...
Code:
symbolsthing        camera1 thing		 camera2                                                                                                                                              thing        bartender                                                            thing        noxthing		 nox2thing		 alinthing        player                             local                         thing        kyle                               local   keyframe	 bartstand=bartenderstand.key		localsound		 alin1=alintrapdoor.wav	            local                                             			sound		 alin2=alinwarsaw.wav	            localsound		 alin3=alinluck.wav	            localsound		 nox1=noxthx.wav	                  localint		 keynum					local      message      startup                                                          end                                                                           codestartup:  Player = GetLocalPlayerThing();  SetActorFlags(Player, 0xa00000);  StopThing(Player);  keynum=PlayKey(bartender, bartstand, 0x4);  SetCameraFocus(0, camera1);  MoveToFrame(camera1, 4, 0.5);  Sleep(5.0);  PlaySoundLocal(alin1, 1, 0, 132);  Print("Alin: This trapdoor leads to an underground tunnel.");  Sleep(1.0);  Print("Alin: Eventually it comes up via another trapdoor inside a storage room,");  Sleep(1.0);  Print("Alin: This will get you inside the castle walls, but not the manor itself.");  Sleep(2.0);  PlaySoundLocal(alin2, 1, 0, 132);  Print("Alin: I'm staying at the Warsaw Inn...meet me outside it when you've finished.");  Sleep(2.0);  PlaySoundLocal(nox1, 1, 0, 132);  Print("Nox: Thank you Alin."  Sleep(2.0);  PlaySoundLocal(alin3, 1, 0, 132);  Print("Alin: Good luck Nox!");  Sleep(3.0);  SetCameraFocus(0, camera2);  AiSetMoveFrame(nox, 2);   Sleep(5.0); Return;end 

End the level another way sometimes this works for me... Try setting it up with GOAL so when the cutsign is done then it ends the level.

------------------
Yea though I walk through the valley of the shadow of death...
I will fear no evil for I am the most evil female in the valley!
2002-01-12, 7:44 AM #7
try this[you missed some syntax]:
Code:
symbols

thing        camera1
thing camera2                                                                                                                                             
thing        bartender                                                           
thing        nox
thing nox2
thing alin
thing        player                             local                        
thing        kyle                               local 

keyframe bartstand=bartenderstand.keylocal

sound alin1=alintrapdoor.wav            local                                            
sound alin2=alinwarsaw.wav            local
sound alin3=alinluck.wav            local
sound nox1=noxthx.wav                  local

int keynumlocal 
   
message      startup                                                         

end                                                                          

code

startup:

  Player = GetLocalPlayerThing();
  SetActorFlags(Player, 0xa00000);
  StopThing(Player);
  keynum=PlayKey(bartender, bartstand, 0x4);
  SetCameraFocus(0, camera1);
  MoveToFrame(camera1, 4, 0.5);
  Sleep(5.0);
  PlaySoundLocal(alin1, 1, 0, 132);
  Print("Alin: This trapdoor leads to an underground tunnel.");
  Sleep(1.0);
  Print("Alin: Eventually it comes up via another trapdoor inside a storage room,");
  Sleep(1.0);
  Print("Alin: This will get you inside the castle walls, but not the manor itself.");
  Sleep(2.0);
  PlaySoundLocal(alin2, 1, 0, 132);
  Print("Alin: I'm staying at the Warsaw Inn...meet me outside it when you've finished.");
  Sleep(2.0);
  PlaySoundLocal(nox1, 1, 0, 132);
  Print("Nox: Thank you Alin.");
  Sleep(2.0);
  PlaySoundLocal(alin3, 1, 0, 132);
  Print("Alin: Good luck Nox!");
  Sleep(3.0);
  SetCameraFocus(0, camera2);
  AiSetMoveFrame(nox, 2);
  Sleep(5.0);
  jkEndLevel(1);
Return;

end
Also, I can kill you with my brain.
2002-01-13, 7:56 AM #8
Who's the n00b cogger NOW, GBK? Dor got the only thing that was making it not work, and you screwed me up by telling me you only need the last camera frame line, when infactyou need them all...
Save a tree, Kill a beaver!
2002-01-13, 9:52 AM #9
Quote:
<font face="Verdana, Arial" size="2">Originally posted by Frantic:
...infactyou need them all...</font>



No, you dont.

 

Scenario:

An object is at frame 0. Object needs to move to frame 5.

Solution:

Movetoframe(Object, 5, 1);

 


The object will move to frame 5, via all the frames inbetween[/b]. If you dont believe me, try it.

 

On the other hand, 'Skiptoframe()' would move directly to said frame. Dont confuse the two verbs, they do completly different things.

------------------
Success is the inverse relationship between effort, gain, and loss.

[This message has been edited by GBK (edited January 13, 2002).]
And when the moment is right, I'm gonna fly a kite.
2002-01-14, 7:21 AM #10
My god, GBK, I DID TRY IT. I had your line first, then the cam didn't move at all...then I put all the frames, and the camera moved! Geez don't be such a stubborn smarty pants. your wrong.

[This message has been edited by Frantic (edited January 14, 2002).]
Save a tree, Kill a beaver!
2002-01-14, 8:41 AM #11
Quote:
<font face="Verdana, Arial" size="2">Originally posted by Frantic:
...your wrong.</font>



No, Im not.


I know, for certain, as an absolute,
undeniable fact, that I am correct. Do not
mistake your improper use of syntax as some
kind of mistake on my part.


Consider this, a cog will execute a command,
and then emmedietly move on to the next [The
exception being 'Sleep()'], so, if you have
a list of Movetoframe()s,


Code:
Movetoframe(Object, 1, 1);
Movetoframe(Object, 2, 1);
Movetoframe(Object, 3, 1);
Movetoframe(Object, 4, 1);
Movetoframe(Object, 5, 1);


It will execute the first, moving the object
to frame 1. However, before the object even
begins to move, it is given another order,
to move to frame 2. So, it cancels the first
command, and begins to move to frame 2.
But, then another, frame 3. And so on. So,
before the object even has a chance to move
to frame 1, it is on its way to frame 5.
Since it will not retain previous move
commands, it is moving From frame
0, To/b] frame 5.


In other words, there is no reason to script
5 move commands, as the first 4 are not
carried out. Only the last one is.

If you still dont believe me, of the
preceeding confused you, try the following
cog. It has no purpose, cept to prove my
point. You will need to set up an object
with more than 2 frames.


Code:
#01/2002 GBK
Symbols
Message Activated
Thing Object
Int Targetframe=2
Flex Movespeed=1
End
Code
Activated:
Movetoframe(Object, Targetframe, Movespeed);
Stop;
End



I think the variables are self-explanitory.
If not:

Object: The thing with the frames, that you want to move.

Targetframe: The last frame of your object. This is your JED object's number of frames, minus 1.

Movespeed: How fast you want it to go.


 

It would be a good idea to place the frames
in a non-linear pattern, so you can plainly
see that it is moving through all of them.


------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2002-01-15, 8:27 PM #12
Frantic there is no need to act like a jerk... Are you maybe doing something wrong that GBK's method is not working ?
2002-01-15, 9:23 PM #13
Eh, excuse me Frantic, would you cuss at someone kind enough to

look at your code
give suggestions
explain

for YOU?
Stop that.

------------------
http://millennium.massassi.net/ - Millennium
2002-01-18, 1:26 PM #14
Sorry to jump in the middle of this insanity, but as for GBK's fourth point, why not use "Print()"?

------------------
Dead Reckoning and Dead Reckoning 2
Dead Reckoning
2002-01-18, 2:26 PM #15
'Print()' should only be used for debugging. For some reason, it takes less memory to use UNI or strings, and if a system is low on resources, the text might not appear.

So, use UNI or strings.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2002-01-19, 5:35 AM #16
But have you ever had that happen, GBK?

When your system gets low on resources, you're going to see projectiles disappear and
things like that; this I have seen. So if it comes to that, who cares if a print doesn't
work?

[This message has been edited by SaberMaster (edited January 19, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-01-19, 6:06 AM #17
Personally, no. I run a K7-1.33Ghz, with 256Mb ram. I dont think Ill ever encounter that problem. However, most people are still running PII-200 class systems, low enough that they might cause problems.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2002-01-20, 2:15 PM #18
GBK is right on the movetoframe, Frantic. Check that you actually did have the 5 frames when you told it to go to frame 5.
2002-01-20, 2:16 PM #19
Oh and GBK, thanks for the skiptoframe command, I had hell with sequenced items that were meant to move to various places but didnt, hence how I came across the movetoframe problem.
2002-01-20, 9:46 PM #20
If you're moving to frame 5, shouldn't you have 6 frames for your object?
If there were only 5 frames, putting all the MovetoFrame verbs in would result in MovetoFrame(4) being carried out as MovetoFrame(5) wasn't valid, whereas with just MovetoFrame(5), it does nothing, because that isn't a valid command. Semantically invalid anyway.
2002-01-21, 4:26 AM #21
Depends on how you look at it. JED counts frames from 1. 1.2.3.4.5... JK, however, counts frames from 0. 0.1.2.3...

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.

↑ Up to the top!