Ifflag/destroy commands not working right?

Started by ToasterApocalypse, July 26, 2012, 10:26:54 PM

Previous topic - Next topic

ToasterApocalypse

So I was making a level (With internal scripting, yay) and then I found that destroy() and ifflags don't work.

what do

Hilbert

I dunno about destroy, but or ifflag you have to use customifflag(???,???) (I think...)

Dav999

Not all of the simplified commands work in internal scripting, I don't think any gravity lines or warp tokens are destroyed in the real game.
And AFAIK, if you refer to a script in internal scripting, it loads a built-in script, and I think it also works with flags from the real game.

ToasterApocalypse

Quote from: Dav999 on July 26, 2012, 10:34:42 PM
Not all of the simplified commands work in internal scripting, I don't think any gravity lines or warp tokens are destroyed in the real game.
And AFAIK, if you refer to a script in internal scripting, it loads a built-in script, and I think it also works with flags from the real game.

Oh ok. I don't think I can create a warp gate then.

I like how internal scripts won't even work anymore now.

Dav999

#4
You can create a warp gate, you just have to stop the internal code without using loadscript(stop) and without dialog rubbish, so something like this:

say(-1)
text(1,0,0,4)
say(5)
text(gray,0,0,1)
Text box 1.
position(center)
speak_active
text(1,0,0,4)
say(3)
text(gray,0,0,2)
The warp tokens will
now be destroyed.
destroy(warptokens)
say(-1)
text(1,0,0,4)
say(5)
Etc.


You won't need position(x) and speak_active for the last text box, because it's already put at the end of the say command. And if you don't want to use a text box at all in that script, and you can't put it at the very beginning, then I don't know... But there should be a way.

EDIT: maybe you can use gotoroom(x,x) to teleport to a similar room in which the walls are destroyed or something like that.

blue626

#5
Quote from: Dav999 on July 26, 2012, 10:34:42 PM
I don't think any gravity lines or warp tokens are destroyed in the real game.

After you complete the Gravitron, the bottom line is destroyed.

Btw: I suspect that when :viridian: enters the Gravitron, a script is started, and it's similar to this:

hascontrol()
(command to create upper grav. line)
(Gravitron command)

delay(1800)
destroy((the lower grav. line))

The facts that some people here know about internal scripting, that some (like me) learn something about it from those people and that some make levels with that scripting are interesting.
EDIT: I'm not going to make a level with internal scripting, though.

Dav999

Quote from: blue626 on July 26, 2012, 11:19:51 PM
Quote from: Dav999 on July 26, 2012, 10:34:42 PM
I don't think any gravity lines or warp tokens are destroyed in the real game.

After you complete the Gravitron, the bottom line is destroyed.

Btw: I suspect that when :viridian: enters the Gravitron, a script is started, and it's similar to this:

hascontrol()
(command to create upper grav. line)
(Gravitron command)

delay(1800)
destroy((the lower grav. line))

The facts that some people here know about internal scripting, that some (like me) learn something about it from those people and that some make levels with that scripting are interesting.

The gravitron is activated by a gamestate, and the lower gravity line is destroyed in another way than how they are destroyed in custom levels. In the gravitron it disappears from left to right, in custom levels it disappears immediately.
And I'm sure it doesn't use delay(1800), because then it would disappear 60 seconds after the gravitron is started, so if you die, it doesn't disappear when it should; that means when the timer reaches 0.
But I get the idea. It has to be programmed somewhere. (and if it's hardcoded in, then it just won't work without using simplified scripting. I would use simplified scripting in this case)

FIQ

Quote from: Dav999 on July 26, 2012, 11:36:20 PM
Quote from: blue626 on July 26, 2012, 11:19:51 PM
Quote from: Dav999 on July 26, 2012, 10:34:42 PM
I don't think any gravity lines or warp tokens are destroyed in the real game.

After you complete the Gravitron, the bottom line is destroyed.

Btw: I suspect that when :viridian: enters the Gravitron, a script is started, and it's similar to this:

hascontrol()
(command to create upper grav. line)
(Gravitron command)

delay(1800)
destroy((the lower grav. line))

The facts that some people here know about internal scripting, that some (like me) learn something about it from those people and that some make levels with that scripting are interesting.

The gravitron is activated by a gamestate, and the lower gravity line is destroyed in another way than how they are destroyed in custom levels. In the gravitron it disappears from left to right, in custom levels it disappears immediately.
And I'm sure it doesn't use delay(1800), because then it would disappear 60 seconds after the gravitron is started, so if you die, it doesn't disappear when it should; that means when the timer reaches 0.
But I get the idea. It has to be programmed somewhere. (and if it's hardcoded in, then it just won't work without using simplified scripting. I would use simplified scripting in this case)
destroy() works just fine in the internal scripting scope, even though it's never used (Face this - the simplified scripting is converted to internal scripting by the parser - this is why you can access internal scripting at all by tricking it. This means that destroy() is converted to something internally - in this case, simply destroy()). Make sure that you're calling the script with the right command, i.e. customifflag(), not ifflag(). This is your problem I think.

The Gravitron uses gamestates (as stated). Gamestates calls specific hard-coded functions that Terry has programmed manually, outside of scripting scope. This is why gamestates allow "custom" things to happen w/o stopping Viridian (as usual scripts do).

Also, Stalefish was the first that discovered that you could access internal scripting in 2.0, I discovered a new method of doing it in both 2.0 and 2.1, and used it in my level and provided some examples in the forum - which I think kinda started the trend of people playing with it :p

ToasterApocalypse

Quote from: FIQ on July 27, 2012, 04:27:50 PM
Quote from: Dav999 on July 26, 2012, 11:36:20 PM
Quote from: blue626 on July 26, 2012, 11:19:51 PM
Quote from: Dav999 on July 26, 2012, 10:34:42 PM
I don't think any gravity lines or warp tokens are destroyed in the real game.

After you complete the Gravitron, the bottom line is destroyed.

Btw: I suspect that when :viridian: enters the Gravitron, a script is started, and it's similar to this:

hascontrol()
(command to create upper grav. line)
(Gravitron command)

delay(1800)
destroy((the lower grav. line))

The facts that some people here know about internal scripting, that some (like me) learn something about it from those people and that some make levels with that scripting are interesting.

The gravitron is activated by a gamestate, and the lower gravity line is destroyed in another way than how they are destroyed in custom levels. In the gravitron it disappears from left to right, in custom levels it disappears immediately.
And I'm sure it doesn't use delay(1800), because then it would disappear 60 seconds after the gravitron is started, so if you die, it doesn't disappear when it should; that means when the timer reaches 0.
But I get the idea. It has to be programmed somewhere. (and if it's hardcoded in, then it just won't work without using simplified scripting. I would use simplified scripting in this case)
destroy() works just fine in the internal scripting scope, even though it's never used (Face this - the simplified scripting is converted to internal scripting by the parser - this is why you can access internal scripting at all by tricking it. This means that destroy() is converted to something internally - in this case, simply destroy()). Make sure that you're calling the script with the right command, i.e. customifflag(), not ifflag(). This is your problem I think.

The Gravitron uses gamestates (as stated). Gamestates calls specific hard-coded functions that Terry has programmed manually, outside of scripting scope. This is why gamestates allow "custom" things to happen w/o stopping Viridian (as usual scripts do).

Also, Stalefish was the first that discovered that you could access internal scripting in 2.0, I discovered a new method of doing it in both 2.0 and 2.1, and used it in my level and provided some examples in the forum - which I think kinda started the trend of people playing with it :p

So the timeline of internal scripting

Terry-Stalefish-You-Afewotherpeople

Dav999

I tested the destroy(x) command in internal scripting, and everything seemed to work like it does using simplified scripting. destroy(gravitylines) destroys gravity lines, destroy(warptokens) destroys warp tokens, and destroy(platforms), well, stops moving platforms and makes them invisible.

blue626

#10
Quote from: Dav999 on July 26, 2012, 11:36:20 PM
In the gravitron it disappears from left to right, in custom levels it disappears immediately.
And I'm sure it doesn't use delay(1800), because then it would disappear 60 seconds after the gravitron is started, so if you die, it doesn't disappear when it should; that means when the timer reaches 0.

In the graviton it disappears immediately, I think. I will check that. The upper line appears from left to right, you might have confused those two actions.

Quote from: ToasterApocolypse on July 27, 2012, 04:30:06 PM
So the timeline of internal scripting

Terry-Stalefish-You-Afewotherpeople

Stalefish only found how to make coloured text. He/she also taught other people.

EDIT: One of those, PJBottomz, found how to do the other things internal scripting can do, like changing the player's color, make a crewmate follow :viridian: (but not exactly like Int. 1, and it only works on :vermillion:) and play as VVVVVVMan (spoiler: the combined person)

Dav999

Quote from: blue626 on July 28, 2012, 12:37:01 PM
Quote from: Dav999 on July 26, 2012, 11:36:20 PM
In the gravitron it disappears from left to right, in custom levels it disappears immediately.
And I'm sure it doesn't use delay(1800), because then it would disappear 60 seconds after the gravitron is started, so if you die, it doesn't disappear when it should; that means when the timer reaches 0.

In the graviton it disappears immediately, I think. I will check that. The upper line appears from left to right, you might have confused those two actions.

I just checked it, and it does disappear from left to right, so it doesn't disappear immediately.

Quote from: blue626 on July 28, 2012, 12:37:01 PM
Quote from: ToasterApocolypse on July 27, 2012, 04:30:06 PM
So the timeline of internal scripting

Terry-Stalefish-You-Afewotherpeople

Stalefish only found how to make coloured text. He/she also taught other people.

EDIT: One of those, PJBottomz, found how to do the other things internal scripting can do, like changing the player's color, make a crewmate follow :viridian: (but not exactly like Int. 1, and it only works on :vermillion:) and play as VVVVVVMan (spoiler: the combined person)

I also played with internal scripting after Stalefish found it out, and I wanted to use the alarm in my level, so I searched for 'alarm' in the binary, and found 'alarmon' and 'alarmoff'. But that was one year ago, and I never released levels at that time (because I just read the forum, and I didn't make an account on the forum yet.) The levels I made at that time were just because I wanted to use the level editor, without actually releasing the levels.

ToasterApocalypse

When I change  :viridian:'s colour to, say  :vermillion: using changecolour.

But when he dies,  :vermillion: becomes  :viridian: again.

Dav999

Quote from: ToasterApocolypse on July 28, 2012, 02:03:42 PM
When I change  :viridian:'s colour to, say  :vermillion: using changecolour.

But when he dies,  :vermillion: becomes  :viridian: again.

I also noticed that, and that's why it isn't possible to die where I use that in my new level!

blue626

Quote from: Dav999 on July 28, 2012, 01:28:00 PM
Quote from: blue626 on July 28, 2012, 12:37:01 PM

In the graviton it disappears immediately, I think. I will check that. The upper line appears from left to right, you might have confused those two actions.

I just checked it, and it does disappear from left to right, so it doesn't disappear immediately.

I was wrong, then.
Also, I fixed the script above (that I wrote) and added some commands:

hascontrol()
music(2)
Command to create upper gravity line from left to right
gamestate(Gravitron number)
destroy(lower gravity line from left to right)
music(6)

If you know what to write where I wrote in italic, you know how to create a Gravitron in a user level! I suppose that the gamestate command creates the timer too, am I right? Does it delay the next actions to when timer reaches 0,00? If no, then it needs something else...
The music commands should work, if you really can use simplified scripting next to internal scripting, like you said. Of course, you don't need to change music, change it twice or change exactly to those songs; but those are the ones that are changed in the main game, in the Gravitron.