ABVXYzackattack Posted June 25, 2011 Share Posted June 25, 2011 Hey Skevitj. I said I was done needing your help, but a few of my scripts for some reason aren't working like they should: This one is confusing why it didn't work. It's a effect on a radio to call in an artillery strike, but it's not working: ------------------------------------------------------------------scn ZArtilleryRadioEffectScript short doonce Begin ScriptEffectStart if doonce == 0 && menumode == 0 ZNCRShot1.placeatme NellisArtilleryExplosionZNCRShot2.placeatme NellisArtilleryExplosionZNCRShot3.placeatme NellisArtilleryExplosionplayer.removeitem ZNCRArtilleryRadio 1 set doonce to 1 endif end----------------------------------------------------------------- This one's a bit more complex. But it involved making a gunship fly over and launch a few rockets in a trigger zone area: --------------------------------------------------------------------scn ZGunshipScript short RunTimer float TimerVar Begin OnTriggerEnter Player If ZRenoBasinMission.choice3 == 1GetSecondsPassed set TimerVar to 0 set RunTimer to 1 ZNCRGunShipNEW.playgroup fastleft 1endifend Begin GameMode if RunTimer < 1 return endif set TimerVar to TimerVar + GetSecondsPassed if TimerVar>=13ZGunShipMissile1.fireweapon WeapMissileLauncherZGunShipMissile2.fireweapon WeapMissileLauncherZGunShipMissile3.fireweapon WeapMissileLauncherZGunShipMissile4.fireweapon WeapMissileLauncherZGunShipMissile5.fireweapon WeapMissileLauncherset RunTimer to 0 endif end-------------------------------------------------------------------------- What can I do to fix these scripts!?!?!? Link to comment Share on other sites More sharing options...
Skevitj Posted June 26, 2011 Share Posted June 26, 2011 (edited) lol at my name in the topic. If you want my help with a problem, a better bet might be to PM me with the problem or a link to where you posted it. I only really look at the "New Topics" tab so I usually miss a fair few, it was only luck that I saw this one. What exactly are you trying to do with the first script? Is the radio an activator, consumable, other etc?I'm assuming the radio object (ZNCRArtilleryRadio) is a "consumable" item (As far as I know, you can't use activators and other objects as you can't trigger OnActivate)? If the script is applied to the actual object ScriptEffectStart will never trigger, however if you use that script to create a "Base Effect" which uses the script, IE: For a "Base Effect", "Effect Archetype" should be "script" and "Assoc. Item" should be the script, then use that base effect as a "Result" effect of the consumable radio, that will ensure the script runs when the object is equipped/consumed, and it will also take care of the removal of the object since you're "consuming" it.scn... Begin ScriptEffectStart ZNCRShot1.placeatme NellisArtilleryExplosion ZNCRShot2.placeatme NellisArtilleryExplosion ZNCRShot3.placeatme NellisArtilleryExplosion endThis would be sufficient assuming the radio is implemented as I've said above. An alternative if you can get the mesh sorted out would be to have the radio as a weapon (and the script directly on the weapon), so the PC equips it, then using the OnFire block type you could have it's effects trigger when the PC "fires" (left mouse) while it is equipped. That's probably the most realistic, but would also require the most work, unless you can find a pre-made radio mesh (with the correct attachments or whatever you need for it to be equip-able) someone is willing to let you use. As for the second script, what's the script attached to? The OnTriggerEnter needs to know what zone is triggering it, hence if that block is used the script needs to be attached to the relevant trigger zone. If it's attached to the gunship, then change the OnTriggerEnter to OnActivate and place a script on the trigger zone which will "Activate" the vertibird.scn... Begin OnTriggerEnter Player VertibirdRef.Activate this 1 endI'm not entirely sure how the Activate command should be structured, but at any rate the RunOnActivateBlockFlag needs to be 1. "this" may be redundant, but I'm not sure if it will interpret the flag correctly if you don't specify the ActionRef. Edited June 26, 2011 by Skevitj Link to comment Share on other sites More sharing options...
Recommended Posts