Changing a texture or changing an object with a trigger
Moderator: Moderators
That is right last one made is entity 1 that is why a lot of the scripts use #set or #group or what ever number # you want #slide for example . Then you check the # like this
key:#slide
value: 1 ( to 5 )
main:
thread slideshow
....
....
end
slideshow:
for(local.slide_to_show=1;local.slide_to_show<=5;local.slide_to_show++) // start counting 1 to 5
{
for(local.i=1;local.i<= $slide.size;local.i++) //loop through each slide
{
if ($slide[local.i].slide==local.slide_to_show) // if #slide is the right number
show $slide[local.i] // show it
else
hide $slide[local.i] // if not hide it
}
wait 6 // wait between slides
}
goto slideshow
end
key:#slide
value: 1 ( to 5 )
main:
thread slideshow
....
....
end
slideshow:
for(local.slide_to_show=1;local.slide_to_show<=5;local.slide_to_show++) // start counting 1 to 5
{
for(local.i=1;local.i<= $slide.size;local.i++) //loop through each slide
{
if ($slide[local.i].slide==local.slide_to_show) // if #slide is the right number
show $slide[local.i] // show it
else
hide $slide[local.i] // if not hide it
}
wait 6 // wait between slides
}
goto slideshow
end
Control
I think you need to read the first post again, bdbodger. He wants to control the slide show in the game--not on automattic. An automattic slide show can be done with just an animation shader--nothing needed in the main script. There is one on the TV set in my doors2 tutorial map.
But, that is interesting about assigning numbers to an array of entities. I have used #set, #group, and #pause, but I did not know you could create your own #name.
But, that is interesting about assigning numbers to an array of entities. I have used #set, #group, and #pause, but I did not know you could create your own #name.
If you would like a newbies view on the matter ramah (newbies might understand each other easier
). Couldn't you do something like this:
$slide0 show
$slide1 hide
$slide2 hide
$slide3 hide
if ($shown_slide == 0) // If blank slide is active
{
$slide0 hide
wait 0.1
$slide1 show
$shown_slide = 1
}
elsif ($shown_slide == 1) // If first slide is active
{
$slide1 hide
wait 0.1
$slide2 show
$shown_slide = 2
}
elsif ($shown_slide == 2) // If second slide is shown
{
$slide2 hide
wait 0.1
$slide3 show
$shown_slide = 3
}
elsif ($shown_slide == 3) // If third slide is shown, loop back round
{
$slide3 hide
wait 0.1
$slide0 hide
$shown_slide = 0
}
If that was called by the trigger every time it was activated I woulda thought that would work, it would change on trigger as you want too (not auto). But I could quite easily be wrong.
Hope it helps.
Bilko.
$slide0 show
$slide1 hide
$slide2 hide
$slide3 hide
if ($shown_slide == 0) // If blank slide is active
{
$slide0 hide
wait 0.1
$slide1 show
$shown_slide = 1
}
elsif ($shown_slide == 1) // If first slide is active
{
$slide1 hide
wait 0.1
$slide2 show
$shown_slide = 2
}
elsif ($shown_slide == 2) // If second slide is shown
{
$slide2 hide
wait 0.1
$slide3 show
$shown_slide = 3
}
elsif ($shown_slide == 3) // If third slide is shown, loop back round
{
$slide3 hide
wait 0.1
$slide0 hide
$shown_slide = 0
}
If that was called by the trigger every time it was activated I woulda thought that would work, it would change on trigger as you want too (not auto). But I could quite easily be wrong.
Hope it helps.
Bilko.
Ok what about this then
trigger use
key:setthread
value:slideshow
main:
level.slide=1
...
thread slide_setup
end
slide_setup:
for(local.i=2;local.i<=$slide.size;local.i++)
$slide[local.i] hide // hide all slides after slide 1
end
slideshow:
$slide[level.slide] hide
level.slide++
if (level.slide > $slide.size)
level.slide=1
$slide[level.slide] show
end
or if you want to use a #set for each slide
slide_setup:
for(local.i=1;local.i<=$slide.size;local.i++)
{
if(slide[local.i].set > level.slide )
$slide[local.i] hide // hide all slides after slide 1
}
end
slideshow:
for(local.i=1;local.i<=$slide.size;local.i++)
{
if($slide[local.i].set=level.slide)
$slide[local.i] hide
}
level.slide++
if (level.slide > $slide.size)
level.slide=1
for(local.i=1;local.i<=$slide.size;local.i++)
{
if($slide[local.i].set=level.slide )
$slide[local.i] show
}
end
trigger use
key:setthread
value:slideshow
main:
level.slide=1
...
thread slide_setup
end
slide_setup:
for(local.i=2;local.i<=$slide.size;local.i++)
$slide[local.i] hide // hide all slides after slide 1
end
slideshow:
$slide[level.slide] hide
level.slide++
if (level.slide > $slide.size)
level.slide=1
$slide[level.slide] show
end
or if you want to use a #set for each slide
slide_setup:
for(local.i=1;local.i<=$slide.size;local.i++)
{
if(slide[local.i].set > level.slide )
$slide[local.i] hide // hide all slides after slide 1
}
end
slideshow:
for(local.i=1;local.i<=$slide.size;local.i++)
{
if($slide[local.i].set=level.slide)
$slide[local.i] hide
}
level.slide++
if (level.slide > $slide.size)
level.slide=1
for(local.i=1;local.i<=$slide.size;local.i++)
{
if($slide[local.i].set=level.slide )
$slide[local.i] show
}
end
-
Ramah Palmer
- Warrant Officer
- Posts: 131
- Joined: Sun May 25, 2003 10:13 am
- Location: Nottinghamshire: UK
Wow, thanks for all the info on this guys. I've been unable to check this or anything out for the past few days due to the msblast virus kicking in halfway through a windows update and so it corrupted my windows install.
Anyhoos, I'm back now and will attempt to unravel the myriad of answers you have given me tomorrow. I'll let you know the results.
Thanks again.
Anyhoos, I'm back now and will attempt to unravel the myriad of answers you have given me tomorrow. I'll let you know the results.
Thanks again.
Mapping is just INCREDIBLY time consuming.
-
Ramah Palmer
- Warrant Officer
- Posts: 131
- Joined: Sun May 25, 2003 10:13 am
- Location: Nottinghamshire: UK
Okay, I tried Nuggets' script and it worked fantastically! Thanks a deal!
I mixed in the idea for the projector_speaker out of Tltrude's map and it's almost working perfectly now.
My only problem is I'd like the slides appearing to match the sound now. If I increase the 'wait' time between slides it works, but this doesn't limit me pressing the switch really fast and screwing it up because it's still increasing the count.
How can I stop the switch being activated until the whole thread has finished?
Is it 'wait until' or something?
Thanks.
I mixed in the idea for the projector_speaker out of Tltrude's map and it's almost working perfectly now.
My only problem is I'd like the slides appearing to match the sound now. If I increase the 'wait' time between slides it works, but this doesn't limit me pressing the switch really fast and screwing it up because it's still increasing the count.
How can I stop the switch being activated until the whole thread has finished?
Is it 'wait until' or something?
Thanks.
Mapping is just INCREDIBLY time consuming.
-
Ramah Palmer
- Warrant Officer
- Posts: 131
- Joined: Sun May 25, 2003 10:13 am
- Location: Nottinghamshire: UK
Ok, I'm struggling to understand this one, so I got a bunch of newbie questions...
I'm to make a new thread called 'trigger'? And is this to be called INSTEAD of the thread 'slideshow'? Or FROM slideshow? If the thread is NOT called before slideshow, then should the trigger have a targetname so that the trigger thread isn't activated by every trigger in the level?
Also, the code you gave me seems to be a loop. Am I wrong?
My relevant script so far is thus:
slideshow:
$slide[level.slide_count] hide
$blank_screen show
level.slide_count++
$projector_speaker playsound slide_advance
wait .8
if (level.slide_count > $slide.size)
{level.slide_count = 1}
$slide[level.slide_count] show
$blank_screen hide
wait 3.9
end
So I guess my main question is: how do I add your code to mine? Is it a separate thread? And do I need to assign any more keys to my trigger? Ok, so that's three main questions.
I'm to make a new thread called 'trigger'? And is this to be called INSTEAD of the thread 'slideshow'? Or FROM slideshow? If the thread is NOT called before slideshow, then should the trigger have a targetname so that the trigger thread isn't activated by every trigger in the level?
Also, the code you gave me seems to be a loop. Am I wrong?
My relevant script so far is thus:
slideshow:
$slide[level.slide_count] hide
$blank_screen show
level.slide_count++
$projector_speaker playsound slide_advance
wait .8
if (level.slide_count > $slide.size)
{level.slide_count = 1}
$slide[level.slide_count] show
$blank_screen hide
wait 3.9
end
So I guess my main question is: how do I add your code to mine? Is it a separate thread? And do I need to assign any more keys to my trigger? Ok, so that's three main questions.
Mapping is just INCREDIBLY time consuming.
slideshow:
$mytriggername nottriggerable
$slide[level.slide_count] hide
$blank_screen show
level.slide_count++
$projector_speaker playsound slide_advance
wait .8
if (level.slide_count > $slide.size)
{level.slide_count = 1}
$slide[level.slide_count] show
$blank_screen hide
wait 3.9
$mytriggername triggerable
end
But use your trigger's targetname. It just turns off the trigger while the tread is running. So, the player can't trigger it untill the wait .8 and wait 3.9 are done.
That sound only lasts 1 second, so you could change "3.9" to as low as ".2" and it would still sound good. With the ".8" and the "3.9", the wait betweens slides is 5.7 seconds.
$mytriggername nottriggerable
$slide[level.slide_count] hide
$blank_screen show
level.slide_count++
$projector_speaker playsound slide_advance
wait .8
if (level.slide_count > $slide.size)
{level.slide_count = 1}
$slide[level.slide_count] show
$blank_screen hide
wait 3.9
$mytriggername triggerable
end
But use your trigger's targetname. It just turns off the trigger while the tread is running. So, the player can't trigger it untill the wait .8 and wait 3.9 are done.
That sound only lasts 1 second, so you could change "3.9" to as low as ".2" and it would still sound good. With the ".8" and the "3.9", the wait betweens slides is 5.7 seconds.
Last edited by tltrude on Sat Aug 16, 2003 6:28 pm, edited 1 time in total.
-
Ramah Palmer
- Warrant Officer
- Posts: 131
- Joined: Sun May 25, 2003 10:13 am
- Location: Nottinghamshire: UK
Ah, thanks m8, that worked a charm.
I'd actually tried to do that very same thing and change Alcoholic's code to how I thought it could be used, but it just seemed to stop the whole script from working. Now I realise what I had done, I had misread Alcoholic's post and put NONTRIGGERABLE instead of NOTTRIGERRABLE.
Ah well.
Thanks a deal you guys, all of you who posted.
I dare say I'll be back with another question very soon!
I'd actually tried to do that very same thing and change Alcoholic's code to how I thought it could be used, but it just seemed to stop the whole script from working. Now I realise what I had done, I had misread Alcoholic's post and put NONTRIGGERABLE instead of NOTTRIGERRABLE.
Ah well.
Thanks a deal you guys, all of you who posted.
I dare say I'll be back with another question very soon!
Mapping is just INCREDIBLY time consuming.
wait time
Read my last post again about the wait time. I think if the player is hitting the trigger and not getting anything for 5.7 seconds he will think it is broken, ha ha.
-
Ramah Palmer
- Warrant Officer
- Posts: 131
- Joined: Sun May 25, 2003 10:13 am
- Location: Nottinghamshire: UK
